Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 1.33 KB

File metadata and controls

36 lines (31 loc) · 1.33 KB
title Self-maintaining sections
summary On `mdsmith fix`, `<?toc?>` rebuilds a heading TOC, `<?catalog?>` generates an index from front matter, and `<?include?>` splices in another file. A Git merge driver auto-resolves conflicts inside those blocks.
icon list-checks
link /guides/directives/generating-content/
weight 12
group Markdown as a single source of truth

Self-maintaining sections

Some sections should never be hand-edited. mdsmith marks them with directives and rebuilds the body on mdsmith fix.

<?toc?> rebuilds a heading table of contents. <?catalog?> generates an index — a list, a table, or any row template — from the front matter of files matching a glob. <?include?> splices in another file.

A <?catalog?> directive matches at most 10,000 files. When the glob resolves more than that limit, mdsmith emits a diagnostic and leaves the generated section unchanged rather than consuming unbounded memory.

Generated blocks fight Git merges. mdsmith merge-driver install registers a driver for them. It re-runs the directive and resolves the conflict for you.

See the generating-content guide for directive syntax and options. The progressive disclosure guide turns the same catalogs into an agent-ready docs index.