Skip to main content

Module template

Module template 

Source
Expand description

TEMPLATE macro expansion.

TEMPLATE(name, default) is resolved BEFORE YAML parsing. It performs simple textual substitution in the raw source string.

Forms:

  • TEMPLATE(name, default) — use default if name not provided
  • TEMPLATE(name) — required, produces “UNSET:name” if missing
  • TEMPLATE(name,) — null default (empty string)

The same variable referenced multiple times gets consistent substitution: the first occurrence with a default sets the value for all subsequent references.

Functions§

expand_templates
Expand all TEMPLATE(…) macros in a source string.