Skip to content

docs(reference): the generated index - #206

Merged
kfox merged 1 commit into
mainfrom
docs/reference-index
Aug 4, 2026
Merged

docs(reference): the generated index#206
kfox merged 1 commit into
mainfrom
docs/reference-index

Conversation

@kfox

@kfox kfox commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Seventh of eight in the reference-guide review stack. Branches off main
(#205 is merged). Documentation and tooling only — no hardware, no runtime
code touched.

The problem

Ten appendices, a hundred and ninety pages, and no way to look anything up.
The contents page lists sections; it does not list names. A reader who
remembers dither_strength but not which chapter discusses it has to guess.

What lands

scripts/gen_reference_appendices.py gains a second half. It already reads
introspect for the appendices; it now reads it again the other way round and
crosses it with the book's own committed Markdown, writing
docs/reference/30-index.md — 503 entries over about twenty pages.

Terms are every name the program can utter: configuration sections and
keys, command-line flags, scene types, overlays, display modes, generators,
effects and live-tune targets. A key is listed bare, and again qualified with
its section only where two sections share the name — [color].dither and
[audio].dither are two different settings, [dsp].agc is not ambiguous with
anything. That is the rule the book's own Notation section already states.

Section titles are entries too. "Companding", "The Audio Slot", "Why Cuts
Do Not Tear" — so the concept can be looked up by a reader who does not yet
know which key it belongs to. A title that is nothing but a name is skipped,
since the name is already an entry.

Locators come from scanning the chapters for each term inside a code span
or a heading, and taking the innermost enclosing ##/### — whose anchor
#205 defined. Fenced code blocks are excluded (an example config names half
the program), as are values-not-terms (auto, true, random) and tokens
under three characters. Three locators per term, ordered so the section
written about the term leads and the prose chapters come before the tables:

Term Discussed in
dither Which Pixel Takes Which — dither (3), The Shape of a Value (1), Companding — dac_curve (4)

Each locator carries its chapter number in parentheses, which is not
decoration: three sections in this book are called some case of "MIDI", and
midi_voice_channels is discussed in all three. Without it the reader got
midi, MIDI, midi and no way to tell them apart.

Every locator is a relative Markdown link, so it resolves on github.com and as
an internal PDF link alike — and an unresolvable one fails the book build,
which is what turns a renamed section into a build error rather than a dead
link in print.

Shape

No number in the front matter, so it renders after Appendix J as a plain
accent heading rather than claiming a letter of its own. It reuses the
<!-- table: fields --> machinery whole — no new template function, no new
converter directive.

The one template change: the identity column no longer justifies. It has only
ever held names, which do not stretch; a section title set into 1.5in and
stretched to the margins is three words with two rivers through it. Nothing
else in any book renders differently.

Verification

  • make lint, make typecheck (mypy --strict + pyright) clean
  • make test — 3331 tests, all pass
  • make books renders all three; the reference PDF is 201 pages, the index
    runs from p. 170
  • python scripts/gen_reference_appendices.py --check — 11 generated files up
    to date
  • New tests: every locator in the committed index resolves to a real section
    anchor; the index carries no number; it does not index itself; the section
    written about a term leads its entry; plus unit tests for what counts as a
    name, what counts as a concept, and where an entry files

Bookkeeping

docs/reference/README.md, the introduction's "What Is In Here", the Makefile
help line and CLAUDE.md all now mention the index. The freshness test's
generated-file count goes 9 → 10, and test_every_generated_file_converts
now passes anchors to the converter — without them the index cannot resolve a
single one of its links.

Nine appendices and no way to look anything up. The index is generated
from the same introspection the appendices are, crossed with the book's
own Markdown: every name the program can utter — configuration sections
and keys, CLI flags, scene types, overlays, display modes, generators,
effects, live-tune targets — against the sections that discuss it.

Locators come from scanning the committed chapters for each name in a
code span or a heading and taking the section it sits in, so the index
cannot name a term the program does not have or point at a section the
book does not have. Ordered so the section *written about* a term leads,
then prose before the tables: "where is dither explained" answers with
the section that explains dithering, not with its row in Appendix A.

Section titles are entries too — "Companding", "The Audio Slot" — which
is what lets a reader look a thing up before they know its key. A key is
listed bare, and again qualified with its section only where two
sections share the name, which is the rule the Notation section states.

Each locator carries its chapter, because three sections here are called
some case of "MIDI" and a bare title left the reader with `midi`, MIDI,
`midi` and no way to tell them apart.

No `number` in its front matter, so it renders after Appendix J as a
plain heading instead of claiming a letter. It reuses the fields-table
machinery whole; the one template change is that the identity column no
longer justifies, since a section title set into 1.5in and stretched to
the margins is three words with two rivers through it.
@kfox
kfox merged commit c79cdc1 into main Aug 4, 2026
16 checks passed
@kfox
kfox deleted the docs/reference-index branch August 4, 2026 00:04
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.

1 participant