Expand description
Templates are compose documents with typed parameters, bound to data into plain specs.
A template is a compose document with a template header and params. Binding validates
the data, then replaces {"$param": name} values, {{name}} in strings, and the $if,
$switch and $each directives, and expands owner/name template nodes, leaving a spec
with no $ left in it. Binding is logic-less and works on the JSON before it is parsed, so
every compose field can be a parameter. One binding makes at most MAX_BOUND_VALUES values
in template bodies.
Structs§
- Bind
Options - What binding takes besides the template and its data.
- Issue
- A problem
lintfinds.
Enums§
Constants§
- MAX_
BOUND_ VALUES - Values one binding may make in template bodies, a string counting one per 64 bytes.
Functions§
- bind
- Binds
documenttodata: a template’s parameters replaced and its template nodes expanded, giving a plain spec (or, for a node template, a plain node). A document without a header has only its template nodes expanded; directives and{{name}}exist only in template bodies. Without a header, template nodes or a theme,bindreturnsdocumentunchanged. - data_
schema - The JSON Schema (2020-12) of a template’s data, with each parameter’s title, description,
default and checks a schema can say; file rules are in
x-alpha2-media. - lint
- Problems with a template, and with
datafor it when given: its header and parameters, the parameters its body names, literal content a template leaves to its data or theme, and whether it binds to a spec that parses. Without data it binds to sample data.