cubicweb #1218 Thoughts about html generation [open]
Currently we mostly do :
self.w('<div ...>') self.w('<p ...>') ... potentially many things self.w('</div >')
And since I got tired of this error-prone way of doing things, I've built a small lib allowing to write:
with div(self.w, ...): self.w(p(...))
Hence automatically closing elements & reflecting at the python code level, the actual nesting. I also find the code much more readable this way (it takes a couple of hours to get used to it). This integrate seamlessly in the existing code.
We could just use that or, maybe, investigate the lxml.html route (see : http://codespeak.net/lxml/lxmlhtml.html#creating-html-with-the-e-factory). It's a bit more invasive.
|done in||<not specified>|
|closed by||<not specified>|