Skip to content

docs: generate docs/README.md instead of listing filenames - #43

Merged
sethbergman merged 1 commit into
mainfrom
claude/todo-implementation-71gyx8
Aug 26, 2026
Merged

docs: generate docs/README.md instead of listing filenames#43
sethbergman merged 1 commit into
mainfrom
claude/todo-implementation-71gyx8

Conversation

@sethbergman

@sethbergman sethbergman commented Aug 26, 2026

Copy link
Copy Markdown
Owner

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.

`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
@sethbergman
sethbergman merged commit adaf577 into main Aug 26, 2026
@sethbergman
sethbergman deleted the claude/todo-implementation-71gyx8 branch August 28, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants