The html module of Tcllib provides tools to generate HTML programmatically. Related modules are ncgi, javascript, and htmlparse.