[Web-SIG] html-gen-ish libraries; what's best?

Ian Bicking ianb at colorstudy.com
Wed Apr 5 00:26:28 CEST 2006


Are there any opinions on the best HTML/XML generation libraries out there?

For example, HTMLGen being the original (but too eclectic).  Stan is 
often also sited (http://divmod.org/projects/nevow#stan).  I have an 
extension of ElementTree along these lines in FormEncode 
(http://svn.formencode.org/FormEncode/trunk/formencode/htmlgen.py).  I 
noticed http://markup.sourceforge.net/ today, which allows you to open a 
tag and close it later, which can be nice.

I'd like to put a Best Possible library in WebHelpers 
(http://pylonshq.com/WebHelpers/), that's both simple and easy to work 
with.  I would be nice if the same API could be used to generate both 
ElementTree nodes and strings; ElementTree itself can be a little picky, 
so *only* using ElementTree as the internal/intermediate representation 
(like formencode.htmlgen does) might be going too far.  HTML/XHTML 
validation might be interesting.  Smart indentation would be nice, at 
least optionally (i.e., indentation, but nothing that breaks the layout).

While the library would ideally have some (optional) knowledge of HTML, 
it would be out of scope to have it be a general page-builder (like 
HTMLGen, and a bit like markup.sf.net).  I'm more interested in just 
using it to build fragments.

Opinions?

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Web-SIG mailing list