Module html.Writer.Template.TemplateWriter
Info:
- Copyright: 2020 wesen
- Release: 0.1
- License: MIT
- Author: wesen
Class TemplateWriter
TemplateWriter.absoluteTemplateDirectoryPath | The absolute path to the "templates" directory |
TemplateWriter.sharedTemplateValues | The template values that will be added to all template value tables |
TemplateWriter:new () | TemplateWriter constructor. |
TemplateWriter:addSharedTemplateValues (_sharedTemplateValues) | Adds additional template values to the shared template values. |
TemplateWriter:writeTemplate (_outputFilePath, _templateName, _templateValues) | Renders a template and writes the result to a specified output file path. |
TemplateWriter:renderTemplate (_templateName, _templateValues) | Renders a template and returns the result. |
Class TemplateWriter
Renders templates and writes the results to specified file paths.
- TemplateWriter.absoluteTemplateDirectoryPath
-
The absolute path to the "templates" directory
- absoluteTemplateDirectoryPath string
- TemplateWriter.sharedTemplateValues
-
The template values that will be added to all template value tables
- sharedTemplateValues table
- TemplateWriter:new ()
- TemplateWriter constructor.
- TemplateWriter:addSharedTemplateValues (_sharedTemplateValues)
-
Adds additional template values to the shared template values.
Parameters:
- _sharedTemplateValues table The shared template values to add
- TemplateWriter:writeTemplate (_outputFilePath, _templateName, _templateValues)
-
Renders a template and writes the result to a specified output file path.
Parameters:
- TemplateWriter:renderTemplate (_templateName, _templateValues)
-
Renders a template and returns the result.
Parameters:
- _templateName string The name of the template without the ".tpl" suffix
- _templateValues table The template values to render the template with
Returns:
-
string
The rendered template