|
I use Cheetah a lot. Both as template system for html pages and as codegenerator.
Looking for a way to better work with html page designers I found this tip in the cheetah mailinglist:
the default directive token is '#'.
This can be changed:
t = Template(file=filename, compilerSettings={'directiveStartToken': '<!-- #', 'directiveEndToken': '#-->'})
Calling Template with the optional compilerSettings argument as above tells the template engine to use '<!-- #' and '#-->' to delimit directives
So code like:
<!-- #for $myObj in $objList #-->
<tr>
<td>$myObj.attr1</td><td>$myObj.attr2</td>
</tr>
<!-- #end for #-->
is valid html and can be viewed correctly from html designers in applications like Dreamweaver.
|