Joel de Guzman wrote:
> Okidoki. That's all for now. Next stop will be the new template syntax.
> And hopefully, moving the bulk of quickbook to a library.
Ok, now we have templates in the syntax that we discussed.
Examples (from John):
[template alpha '''α''']
[template pow[a b] a'''<superscript>'''b'''</superscript>''' ]
[template super[text]'''<superscript>'''text'''</superscript>''' ]
[pow x 2]
[pow [alpha] 2]
x[super 2]
There's a minor change though for multiple args. I used the double
dot as the separator "..". The code above can also be written as:
[pow x..2]
We once considered the syntax:
[pow [x][2]]
but I realized that it is ambiguous because the arguments passed can
be just about any quickbook phrase. For example:
[my_template [$image.jpg]..[^boldified]]
This is not possible using brackets as separators.
The logic behind the simplified (no separator) syntax like:
[pow x 2]
is actually quite simple: First, "x 2" is treated as just
one argument. If the template expects more arguments, then
it tries to break the argument at the first space found.
(I realized this can apply to arbitrary N-ary arguments.
I'll adjust the code later to accommodate N arguments using
that logic)
Committed to CVS. Have fun!
Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests:
https://lists.sourceforge.net/lists/listinfo/boost-docs