Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]

Arc de Triomphe clipart (2486 bytes)Text-to-HTML utility

Written by Frieder Monninger fm@object-tools.com

htmindex.zip (21,636 bytes)


The 'htmindex' program reads a set of input files, and produces a set of HTML formatted files, including an automatically-generated Index and Table of Contents.

This program is a quick "hack" in order to make html programming more convenient. Use it, enhance it (and send me the enhanced version ;-) To compile it with Eiffel/S 1.3S, you need to install some enhanced kernel files. Put the files from the kernel directory into $EIFFELS/library/kernel

Input Files

The input files are standard ASCII files, and must all be stored in the same directory.

Three special files must be present:


The head.std file contains at least the standard html prologue. This file is automatically included at the top of every HTML output file.

This file may be empty, in which case every input file must contain its own prologue.

A typical 'head.std' file looks like this:

<a href="titles.htm">[Table of contents]


The text in the foot.std file is automatically appended to every HTML output file.


The filelist.dat file lists the files to be processed.

It must contain plain file names (8 characters or less, with no suffix). The suffix '.raw' will be added to every filename before processing.

For example, to process the files 'intro.raw', 'commands.raw' and 'hints.raw', the 'filelist.dat' file should look like this:


These files will be listed in the Table of Contents in the same order that they are listed in 'filelist.dat'.

Only the files listed in 'filelist.dat' are processed. Other '.raw' files in the same directory will be ignored. If you add a new '.raw' file, you must add it to 'filelist.dat'.

Output Files

The 'htmindex' program produces three types of output files:

Commands for the '.raw' files

The '.raw' files may contain:

The commands are based on a special escape character which indicates that the rest of the current line or the following word has a special meaning. This escape character can not be used in any other context within the document.

You do not have to use the same escape character for every file. The parser looks at the first character of each file, and uses it as the escape character for that file. The escape character is not copied to the output file.

In these examples we use $ as the escape character.


Commands can be used to specify three levels of heading. These headings are formatted
in an appropriate way in the output document.

All headings are collected and assembled into the Table of Contents file - contents.htm. A heading starts with $1 (for the highest level of heading), $2 (for the next level of heading) or $3 (for the lowest level of heading). The remaining characters in the line are used as the text of the heading.

For example:

$1Main Title
$2Chapter 1
$2Chapter 2

Index Entries

To index a word, put the escape character directly in front of that word.

This causes the following effects:

For example, consider this input text:

The best $food for the $lion is ...

The resulting output text will be "The best food for the lion is ...". The words "food" and "lion" will be highlighted and both words will be put into the index. Every other occurence of "food" and "lion" (without the escape character) will be shown as a hypertext reference to this occurrence.

Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]