Directive
A directive: a declaration of its option names plus a pure body.
A directive is authored as a JSON object with exactly one $-key (the marker); the marker's value is the DirectiveArgs.primary argument, the other keys are options. An authored option key not in options is a loud malformedOption — typos fail, they don't vanish.
The body returns one JSON result; where the directive sits decides how the walker uses it — node position (in children/layout): an array flattens into the surrounding children and JsonNull contributes nothing; value position (everywhere else): the result is the value, verbatim.
Bodies must be pure — no I/O, no clock, no randomness. Time and environment enter as data: the host puts them in state, templates read them like any value.
Properties
Functions
Compute this directive's single result. Resolve arguments on demand via ctx.