Module CamlTemplate


module CamlTemplate: sig  end
A template processor.

To use templates, first write template source code (see the manual for instructions). Then create a template cache using the CamlTemplate.Cache module, and call CamlTemplate.Cache.get_template to create a CamlTemplate.template from your template source code.

To marge a template with data, put the data in a CamlTemplate.Model.thash. Then call CamlTemplate.merge.


module Model: sig  end
Provides the types used in the data models that are merged with templates.
type template 
Represents a parsed template.
val merge : tmpl:template ->
model:Model.thash -> buf:Buffer.t -> unit
Merges the data in a CamlTemplate.Model.thash with the template, and returns the resulting text in the buffer provided.
Raises Template_error if an error occurs in the template.
val get_name : template -> string
Returns the name of a template.
val dump : template -> string
Returns a simple string representation of the parse tree, for debugging purposes.
exception Syntax_error of string
Raised if an error is found when parsing template source code.
exception Template_error of string
Raised if an error occurs when merging data with a template.
module Cache: sig  end
Caches templates.
val add_web_functions : Model.thash -> unit
Adds the following template functions to a template data model:

Each of these functions expects one argument.