API

IwaiEngine.TemplateType
Template

Compiled IwaiEngine template.

Template objects are callable. Pass a NamedTuple as the render context.

source
IwaiEngine.parseFunction
parse(source; optimize_buffer_size = true, autoescape = true, path = nothing, root = nothing) -> Template

Compile an IwaiEngine template from a string.

  • optimize_buffer_size=true reuses the largest previously observed output size as the next render buffer hint.
  • autoescape=true enables HTML escaping for {{ ... }} expressions unless the value is marked with the safe filter or rendered inside {% autoescape false %}.
  • path is used to resolve relative {% include %} and {% extends %} paths.
  • root constrains file-backed template resolution to a specific directory tree.
source
IwaiEngine.loadFunction
load(path; optimize_buffer_size = true, autoescape = true, root = nothing) -> Template

Load and compile a file-backed IwaiEngine template.

Templates are cached by absolute path, mtime, optimize_buffer_size, autoescape, and root. Relative {% include %} and {% extends %} paths are resolved from the current file's directory and are prevented from escaping the configured root.

source