ClearSilver is a very fast, language independant HTML template engine. It provides a simple alternative to XML/XSLT, and does not require your templates to be valid XML.

Download

The module source code can be downloaded here as a gzipped tarball. A PGP signature is also available, and can be verified using my public key (amontague@siriushosting.com).

Module installation

The following basic documentation should allow you to compile and install the pike clearsilver module on any modern unix system with a C compiler. It assumes that you already have pike installed, and are familiar with basic unix commands.

First, download and install clearsilver from clearsilver.net, or install it using your operating system's package management system. Next, download our pike clearsilver module, and untar it. Now simply cd into the Public_Parser_ClearSilver directory and run pike -x module to configure and compile the module. Finally, to install the module simply run pike -x module install as root.

Using the module

The clearsilver documentation explains how the clearsilver template engine works, including the syntax of templates and datasets. This documentation assumes an understanding of how clearsilver works, and only explains how to use the pike module.

The module contains two classes, HDF manipulating Hierarchical Data Format data, and CS for parsing HTML templates with HDF data. You can manipulate HDF data before or after creating a CS object from it, but only one HDF object can be registered with any given CS object. For complete documentation see the module reference.

Example code