Template
@defineDirective
Declares a template — a node shape written once and stamped out wherever its name is used. The implicit attribute `node` names the type being declared, written in the head (`@define:card`); the attribute group declares the template’s own parameters with their defaults, and `{{param}}` splices each parameter verbatim into the body. A template may use other templates, but circular expansion is a compile error.
Attributes
nodeRequiredImplicit
Allowed content
Body { }The template — the Chalk that replaces each use, with {{param}} splices
Examples
@define:swatch{
square(x: 0; y: 0; size: 1; colour: {{colour}})
}(
colour: blue
)
swatch(colour: red)