Skip to main content

Module policy

Module policy 

Source
Expand description

Standalone parsers for config blocks (diagnostics { … }, brand { … }).

A Zenith config file (global or local) is a small KDL document whose meaningful nodes are a top-level diagnostics { … } block and/or a top-level brand { … } block, written exactly like their in-document counterparts:

diagnostics {
    allow "layout.off_canvas"
    deny  "font.local"
    warn  "node.unknown_property"
}

brand {
    colors "#0b1f33" "#ffffff"
    fonts  "Noto Sans"
    weights 400 700
}

This is NOT a full .zen document — there is no zenith root node, no project, no tokens. Only the diagnostics and brand blocks are read; any other top-level node is silently ignored for forward-compatibility, mirroring the lenient posture used throughout the document transform. A source with no matching node (including an empty source) yields the respective default (empty policy / empty contract), which is an identity pass.

Functions§

parse_brand_contract
Parse a standalone brand { … } KDL config block from raw bytes.
parse_diagnostic_policy
Parse a standalone diagnostics { … } KDL config block from raw bytes.