Skip to content

Generate README.md from split spec sources - #114

Merged
kahrendt merged 6 commits into
mainfrom
feat/split-readme-source
Jul 21, 2026
Merged

Generate README.md from split spec sources#114
kahrendt merged 6 commits into
mainfrom
feat/split-readme-source

Conversation

@maximmaxim345

@maximmaxim345 maximmaxim345 commented Jul 2, 2026

Copy link
Copy Markdown
Member

The spec used to be one big README.md. It's now split into per-section and per-role source files, and README.md is generated from them by tools/build-readme.py.

The generated README.md in this PR matches the old one except for two things the build forces: the generated-file banner at the top, and the two duplicate "Multiple servers" headings, renamed to "(server-initiated)" and "(client-initiated)" (with their two inbound links) so their anchors stop colliding. No sections move, so the diff against the old README.md is tiny. Reordering the page is left to a follow-up PR.

template.md is where the assembly lives: the document head, then <!-- include: <path> --> lines in page order. Links between files are written file-relative and turned into page anchors at build time, and the build fails on duplicate or dangling anchors. HTML comments are stripped from the output unless a <!-- keep: ... --> line precedes them, which is what keeps the banner. The pre-commit hook regenerates README.md from the staged files and blocks hand-edits to it. CI runs the same --check. Also adds CONTRIBUTING.md.

@maximmaxim345
maximmaxim345 force-pushed the feat/split-readme-source branch 2 times, most recently from 28d3478 to c395fd2 Compare July 14, 2026 11:03
@maximmaxim345
maximmaxim345 force-pushed the feat/split-readme-source branch from c395fd2 to 9c7ea2b Compare July 21, 2026 08:46
README.md is now a generated single-page artifact, authored as
per-section and per-role source files that tools/build-readme.py
concatenates, rewriting cross-file links to page anchors and
failing on duplicate or dangling anchors. The two colliding
"Multiple servers" headings are disambiguated (server-initiated /
client-initiated) because the build rejects duplicate anchors. A
pre-commit hook and CI check keep README.md in sync.
The concatenation order and the document head move out of the build
script into template.md, the assembly root: it holds the title,
definitions, and role versioning, then lists the files to append with
`<!-- include: <path> -->` directives. preamble.md is absorbed into it.

The generator now drops HTML comments from the page unless a
`<!-- keep: ... -->` line marks the next comment to persist, which is
how the generated-file banner reaches the top of README.md. The
generated README.md is unchanged.
The pre-commit hook now renders README.md from the staged content of
template.md and its includes rather than the working tree, so a partial
commit gets a README.md matching exactly what it commits. A README.md
that matches no generated rendering is still refused as a direct edit.
Comment stripping and the `<!-- keep: ... -->` marker applied only to
template.md. They now apply to every included file too, so an authoring
note in any source stays out of the generated README unless a keep
marker precedes it. No source has comments today, so README.md is
unchanged.
Comment thread .github/workflows/readme-sync.yml Outdated
Comment thread tools/build-readme.py
GitHub keeps underscores in heading anchors, but the slug builder
dropped them, so a link to a heading like `f_peak` would not resolve
on GitHub.

@kahrendt kahrendt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kahrendt
kahrendt merged commit 8de37dc into main Jul 21, 2026
1 check passed
@kahrendt
kahrendt deleted the feat/split-readme-source branch July 21, 2026 13:03
kahrendt pushed a commit that referenced this pull request Jul 21, 2026
Builds on #114. This one only moves sections around, no content changes:

- The overview sequence diagram comes out of the "Suggested correction
strategy" subsection and becomes its own "Protocol overview" section
near the top.
- "Playback Synchronization" moves down next to the player role's audio
sections.

Both are plain moves, so the `README.md` diff is just those two blocks
changing place. #114 and this PR together produce the same `README.md`
as the original combined change.

Depends on #114.
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