cateee.net

my packages

Linux Kernel Driver Database and AutoKernConf

gen-sitemap

Writings

Various

References and links

webpp: a simple web preprocessor

type it for me

Doing this website, I wrote also few scripts to quick update my pages.

Usage

The sources pages are .shtml files which consists on html pages and some preprocessor directives (mainly includes, variable definition and expantion. You will find the language syntax in next section.

A standard Makefile together with a dependency builder and the web preprocessor will build the site.

webpp language

The webpp language is a very simple macro expantion and few predefined.

syntax

webpp commands:

@!>>
This is a small trick, used on rare cases: it expand to @>> removing the next newline character. It is used to have nice sources files that seems good also on output, and to define variables before the <xml> line, which unfortunately should be the very first line (first non empty line is not enought)
@<<INCLUDE include-file@>>
This command will include the include-file, preprocessing it
@<<DEF variable=value@>>
It define variable to the value. Note: value could be a multiline command.
@<<IFDEF variabe: true-block[@ELSE@else-block]@ENDIF@>>
This comand will expand the true-block or the evantual else-block, according if the variable is defined anywhere.
@<<$variable@>>, @<<$variable=default@>>
Expand the value of variable. Expand default if variable is not defined.
@<<INCLUDE_RAW include-file@>>
this command will include the include-file, without further processing the include-file.
@<<# comment@>>
Comment (i.e. this text will be removed and ignored). The comment coult be split into multi lines
@<<ME URL@>>
Define space separated URLs (global and local) that point to this page. If such url are encoured in parsed page, own links are removed.

predefined variables

webpp has few predefined variables:

NOW
time in RFC2822 format (but alweays in GMT time), like in "Mon, 10 Nov 2014 10:35:49 +0000"

Sources

The sources are very short, so I'll not distribute as packages (or tarball), but as unversioned links:

webpp.py
the simple web preprocessor
Makefile
the Makefile. Normally you should only change the TOPDIR variable.
dep_finder.sh
generator of dependencies for make

Additionally you can check as example the sources of this page (with the includes head.inc and foot.inc).

Custom Search

Page automatically generated at Mon, 10 Nov 2014 10:35:49 +0000