by apoirier · 17y ago · 0 comments
from nagare.namespaces import xhtml
l = ['the', 'mandatory', 'hello', 'world']
h = xhtml.Renderer()
with h.div(id='content'):
with h.ul:
h << [h.li(element) for element in l]
print h.root.write_htmlstring()
Or a (X)HTML template can have nodes annotated with a 'meld:id=<id>'
attribut. They are then retreived and manipulated in Python.In both cases, one of the main goal is not to reinvent a new syntax / templating language but to use normal Python with all its power. Also the generated (X)HTML is always well-formed.
No comments yet.