I messed around with Templating systems all weekend, and picked a winner

Petal

I wanted to go as simple as possible, and with the help of the list narrowed it down to:

    HTML::Tree
    HTML::Template
    Text::TagTemplate
    Petal

HTML tree did exactly what I wanted it to, except I remembered as much as I know tree structures, working with Nevow's Stan formatting I learned to hate them

HTML::Template got ruled out because the only way to get templates to render as xhtml valid is to use info as comments
    ie:
        <TMPL_VAR NAME="PARAMETER_NAME" > isn't valid, but works
        <TMPL_VAR NAME="PARAMETER_NAME" /> is valid, but doesn't work
<!-- TMPL_VAR NAME="PARAMETER_NAME" --> is valid and works, but looks cluttered to me

Text::TagTemplate almost worked right:
     <#TAG NAME=VALUE> works, isn't valid
     <#TAG NAME=VALUE/> doesn't work, is valid
<#TAG NAME=VALUE /> works, is valid (notice the space before the close of the tag) I didn't want to worry about remembering the space. The author sent me a copy of the next version that he will release which, with a new feature, will support what I want...

... But then i realized that the templates work and are valid, but don't look nice

Petal templates do look nice, because
    <span tal:replace="my_var/hello_world 'Jack'">Hola, Mundo!</span>
is valid xhtml AND lets you have mockup text that is then replaced

Unfortunately, petal supports all the smart features of tal like if/ loops (stuff I didn't want in there), but its ok. i'll deal.

Thanks to all.

Reply via email to