heading

Rules on a section's own heading: its pattern and placeholders.

Docking computer: Wrong port shape. No seal. Try again.

Quick reference

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.2.0] - 2026-07-02 write <semver> - <date>, never escaped brackets.

A version and date heading passes

contract.mdv.md
<!-- mdv: section required heading.mask="<semver> - <date>" -->
## [0.2.0] - 2026-07-02
document.md
## [0.2.0] - 2026-07-02

Beacon firmware update shipped to the fleet.

✓ passes

A release heading in another form is flagged

contract.mdv.md
<!-- mdv: section required heading.mask="<semver> - <date>" -->
## 1.2.0 - 2026-07-02
document.md
## 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

contract.mdv.md
<!-- mdv: section required heading.none=@placeholders -->
## Sensor handoff
document.md
## Sensor handoff

Night shift hands the sensor logs to day shift at 06:00.

✓ passes

A TODO heading is flagged

contract.mdv.md
<!-- mdv: section required heading.none=@placeholders -->
## TODO
document.md
## TODO

Night shift hands the sensor logs to day shift at 06:00.

✗ heading-placeholder error · line 1

On this page