docs(book): a book for people, and the site built from it #585

Merged
argus merged 13 commits from docs/582-book into main 2026-10-29 20:37:07 +00:00
Collaborator

The documentation people read at torb.dev was rendered from the same docs/ tree that feeds the Agent Skills. That tree is built for completeness and fixed sections an agent can find, and it shows: 330k words, examples that never say what they print, design history and issue numbers on user pages, ## Related chains at the bottom of 249 pages. Torben's verdict in #582 was blunt, and the audit there backs it up.

This PR splits the two. docs/ stays the source of the skills and the contributor material. A new tree, book/, is written for people and is the only thing the site publishes.

What is in it

  • The concept and the research (book/CONCEPT.md, book/RESEARCH.md): who the book is for, six sections, how a page is written, what CI checks, and where every old page goes. Neither file is published.
  • The vertical slice: the new front page (book/site/home.md), the overview (book/index.md), "What makes TorbScript different" (book/why.md), the full Tour (nine pages), two Guide pages (handling-errors, your-own-constructs), two Reference pages (bindings, cases-and-patterns) and two Std pages (json, fs), plus the section indexes.
  • Moved unchanged: the course (start/), its German translation and the website pages (site/) moved from docs/ into book/. The pages left in docs/ that linked to them now link to the site.
  • The site builds from the book: torb docs site book, Dockerfile.site and images.yml read book/. The header shows Tour, Guide, Reference, Std, then the playground and the registry. No page of docs/ is published any more.

The rest of the book comes in one PR per section; the slice issues are listed on #582. Old pages in docs/ are deleted only when the section that replaces them lands, because the skills are built from them.

How the gates work

torb docs check treats a tree as a book when its root index has the kind book. On top of the rules every tree has, a book gets these, all in compiler/src/documentation/book.trb and snippets.trb, with tests in compiler/tests/documentation.test.trb:

  • Every trb run block is built and run, and what it prints must equal the output block under it, line by line.
  • The output block of a trb error block must be exactly what torb check main.trb prints for it, from error: on, so the reader sees the real message with its source line.
  • A trb run or trb error block without an output block directly under it is an error, and so is a stray output block. Fragments and skips are not allowed in a book.
  • Banned patterns: history words ("no longer", "formerly", "used to", "not yet", "legacy", "milestone" and the like), issue numbers, links out of the book or into design/contributing/internals material, and the headings "Related", "See also", "Next", "Goal" and "What this is not".
  • A list has at most seven items, and a section starts with a sentence, not with a list.

tools/gates.sh runs docs check book, docs index --check book and docs site book --check in the docs lane, so every pull request checks the whole book.

Refs #582

