TemplateParser » History » Version 3
Version 2 (Elmer de Looff, 2012-02-09 15:37) → Version 3/56 (Elmer de Looff, 2012-02-09 15:38)
h1. TemplateParser
The µWeb TemplateParser is a in-house developed templating engine that provides tag replacement, tag-functions and template control functions. This document will describe the following:
* The [[TemplateParser#template|Template [[ #Template-class|Template class]], used to parse the templating language
* The [[TemplateParser#parser|Parser [[ #Parser-class|Parser class]], which provides template loading and caching
* [[TemplateParser#using|Using [[ #Using-TemplateParser-inside-µWeb|Using TemplateParser]] inside a µWeb PageMaker
* A detailed explanation of the [[TemplateParser#syntax|templating [[ #Templating-language-syntax|templating language syntax]], constructs and behaviors
First though, to help with understanding the TemplateParser, a minimal size template document:
<pre><code class="html">
Hello [title] [name]
</code></pre>
The above document contains two simple template tags. These tags are delimited by square brackets, and they will be replaced by the named argument provided during parsing. If this name is not present, then the literal presentation of the tag will remain in the output.
h1(template). h1. Template class
h1(parser). h1. Parser class
h1(using). h1. Using TemplateParser inside µWeb
h1(syntax). h1. Templating language syntax
The µWeb TemplateParser is a in-house developed templating engine that provides tag replacement, tag-functions and template control functions. This document will describe the following:
* The [[TemplateParser#template|Template [[ #Template-class|Template class]], used to parse the templating language
* The [[TemplateParser#parser|Parser [[ #Parser-class|Parser class]], which provides template loading and caching
* [[TemplateParser#using|Using [[ #Using-TemplateParser-inside-µWeb|Using TemplateParser]] inside a µWeb PageMaker
* A detailed explanation of the [[TemplateParser#syntax|templating [[ #Templating-language-syntax|templating language syntax]], constructs and behaviors
First though, to help with understanding the TemplateParser, a minimal size template document:
<pre><code class="html">
Hello [title] [name]
</code></pre>
The above document contains two simple template tags. These tags are delimited by square brackets, and they will be replaced by the named argument provided during parsing. If this name is not present, then the literal presentation of the tag will remain in the output.
h1(template). h1. Template class
h1(parser). h1. Parser class
h1(using). h1. Using TemplateParser inside µWeb
h1(syntax). h1. Templating language syntax