diff --git a/diary/design.markdown b/diary/design.markdown index 1adfcdb..f0cb50b 100644 --- a/diary/design.markdown +++ b/diary/design.markdown @@ -96,3 +96,168 @@ the context to `$.$` means that we're not going to consume another variable name with something like `$resolver`. Maybe `_$` as the special variable disambiguates, can be used in the libraries. + +## [Recursive Templates](#recurse) + +Going to implement the style of reentrancy that is currently in my head, but +here are some more. + +```xml + + + +

+ +
+ + +``` + +Often times you need to write out information that has a tree-like structure, it +could be your site navigation, an organization chart, or folders and the files +and folders inside them. When you do you're going to want to create a template +that can call itself. In computerese something that calls itself is called +recursive — think recurring which has the same latin root; recurrere. We +call these templates recursive template. + +You create a recusive block by defining a block with the `each/with` directive, +giving it an `id` attribute. Within the block, when you want to invoke the block +again you use a `recurse` directive. The `recurse` directive has a `call`... + +You are allowed only one `recurse`. + +Okay, I can see it. + +What I'm doing now... + +```xml + + + +

+ +
+ + +``` + +Given this template... + +```xml + + + + + + + + + +``` + +Which could as easily be... + +```xml + + + +

+ +
+ + +``` + +Or maybe... + +```xml + + + +

+ +
+ + +``` + +Recursive is a concept that is complicated. Here I'm pushing recursive into +tags, but they don't break out of the tags. There's no good way to have a tag +layout recursion for you, is there? Ah, that's a layout. Oh, boy, here it is... + +```xml + + + + + + + + + + + + + + + + + + +``` + +And then the template author gets to say... + +```xml + + + +

+ +
+ + +``` + +## Evaluated Attributes + +Currently, there is no concept of an evaluated attribute, but it will be +necessary. It is either the case that `select` is by default always evaluated +and that other attributes require an `s:`, which doesn't make sense. Only if it +is also the case that you only ever want one and only one evaluated property per +tag, because it ruins the don't-think-about-it-ness of + +## Incoming + + * Do underbars disappear?