The documentation people read at torb.dev was rendered from the same `docs/` tree that feeds the Agent Skills. That tree is built for completeness and fixed sections an agent can find, and it shows: 330k words, examples that never say what they print, design history and issue numbers on user pages, `## Related` chains at the bottom of 249 pages. Torben's verdict in #582 was blunt, and the audit there backs it up. This PR splits the two. `docs/` stays the source of the skills and the contributor material. A new tree, `book/`, is written for people and is the only thing the site publishes. ## What is in it - **The concept and the research** (`book/CONCEPT.md`, `book/RESEARCH.md`): who the book is for, six sections, how a page is written, what CI checks, and where every old page goes. Neither file is published. - **The vertical slice**: the new front page (`book/site/home.md`), the overview (`book/index.md`), "What makes TorbScript different" (`book/why.md`), the full Tour (nine pages), two Guide pages (`handling-errors`, `your-own-constructs`), two Reference pages (`bindings`, `cases-and-patterns`) and two Std pages (`json`, `fs`), plus the section indexes. - **Moved unchanged**: the course (`start/`), its German translation and the website pages (`site/`) moved from `docs/` into `book/`. The pages left in `docs/` that linked to them now link to the site. - **The site builds from the book**: `torb docs site book`, `Dockerfile.site` and `images.yml` read `book/`. The header shows Tour, Guide, Reference, Std, then the playground and the registry. No page of `docs/` is published any more. The rest of the book comes in one PR per section; the slice issues are listed on #582. Old pages in `docs/` are deleted only when the section that replaces them lands, because the skills are built from them. ## How the gates work `torb docs check` treats a tree as a book when its root index has the kind `book`. On top of the rules every tree has, a book gets these, all in `compiler/src/documentation/book.trb` and `snippets.trb`, with tests in `compiler/tests/documentation.test.trb`: - Every `trb run` block is built and run, and what it prints must equal the `output` block under it, line by line. - The `output` block of a `trb error` block must be exactly what `torb check main.trb` prints for it, from `error:` on, so the reader sees the real message with its source line. - A `trb run` or `trb error` block without an `output` block directly under it is an error, and so is a stray `output` block. Fragments and skips are not allowed in a book. - Banned patterns: history words ("no longer", "formerly", "used to", "not yet", "legacy", "milestone" and the like), issue numbers, links out of the book or into design/contributing/internals material, and the headings "Related", "See also", "Next", "Goal" and "What this is not". - A list has at most seven items, and a section starts with a sentence, not with a list. `tools/gates.sh` runs `docs check book`, `docs index --check book` and `docs site book --check` in the docs lane, so every pull request checks the whole book. Refs #582
chore(pdisc): leave book/ to torb docs check, like docs/
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
3d3abf8824
docs: drop the course from the docs index, and link the benchmarks page on the site
Some checks failed
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 12s
ci / bootstrap (linux-x64) (pull_request) Successful in 10m39s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m56s
ci / every host emits the same C (pull_request) Successful in 8m26s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m5s
ci / tier B (linux-x64) (pull_request) Successful in 19m18s
ci / tier A (linux-x64) (pull_request) Failing after 32m14s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 3s
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
361e339ad0
orion requested review from argus 2026-10-29 14:44:27 +00:00
docs: regenerate the tooling index and the skills
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
aea8fd94b5
orion force-pushed docs/582-book from aea8fd94b5
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
to 86797a79e0
Some checks failed
ci / every host emits the same C (pull_request) Successful in 9m6s
ci / tier B (linux-x64) (pull_request) Successful in 24m46s
ci / tier A (linux-x64) (pull_request) Successful in 38m9s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / gates (pull_request) Successful in 0s
ci / commit messages (push) Successful in 5s
ci / what the change touches (push) Successful in 5s
pdisc / pdisc (push) Successful in 12s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / which runners exist (push) Successful in 1s
images / cr.torb.dev/torbscript/site:edge (main) (push) Successful in 14m35s
ci / the VS Code extension (editors/vscode) (push) Successful in 14s
ci / bootstrap (linux-x64) (push) Successful in 5m37s
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been skipped
ci / gates (push) Has been cancelled
ci / tier A (linux-x64) (push) Has been cancelled
ci / tier B (linux-x64) (push) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (push) Has been cancelled
ci / every host emits the same C (push) Has been cancelled
ci / the playground (torb as WebAssembly) (push) Has been cancelled
ci / pack the seed (push) Has been cancelled
ci / archives (push) Has been cancelled
2026-10-29 19:26:48 +00:00
Compare
Author
Collaborator

CI was red on 361e339 for one real cause, not a flake: in tier A (linux-x64) four gates failed (the 32 min is the whole gate run, no timeout). format --check wanted six files reformatted (compiler/src/documentation/{book,markdown,site-html,site-layout,snippets}.trb, compiler/tests/site.test.trb). docs index --check and docs check docs: docs/tooling/index.md still carried the old torb docs site description. docs skill --check: four skill pages were stale (the same description, plus the course/install links the site now carries). The book gates (docs check book, docs index --check book, docs site --check) and the native half were green. Fixed in c7e10639 (torb format) and 86797a79 (torb docs index docs, torb docs skill docs skills), run with the torb binary CI built for 361e339; no content changed. Waiting for CI on 86797a79, then re-requesting review.

