What's What in this TIP Formatter...


The formatter is divided into four sections whose responsibilities are relatively easy to describe.

tip.tcl

The code that runs the TIP formatter as a CGI script on my web-server. Should be relatively easy to localise to any server that supports CGI (and which has Tcl...)

parse.tcl

The code that performs basic parsing of the TIP format into paragraphs, understands the RFC822-like header, and provides support for iterating across the document set (foreachTIP) and obtaining the header info (and abstract section) of arbitrary TIP documents (getTIPDetails). Also includes a number of useful pre-defined regular expressions in global variables.

Also of note is the convert command which is great for people testing the formatting of their TIPs or developing a new formatter; if this file is run as a stand-alone Tcl script with an argument of the output file to generate (read the source for the format,) it intuits what file to convert from and format to generate and runs the converter for you.

tip*.tcl (various)

Formatters for individual output formats. Each should be contained within a reasonably obviously named file (e.g. tiphtml.tcl is the formatter for HTML) and should define a namespace within the global namespace with the same name as the root of the filename. Formatters should produce output by calling puts or puts -nonewline (with no channel parameter) and must define the following command:

The easiest way of handling the document descriptors (IMHO) is to pass them one at a time to eval after the header has been generated. The currently defined document descriptors are:

imwidth.tcl

Utility for figuring out the width of an image file. Most of the code is cobbled from the Tcler's Wiki, which is a tremendous resource.


Donal K. Fellows / Tcl Core Team