Main index
Navigation
Site
Guide
Encyclopedia
Search
Download
Links
Fans

Translation
Franšais

Htmlpp

Introduction

Htmlpp is a preprocessor, that is, a software that translates a text file into another one with the help of a simple macro language. The main idea of htmlpp is to define macros that simplify greatly the construction of Web pages. In this page, I try to give you a basic understanding of htmlpp's language (prehtml) so that you can easily make small correction to my pages (and so that you can even try to write you own page).

First steps in Htmlpp

Main ideas

HTML is a markup language. It uses markups to describe the layout and the presentation of a page. HTML uses opening and closing markup:
<opening> </closing>
Htmlpp is also based on markups. The general form of markup used by the prehtml language is as follows:

<#opening> </#closing>

Htmlpp does not modify document HTML markups, it just compute the result of prehtml markups. Therefore, a HTML document is not modified in general by htmlpp.

Global layout of the Darkover site

I've written some macros that give to the Darkover site its global layout. You just have to write the content of a page and htmlpp will add colors, icons, a signature and a navigation column to the resulting page. If you write for instance the following prehtml code in a file name try.en.prehtml:
<#keywords>Try</#keywords>
<#description>A try</#description>
<#titlehead>My first try</#titlehead>
This is the content.
then htmlpp will produce a file named try.en.html, which content can be seen by following this link.

Important markups

A prehtml file can be used in the Darkover site only if it begins with three important markups<#keywords>, <#description> et <#titlehead> (which must be closed). The meaning of each markup is explained hereafter:
<#keywords>
This markup contains a list of keyword associated with the page. The prehtml macros automatically insert in this list "Darkover" so you don't have to put it there. As in plain HTML, keywords must be separated by commas.
<#description>
This markup contains a short description of the page.
<#titlehead>
This markup contains the title of the page, which will appears at the top of it, preceded by a red triangle.
The rest of the file can contain plain HTML which will be inserted in the result page between the title and the signature. It is a very good idea to replace some HTML markups by their prehtml version:
<#hn>
These markups can be used to replace plain HTML <hn> markups. They allow to maintain the site homogeneity (all titles are in blue for instance).
<#a href="example.html">link<#a>
This markup can be used exactly as plain HTML hyperlink markup. The main difference is that htmlpp replaces the file name that appears in the link by a language dependent name (in english for instance example.html becomes example.en.html). This simplifies translation of prehtml code.
I've defined a lot of other prehtml markups, but in order to really understand them, you should learn htmlpp (this is not really difficult). They are for instance markups that allow to specify the author name.

A more complex example

Here is a more complex example. This is the content of a file named example.en.prehtml:
<#keywords>Example</#keywords>
<#description>An example page</#description>
<#titlehead>Example</#titlehead>
<#h2>A subtitle for this page</#h2>
Plain HTML can be used :
<ul>
<li>here
<li>it goes...
</ul>

You should used what follows:
<h2>Another subtitle for this page</h2>
which has not the right color!

As a conclusion, let's provide a link to the <#a
href="htmlpp.html">htmlpp</#a> page.  
After using htmlpp, you'll obtain a page named example.fr.html.

My last advice

The best way to correct a page of the site is to use the bottom link of each page which gives you an access to the corresponding source file. You can edit this file and send it back to me. I'll be pleased to include your correction into the site. Don't forget to save the file as plain text.


copyright 96-99 Fabrice Rossi (rossi@fr.darkover.org)

source file (Last modification: Wed Apr 21 17:21:45 1999)