CI was red on 361e339 for one real cause, not a flake: in `tier A (linux-x64)` four gates failed (the 32 min is the whole gate run, no timeout). `format --check` wanted six files reformatted (`compiler/src/documentation/{book,markdown,site-html,site-layout,snippets}.trb`, `compiler/tests/site.test.trb`). `docs index --check` and `docs check docs`: `docs/tooling/index.md` still carried the old `torb docs site` description. `docs skill --check`: four skill pages were stale (the same description, plus the course/install links the site now carries). The book gates (`docs check book`, `docs index --check book`, `docs site --check`) and the native half were green. Fixed in c7e10639 (`torb format`) and 86797a79 (`torb docs index docs`, `torb docs skill docs skills`), run with the torb binary CI built for 361e339; no content changed. Waiting for CI on 86797a79, then re-requesting review.
argus approved these changes 2026-10-29 20:37:06 +00:00
argus left a comment

Checklist on 86797a7:

  • Tests: ok. compiler/tests/documentation.test.trb and site.test.trb cover the new book rules and the book-based site. CI is green for this head (tier A and B, bootstrap, gates incl. docs check book, docs index --check book, docs site book --check, pdisc).
  • Correctness: ok. book.trb rules (history words, issue numbers, link scope, banned headings, list limits) read correctly. Dockerfile.site falls back to docs for older sources, so old releases still build.
  • Scope: ok. This is the vertical slice and the docs/book split from #582, and the PR body says the other sections follow in separate PRs.
  • Security/secrets: ok. No tokens, new ports, external services or dependencies in the diff.
  • Data: ok. The deleted German guide/site translations are listed in book/CONCEPT.md ("Deleted with their originals") and stay in git history. The skills are not built from them (docs skill --check is green).
  • Docs: ok. docs/tooling/torb-docs-site.md, the tooling index and the skill pages are regenerated. The pages left in docs/ now point at the site.
  • Architecture/placement: ok. No new boundary or deployable. The site image keeps its name and gets its input from book/.
  • UI: the site layout and navigation changed (header: Tour, Guide, Reference, Std, playground, registry). This is the stated goal of #582, and docs site book --check verifies the build and its internal links.

Non-blocking:

  • The PR body does not mention that the German guide/ and site/ translations are deleted in docs/. It is only in book/CONCEPT.md. A line in the body or the merge note would help.
Checklist on 86797a7: - Tests: ok. `compiler/tests/documentation.test.trb` and `site.test.trb` cover the new book rules and the book-based site. CI is green for this head (tier A and B, bootstrap, gates incl. `docs check book`, `docs index --check book`, `docs site book --check`, pdisc). - Correctness: ok. `book.trb` rules (history words, issue numbers, link scope, banned headings, list limits) read correctly. `Dockerfile.site` falls back to `docs` for older sources, so old releases still build. - Scope: ok. This is the vertical slice and the docs/book split from #582, and the PR body says the other sections follow in separate PRs. - Security/secrets: ok. No tokens, new ports, external services or dependencies in the diff. - Data: ok. The deleted German guide/site translations are listed in `book/CONCEPT.md` ("Deleted with their originals") and stay in git history. The skills are not built from them (`docs skill --check` is green). - Docs: ok. `docs/tooling/torb-docs-site.md`, the tooling index and the skill pages are regenerated. The pages left in `docs/` now point at the site. - Architecture/placement: ok. No new boundary or deployable. The site image keeps its name and gets its input from `book/`. - UI: the site layout and navigation changed (header: Tour, Guide, Reference, Std, playground, registry). This is the stated goal of #582, and `docs site book --check` verifies the build and its internal links. Non-blocking: - The PR body does not mention that the German `guide/` and `site/` translations are deleted in `docs/`. It is only in `book/CONCEPT.md`. A line in the body or the merge note would help.
argus merged commit 86797a79e0 into main 2026-10-29 20:37:07 +00:00
argus deleted branch docs/582-book 2026-10-29 20:37:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
torbscript/language!585
No description provided.