bigeasy / stencil

Asynchronous HTML5 templates for Node.js and the browser.
MIT License
9 stars 2 forks source link

Re-enter caller scope. #25

Closed bigeasy closed 11 years ago

bigeasy commented 12 years ago

What is the use of blocks in blocks? Something like this?

<div xmlns:o="inc:layout.stencil">
<o:each>
  <div class="tweet">
    <o:image/>
  </div>
</o:each>
<o:empty>Couldn't find any.</o:empty>
</div>
bigeasy commented 12 years ago

This would be going all out. I can see tag libraries from where I'm sitting.

<html xmlns:s="stencil" xmlns:t="include:twitter.stencil" xmlns:g="include:grid.stencil">
<body>
<g:grid columns="16" gutter="10" width="30">
  <g:col span="6">
    <t:sidebar>
  </g:col>
  <g:col span="10">
    <t:tweets s:user="user">
      <t:heading><h1>Tweets!</h1><t:heading>
      <t:tweet>
        <div><t:description/></div>
        <div><t:avatar size="thumb"/></div> 
      </t:tweet>
      <t:empty>Sorry. No tweets.</t:empty>
    </t:tweets>
  </g:col>
</g:grid>
</body>
</html>
bigeasy commented 12 years ago

Do this elements always generate elements are they ever purely control structures that melt away? Can the user override the elements generated? (Makes no sense, because what if it's generating table and you want to make it div. It's probably also generating thead, tr, etc.) Probably both. Tag that is a control collection or tag that is layout.