heading
Rules on a section's own heading: its pattern and placeholders.
Docking computer: Wrong port shape. No seal. Try again.
Quick reference
| Written as | Fails with | Applies to |
|---|---|---|
heading. fix: opt-in | heading-format errorvalue-wrong-form errorvalue-not-given errorvalue-not-allowed errorunknown-entity error | section |
heading. fix: opt-in | heading-format errorvalue-wrong-form errorvalue-not-given errorvalue-not-allowed errorunknown-entity error | section |
heading. autofix | heading-format errorvalue-not-given errorvalue-not-allowed errorunknown-entity error | section |
heading. | heading-placeholder error | section |
Examples
heading. mask
Pick the section by its heading's mask (a small token vocabulary compiling to a safe, anchored regex): the section binds the heading the mask picks (with no occurs=, one), never the contract's worked heading. Reads the heading with links and bare [text] read as text — so for ## [1. write <semver> - <date>, never escaped brackets.
A version and date heading passes
<!-- mdv: section required heading.mask="<semver> - <date>" -->
## [0.2.0] - 2026-07-02## [0.2.0] - 2026-07-02
Beacon firmware update shipped to the fleet.✓ passes
A release heading in another form is flagged
<!-- mdv: section required heading.mask="<semver> - <date>" -->
## 1.2.0 - 2026-07-02## 1.2.0 — 2026-07-02
Beacon firmware update shipped to the fleet.✗ heading-format error · line 1
heading. raw. mask
Like heading.mask, but on the heading as written (brackets, link syntax and leading symbols included) instead of the cleaned heading the section binds by.
block
<!-- mdv: section required heading.raw.mask="\[<semver>\] - <date>" -->
## [0.2.0] - 2026-07-02
<!-- mdv: endsection -->heading. pattern
Require the block's matched heading to match a regular expression (e.g. an ADR id prefix).
block
<!-- mdv: section required heading.pattern=/^ADR-[0-9]{4}:.+/ -->
## ADR-0007: Adopt beacon validation
<!-- mdv: endsection -->heading. none=@placeholders
Reject a placeholder heading (TODO, TBD, an unfilled imperative stub).
A real heading passes
<!-- mdv: section required heading.none=@placeholders -->
## Sensor handoff## Sensor handoff
Night shift hands the sensor logs to day shift at 06:00.✓ passes
A TODO heading is flagged
<!-- mdv: section required heading.none=@placeholders -->
## TODO## TODO
Night shift hands the sensor logs to day shift at 06:00.✗ heading-placeholder error · line 1