htmlpp - The HTML Preprocessor
An article in the December 1997 issue of Linux Journal
describes htmlpp, and is a good introduction to this tool.
What is htmlpp?
- Htmlpp is a pre-processor for HTML documents.
- Its purpose is to simplify the work of writing and packaging
large numbers of HTML documents.
- It acts like a compiler: you provide an input source text
and htmlpp produces the HTML documents from that. This is easier
and safer than trying to edit and manage separate HTML documents.
- To use htmlpp, you should be comfortable writing HTML without
help from a special HTML editor. This is not usually a problem,
since HTML is a simple language.
- Htmlpp is free software written in Perl, and copyright (c)
1996-97 iMatix. It is distributed with full sources according
to the GNU General Public License.
What does htmlpp do?
- It breaks one input source text file into several HTML
documents. Typically you will want to edit a larger file (it is
faster and easier), but provide the information in smaller pieces
on-line (people can access it easier). Htmlpp makes this
- It lets you define symbols like version in one place,
then use these in the text like this: $(version) so that
you can make changes in a single place only, not throughout the
- It creates tables of contents, and links to chain pages
together in sequence.
- It adds headers and footers to pages, so that you can keep a
consistent style in all HTML pages.
- It lets you define macros to simplify HTML markup.
- It converts plain text into HTML using guru mode.
- It converts accented characters into HTML metacharacters.
- It allows you to embed Perl code and to include the output of any
external program into the page.
- It queries flat-text databases.
- It provides features to build multilingual sites.
- It provides many built-in functions to simplify HTML writing, like
calculating image dimensions, file sizes, working with dates, etc.
How do I use htmlpp?
- Take a look at htmlpp.txt, which is the documentation
source for htmlpp's own on-line documentation. This is the main
example for htmlpp.
- The files in template.zip provide the basic template
for a new project. This zip file is provided as part of the
- Edit the source text using any text editor, then run htmlpp on
the source. It produces a number of HTML files (extension .htm)
which you can test using a browser.
- In general, htmlpp generates HTML pages that use relative
addressing, so that pages refer to each other without
specifying a host or path. This allows you to test and use the
HTML pages on a local hard disk.
Where do I get htmlpp?
What else should I know?
- Htmlpp uses Perl 4 or Perl 5. It does not use any
system-specific features, so will run on any box (I wrote it
mostly under MS-DOS; it's been used on heavily on UNIX and OS/2).
- Perl is a programming language written by Larry Wall that is
freely available for many platforms. If you never installed or
used Perl, this is an excellent time to start.
- Under MS-DOS, you will need Big Perl to process
What Are The Alternatives?