htmlout: HTML Output Library


htmlout is a simple library that makes it really easy to build a tree of HTML nodes and then to serialize this tree into text for final output.

This library really needs a rewrite, but I have a lot of code using it, and some public code in Atocha uses it, so I thought I would open source it anyway. If you need it, here it is.


  • Has an option to output a nicely indented output or compressed output;
  • A simple interface;


I have been using and refining this library for years, and although it is long due for a rewrite, it still serves me well. It has a fair amount of value, in the sense that many issues related to browsers have been ironed out, for example, avoiding outputting empty div tags. Little details like that.


There is no documentation, read the source if you need it.


A Mercurial repository can be found at:

Reporting Bugs

Send email to the author: Martin Blais <>.

Installation and Dependencies

Run the script in the root.


Martin Blais <>