Handling indentation (etc) for various programming languages
is a critical part of our handling of Monospace
Fortunately, the GNU Enscript
may solve a large part of this problem very nicely.
GNU Enscript is a free replacement for Adobe's enscript program.
GNU Enscript converts ASCII files to PostScript, HTML, or RTF
and stores generated output to a file or sends it directly to the printer.
It includes features for `pretty-printing' (language-sensitive code highlighting)
in several programming languages.
Enscript can be easily extended to handle different output media
and it has many options that can be used to customize printouts.
So, it appears that we can use Enscript to convert various types of files
(including source code in assorted languages
) to HTML
The Bad News is that Enscript hasn't been under active development since 2003,
so many recently-created languages will not be supported.
However, given that Enscript uses regular expressions
to analyze program source code,
it may be possible to use existing examples and develop new ones.
To be continued...
This wiki page is maintained by Rich Morin
an independent consultant specializing in software design, development, and documentation.
Please feel free to email
comments, inquiries, suggestions, etc!