HTML Generation

Tino Wildenhain tino at living-examples.com
Fri Apr 3 10:04:33 CEST 2009


Hi Mike,


Mike wrote:
> Hello all,
> 
> I'm writing a web app and wanted to do some html generation (I really do 
> not like to maintain or write html).
> 
> I'm thinking of writing a dsl based on the following:
> 
> def html():
>     return
> 
> def a():
>     return
> 
> def body():
>     return

That would be writing HTML just another way and also
mixing code and representation, this is generally not a
good idea.

If you really don't want to maintain HTML along with
your code, I'd suggest an approach like

Zope Page Templates

http://en.wikipedia.org/wiki/Zope_Page_Templates#Zope_Page_Templates

which can be used outside Zope as well, (even with many other languages)

For example: http://zpt.sourceforge.net/

Regards
Tino



More information about the Python-list mailing list