Publish a repository's documentation as a book or PDF

Contribution Date
Contribution Details
Publish a repository's documentation as a book or PDF The tree the standard already requires is a book: tiers fix the chapter set, directory indexes open sections, and frontmatter supplies titles, owners and evidence. Publishing should restate none of that, so build_book.py assembles what is there rather than asking anyone to maintain a second structure. Output is one self-contained HTML file with print rules, and --pdf drives the same headless browser the diagram check already pins. No documentation site, no LaTeX, no second toolchain. Diagrams become inline SVG because a printed page has no live renderer, and cross-page links become internal anchors so the book works away from a filesystem. Chapters follow reading order rather than folder order: overview, tutorials, how-to, reference, explanation, decisions, runbooks. A Project repository publishes its five files in contract order. Component repositories have a README, not a book, and the tool says so instead of producing an empty one. .axelerant/book.yml is optional and only reorders. It uses the same metadata dialect as repo.yml, which meant allowing hyphens in a key so a section can be named how-to. Naming a page that does not exist is now an audit finding rather than a silent omission, with fixtures both ways, so a spine cannot quietly drop a chapter. Every page keeps the evidence date and method it was published with, printed beside its title. The assembly date sits on the cover and is not evidence. Visibility prints as a cover banner, and the command says plainly that a banner is a label rather than a control. The Markdown renderer keeps raw HTML disabled, so diagrams are substituted through placeholders after rendering; a page cannot inject markup into the book. That costs one indirection and removes a class of surprise. Verified: 43 tests, both audits clean, plugin and workflow checks, and the example assembled to a 30-page PDF with five rendered diagrams. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01XmzqahsmAXBn5wJab92jP2
Contribution Author
Bassam Ismail
Files count
0
Patches count
1