TemplateParser » History » Version 2
Version 1 (Elmer de Looff, 2012-02-09 15:27) → Version 2/56 (Elmer de Looff, 2012-02-09 15:37)
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 [[ #Template-class|Template [[#Template class]], used to parse the templating language
* The [[ #Parser-class|Parser class]], [[#Parser clas]], which provides template loading and caching
* [[ #Using-TemplateParser-inside-µWeb|Using [[#Using TemplateParser inside µWeb|Using TemplateParser]] inside a µWeb PageMaker
* A detailed explanation of the [[ #Templating-language-syntax|templating [[#Templating language syntax]], syntax|templating language]], 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 class
h1. Parser class
h1. Using TemplateParser inside µWeb
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 [[ #Template-class|Template [[#Template class]], used to parse the templating language
* The [[ #Parser-class|Parser class]], [[#Parser clas]], which provides template loading and caching
* [[ #Using-TemplateParser-inside-µWeb|Using [[#Using TemplateParser inside µWeb|Using TemplateParser]] inside a µWeb PageMaker
* A detailed explanation of the [[ #Templating-language-syntax|templating [[#Templating language syntax]], syntax|templating language]], 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 class
h1. Parser class
h1. Using TemplateParser inside µWeb
h1. Templating language syntax