TemplateProcessor
Utility object for injecting dynamic values into templates.
For example, given the following template and input context
Template:
Hello, {{user.name}}. Context:
{
"user": {
"name": "Bill"
}
}The processed template would output
Hello, Bill.
In cases where the value may not be available in the context, a fallback string can be provided to be used instead. So given the following template and input context:
Template:
Hello, {{user.name || beloved user}}. Context:
{
"user": {
"age": 42
}
}The processed template would output
Hello, beloved user.
Types
A reusable, pre-processed version of some templated text. Any substitutions are discovered ahead of time and can be inspected in substitutions.
Functions
Compiles a reusable, partially processed Template from the given template text. Any substitutions are discovered ahead of time and can be inspected in Template.substitutions.