TEMPLATE
strings
TEMPLATE
fills a template with values contained in a map. See example for syntax help.
The TEMPLATE
function expects the map of values on top of the stack and will operate on the string template below it.
Values speficied with {{key}}
will be html-escaped. If you do not want that behavior, use {{{key}}}
.
TEMPLATE is available since version 1.0.0.
See also
Signatures
Examples
//simple map
' {{p1}} {{p2}} {{p3}} x {{p4}} or {{{p4}}} '
{ 'p1' 'user'
'p2' 28.0
'p3' True
'p4' '<café">' // < > ' will be html escaped
}
TEMPLATE
//map with list of maps
' {{userlist}} {{#userdata}} {{name}}, {{age}} years old. {{/userdata}} '
{ 'userlist' 'List of users:'
'userdata' [
{ 'name' 'Peter' 'age' 42 }
{ 'name' 'Steven' 'age' 35 }
{ 'name' 'Dave' 'age' 28.5 }
{ 'name' 'George' 'age' NaN }
]
}
TEMPLATE