VALIDATION-PLANES-07: Require a block kind: a table
What it demonstrates
Section titled “What it demonstrates”section(…, {content: table({columns})}) makes the structure plane require a table block of that shape inside the section.
Builds on: VALIDATION-PLANES-02: The smallest contract: one required section
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
import { table } from "markdown-contract";
const c = contract({ body: sections({}, [ section("Changes", { content: table({ columns: ["File", "Kind"] }) }),]) });// "Changes" with no block -> structure/block-missing// a block that is not a table -> structure/block-kindSurfaces exercised
Section titled “Surfaces exercised”table() content leaf (src/core/leaves.ts)SectionOpts.content kind-gate (src/core/structure.ts kindGate)structure/block-missing; structure/block-kind