docs: embed the documentation pages in the README as collapsible sections #76

Manually merged
github merged 1 commit from gh-pr/76/head into gh-pr/76/base 2026-11-26 19:17:55 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-23 06:22 UTC · original
Dark3581:docs/readme-embedded → main · +782 −11 · 5 files · 1 commits · merged 2026-11-23 06:26 UTC

What

The README's tab bar (#75) moved you to another page. GitHub strips scripts and most CSS from READMEs, so real in-place tabs aren't possible there. The closest thing is collapsible sections, so the README now embeds every documentation page in one:

  • Right under the title are eight <details> blocks: Usage, Build, Architecture, Game testing, Contributing, Conventions, Technical debt, Progress. Each opens in place to show the whole page, and each summary also links to the page's own file. The doc pages keep their tab bar for moving between them.
  • tools/readme_docs.py generates the blocks between <!-- docs:start --> and <!-- docs:end -->:
    • it drops each page's title and tab bar;
    • it rewrites relative links (Markdown and href/src) so they resolve from the README; links to a heading inside a page point at that page's file; fenced code is left alone;
    • --check fails when the README is out of date.
  • Keeping it current: debt_fold.py regenerates the README after folding, since folding changes the technical-debt page. tools/tests/test_readme_docs.py fails, naming the command to run, if any embedded page changes without regenerating. CONTRIBUTING says so.

Tested

  • tools/tests/test_readme_docs.py:
    • the README is up to date;
    • link rewriting covers relative paths, parent paths, in-page anchors, URLs and mailto:;
    • the title and tab bar are dropped and fenced code is untouched;
    • the markers are required;
    • a full generation from a temporary tree replaces only the marked block.
  • All 87 links in the embedded block checked against the repository. The only two that don't resolve sit inside a fenced example in the technical-debt page, where they aren't links.
  • debt_fold.py --check, test_debt_and_reports.py, python tools/check_conventions.py and the 15 tools_* tests: ok. The README is 69 KB.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • python tools/check_conventions.py passes (no comments in code, one declaration per export, Conventional Commit subjects)
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment
  • Known gaps added, changed or removed through docs/dev/debt/changes/<branch>.md
  • Generic behaviour, not specific to one title
  • No game files, keys, notes or logs added to the repository
  • Depends on: #75 (merged)
  • Fixes: none
  • Unblocks: none
  • Source of behaviour: n/a
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-23 06:22 UTC · [original](https://github.com/Dark3581/AnyBox/pull/76) `Dark3581:docs/readme-embedded` → `main` · +782 −11 · 5 files · 1 commits · merged 2026-11-23 06:26 UTC ### What The README's tab bar (#75) moved you to another page. GitHub strips scripts and most CSS from READMEs, so real in-place tabs aren't possible there. The closest thing is collapsible sections, so the README now embeds every documentation page in one: - Right under the title are eight `<details>` blocks: Usage, Build, Architecture, Game testing, Contributing, Conventions, Technical debt, Progress. Each opens in place to show the whole page, and each summary also links to the page's own file. The doc pages keep their tab bar for moving between them. - **`tools/readme_docs.py`** generates the blocks between `<!-- docs:start -->` and `<!-- docs:end -->`: - it drops each page's title and tab bar; - it rewrites relative links (Markdown and `href`/`src`) so they resolve from the README; links to a heading inside a page point at that page's file; fenced code is left alone; - `--check` fails when the README is out of date. - **Keeping it current:** `debt_fold.py` regenerates the README after folding, since folding changes the technical-debt page. `tools/tests/test_readme_docs.py` fails, naming the command to run, if any embedded page changes without regenerating. CONTRIBUTING says so. ### Tested - `tools/tests/test_readme_docs.py`: - the README is up to date; - link rewriting covers relative paths, parent paths, in-page anchors, URLs and `mailto:`; - the title and tab bar are dropped and fenced code is untouched; - the markers are required; - a full generation from a temporary tree replaces only the marked block. - All 87 links in the embedded block checked against the repository. The only two that don't resolve sit inside a fenced example in the technical-debt page, where they aren't links. - `debt_fold.py --check`, `test_debt_and_reports.py`, `python tools/check_conventions.py` and the 15 `tools_*` tests: ok. The README is 69 KB. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] `python tools/check_conventions.py` passes (no comments in code, one declaration per export, Conventional Commit subjects) - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`); silent stubs are listed under Silent stubs through a debt fragment - [x] Known gaps added, changed or removed through `docs/dev/debt/changes/<branch>.md` - [x] Generic behaviour, not specific to one title - [x] No game files, keys, notes or logs added to the repository - [x] Depends on: #75 (merged) - [x] Fixes: none - [x] Unblocks: none - [x] Source of behaviour: n/a - [x] AI-assisted: yes
GitHub strips scripts from READMEs, so the closest thing to in-place tabs is collapsible sections. readme_docs.py generates one per documentation page with links rewritten to resolve from the README; debt_fold.py regenerates it after folding and a test fails while it is out of date.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:17:53 +00:00
github manually merged commit 8fb15d3708 into gh-pr/76/base 2026-11-26 19:17:55 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.