The Document Package:

A Simplified Approach to Literate Programming

Michael L. Hall

May 26, 2004


The Document package is used to process documentation that is imbedded in the comments of a source code file. Any source code language may be used, if the proper values for comment characters have been set. Any formatting language may be used as well. Currently, options for Fortran, M4, C++ (or C), LATEX, Java, Prolog and shell scripts (perl, sh, csh, awk, Tcl) as the source code language have been implemented.

Postcript and DVI versions of the documentation are available, as well as the perl source code, and a gzipped tar file of the entire HTML node (includes LaTeX, PS, DVI and perl source).

User's Note: the -docstyle keyword which enabled compatibility with the doc routine has been de-selected. Document no longer includes this capability.

* Laziness:
The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer. Also, hence this book [program -MLH].
* Impatience:
The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least that pretend to. Hence, the second great virtue of a programmer.
* Hubris:
Excessive pride, the sort of thing that Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won't want to say bad things about. Hence, the third great virtue of a programmer.

From the glossary of Programming perl, by Larry Wall and Randall L. Schwartz.

Michael L. Hall