Template¶
Constructors¶
parse¶
Parameters¶
- source: String val
- ctx: TemplateContext val = call
Returns¶
- Template val^ ?
from_file¶
Parameters¶
- path: FilePath val
- ctx: TemplateContext val = call
Returns¶
- Template val^ ?
Public Functions¶
render¶
Render the template with the given values and return the result as a single string.
Parameters¶
- values: TemplateValues box
Returns¶
- String val ?
render_to¶
Walk the template and drive the given sink with alternating literal and
dynamic_value calls. Values are not escaped — they pass through as-is.
See TemplateSink for the interleaving guarantee.
Parameters¶
- sink: TemplateSink ref
- values: TemplateValues box
Returns¶
- None val ?
render_split¶
Render the template and return the static literal segments and dynamic
value segments as separate arrays. For N dynamic insertions, the statics
array has N+1 entries. Concatenating statics(0) + dynamics(0) +
statics(1) + dynamics(1) + ... + statics(N) produces the same result
as render().
fun box render_split(
values: TemplateValues box)
: (Array[String val] val , Array[String val] val) ?
Parameters¶
- values: TemplateValues box