htp on-line reference: Introduction

An HTML pre-processor

htp is an HTML pre-processor. It is designed to be a flexible authoring tool that can easily be integrated into the design process.

htp works by processing special HTML files and producing as output regular HTML files ready to be served up. The original HTML files are "special" because they (possibly) contain certain markup tags only recognizable to htp. These tags are formed very similarly to standard HTML tags. This allows for an easy learning curve and the ability to use visual HTML editors to build htp files.

This on-line reference was entirely designed with htp. The htp Home Page has a hyperlink to the latest copy of htp, which includes an executable file, a client-readable copy of this reference, the original files used to build the reference, and a full copy of the original 'C' language source code (either for perusal or porting to other platforms).

A WWW page was produced by the author, and is now maintained by Robert King ( at


In building my own Web pages, I felt it important to maintain a consistent layout across all documents produced. This was easy enough at first, but after building 20+ pages, it was more and more difficult to change or update the style or information across all pages. I can only imagine the problems a site with 100 or more pages would have.

htp is a simple response to this problem. Although there are a number of interactive HTML editors available, none of them had all of the features I've placed into htp. I'm also uncomfortable using Windows-based HTML editors, for a variety of reasons. htp allows me to produce HTML files with any text editor. Once finished, htp is executed from the command-line to "build" the final HTML code that goes on the HTTP server.

Build is an appropriate term. The HTML source files can ultimately be used to import various files, letting the author create a sort of "template" for the various headers and footers that are part of the HTML document.


htp is a public domain utility. There is absolutely no charge for it's use. No charge can be incurred for the redistribution of this utility beyond material costs. All distributions of htp must include all files contained in the archive it was originally packaged in. Any questions regarding distribution should be directed to Jim Nelson at A full distribution package can be obtained at the htp home page, listed above.

This on-line reference is considered documention for htp, and is therefore subject to the same conditions of distribution as the actual utility.

If you actively use htp and find it useful and worthwhile, I would appreciate placing a hyperlink on one of your pages pointing to the htp home page.

Porting to other platforms

htp was written in as much standard ANSI C as possible. I was anticipating porting it to platforms other than DOS and Linux. Indeed, one user has successfully ported it to a SPARCstation running Solaris and another to a Digital AlphaStation 200 4/100 running OSF/2 v3.2c. Recently, a user reported a successful port to HP/UX.

If you run into problems porting htp, please email me as thorough a description of the error(s) as possible, I'll be more than happy to try and help you through the process.

One source of problem on many UNIX platforms is that ulong is not already defined in the include files. If you receive compiler errors stating something to the effect of

parse error before 'ulong'
try adding this to os.h just after #define PROGRAM_OS ("Linux/Posix"):

typedef unsigned long ulong;

If you are successful in porting htp to another platform, I would appreciate an email. Thanks in advance.

Table of Contents

htp on-line reference /
Author: Jim Nelson / No email available
Maintainer: Robert King /

Copyright © 1995-96 Jim Nelson.

Last updated Thu Jul 12, 2001