docs: generate docs/README.md instead of listing filenames - #43
Merged
Conversation
`make docs` was a placeholder that ran `ls docs/`, which is what GitHub already shows when you open the directory: sixteen filenames, and no way to tell that `audit.md` is the file explaining why two audit devices are the dangerous configuration. It now builds docs/README.md from each document's own H1 and H2 headings. Deriving the index rather than writing one alongside the docs is the point: a hand-maintained index stops covering each new document silently, and the omission is invisible to everyone except the reader who needed that document. CI runs the generator with --check, so a new document, a renamed section or a hand-edit to the index fails as a diff with `make docs` as the fix. That alone would be circular — a generator that misread a heading would produce a wrong description CI then defends, since both halves of the diff come from it — so tests/docs-index covers the reading: headings inside fenced code blocks are not sections (several docs open with a shell block containing a `##` comment), a document with no title is an error rather than an empty link, a pipe in a heading is escaped rather than ending the table cell, --check reports staleness without quietly fixing it, and regeneration is idempotent because the index does not index itself. Each of those was verified by breaking the generator in a way the assertion does not name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G31jNCzetpEBiE3denYnyk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make docswas a placeholder that ranls docs/, which is what GitHubalready shows when you open the directory: sixteen filenames, and no way
to tell that
audit.mdis the file explaining why two audit devices arethe dangerous configuration.
It now builds docs/README.md from each document's own H1 and H2
headings. Deriving the index rather than writing one alongside the docs
is the point: a hand-maintained index stops covering each new document
silently, and the omission is invisible to everyone except the reader
who needed that document.
CI runs the generator with --check, so a new document, a renamed section
or a hand-edit to the index fails as a diff with
make docsas the fix.That alone would be circular — a generator that misread a heading would
produce a wrong description CI then defends, since both halves of the
diff come from it — so tests/docs-index covers the reading: headings
inside fenced code blocks are not sections (several docs open with a
shell block containing a
##comment), a document with no title is anerror rather than an empty link, a pipe in a heading is escaped rather
than ending the table cell, --check reports staleness without quietly
fixing it, and regeneration is idempotent because the index does not
index itself.
Each of those was verified by breaking the generator in a way the
assertion does not name.