--- title: "Self-maintaining sections" summary: >- On `mdsmith fix`, `` rebuilds a heading TOC, `` generates an index from front matter, and `` 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`. `` rebuilds a heading table of contents. `` generates an index — a list, a table, or any row template — from the front matter of files matching a glob. `` splices in another file. A `` 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](../guides/directives/generating-content.md) for directive syntax and options. The [progressive disclosure guide](../guides/progressive-disclosure.md) turns the same catalogs into an agent-ready docs index.