Handling indentation (etc) for various programming languages is a critical part of our handling of Monospace text. Fortunately, the GNU Enscript utility 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!

Topic revision: r3 - 26 Oct 2016, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email