Expand description
String substitution for path templates and message templates.
Two variants, distinguished by delimiter style:
- Path templates — single braces, fixed token set derived from a
matched file’s relative path. Example:
"{dir}/{stem}.h". - Message templates — double braces, namespaced lookups for rule
messages and similar user-facing strings. Example:
"{{ctx.primary}} has no matching header at {{ctx.partner}}".
Both are intentionally small and self-contained: no regex dependency, no dynamic parser. Unknown tokens are preserved literally so a typo surfaces in output rather than silently blanking out.
Structs§
- Path
Tokens - Token values derived from a relative path. Consumed by
render_pathand by cross-file rules to resolve partner paths.
Functions§
- render_
mapping - Substitute
{{namespace.key}}placeholders in a message template. The caller-suppliedresolveclosure returns the substituted value, orNoneto leave the placeholder literal. - render_
message - render_
path - Substitute
{token}placeholders in a path-shaped template. Unknown tokens are preserved literally (so"{unknown}"renders as"{unknown}"). - render_
paths_ spec - Apply path-template substitution to every pattern in a
PathsSpec. - render_
value - Recursive mate to
render_mappingfor arbitrary YAML values.