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.

prioritynormal
typeenhancement
done in<not specified>
load4.000
load left4.000
closed by<not specified>
see also