RFC: template engine [ was: Re: Implementing tables - advice wanted ]
Filippo Pacini (S.G. Consulting)
pacini@REDACTED
Thu Jun 15 11:00:31 CEST 2006
Gaspar Chilingarov wrote:
> ke han wrote:
>
>> according to StringTemplate syntax, your example can be written more
>> clearly, IMO:
>>
>> <table>
>> $people:row()$
>> </table>
>>
>> where row() is defined as:
>> <tr><rd width=20>$attr.name$</td></tr>
>>
>>
>> - or - if you feel like putting it together as one:
>>
>> <table>
>> $people: {
>> <tr><td width=20>$attr.name$</td></tr>
>> }$
>> </table>
>>
>> [skip]
>
> I'm even against such templating language -- because I wish to pass some
> simple template to designers and HTML coders and forget about it. Such
> syntax will break visual editors.
>
I develop web sites in python using Cheetah templates (similar to velocity).
In Chetaah you can specify the start and end token of the template language.
So if you use for example
start token: <!-- #
end token: #-->
In html you can write a table like:
<table>
<!-- #for $r in $rows #-->
<tr>
<td>$r.item1</td><td>$r.item2</td>
</tr>
<!-- #end for #-->
</table>
Usually designers can use visual editors on this templates without much
problems. All the template code is in html comments.
I'd like something similar also in erlang.
Regards,
filippo
More information about the erlang-questions
mailing list