templater Class
Templater provides template services, and is accessed via the global variable 'templater'. It supports Mustache-style template syntax as documented here and is a very simple ('logic-less') system for generating text from templates and Javascript data-objects. The basic idea is that the template should contain macros like '{{firstName}}' which match the names of properties of the given Javascript object. This will result in the value of the property being substituted into the template.
Item Index
Methods
Methods
renderFile
-
filePath
-
data
Apply the template in the file with the given (virtual file-system) path to the given data object.
Parameters:
-
filePath
StringPath to template file.
-
data
ObjectObject containing values to substitute into the template.
Returns:
renderString
-
templateString
-
data
Apply the given template to the given data object.
Parameters:
-
templateString
StringString containing the template
-
data
ObjectObject containing values to substitute into the template.