How to add a page or a series to the wiki in docs/wiki/, what a lesson page looks like, how long a page may be, and the exact steps that keep the navigation honest. This describes what the repository does today and what its tests enforce (issue #563, epic #558). If this guide and a test disagree, the test wins; fix the guide.
The pages in docs/wiki/ are published to the GitHub wiki by the publish step, so edit them here by pull request. Edits made in the wiki editor are overwritten on the next publish.
defense, color, license). tests/test_american_english.py flags a conservative list of British spellings.tests/test_lesson_guards.py checks every lesson page.scripts/identifier_check.py scans for identifiers.A lesson page is built from these parts, in this order. The OpenTofu from zero hub, docs/wiki/OpenTofu-From-Zero.md, is the model for the top of a page.
Next: link.> Unfamiliar word or acronym? The [Glossary](Glossary.md) defines it.> **Status: and says what was run and what was not, with a date inside the banner. This is the honesty line for the whole page. A page the author only read says so ("written from reading"); a page described as an unverified draft says "unverified draft". tests/test_lesson_guards.py fails a lesson without a dated banner that says what was or was not run.> **Prerequisites.**: what the reader needs to have, installed or read first, with links, and the time the page takes. Mark every time you did not measure as an estimate with (est.), for example "About three hours for everything (est.)". A time you timed yourself is stated without the mark.## sections. Link a sibling lesson as a link, never as plain text.est.; the guards look for the mark when the banner says something was not run.Not every page needs every part. A short reference page may have only the first four. A page with no exercise must still carry the banner and the prerequisites.
Also, in the same pull request:
Glossary-<letters>.md that holds its first letter; Glossary.md is only the index.docs/wiki/Reading-Order.md if it belongs on a path. That page is written by hand, not generated, and tests/test_wiki_navigation.py fails a page that is linked from neither Contents nor Reading-Order.Write one page when the topic is one idea, a reader finishes it in one sitting, and it stays inside the size guideline below.
Write a series (one hub and numbered parts) when the topic is a sequence of lessons or exercises that a reader will do on different days, when one page would pass the size guideline, or when an existing page has grown past it. A series is also how a long page is split (see the split pattern below). Do not split to hide a long page: each part has to be a page a reader can start on and finish.
tests/test_wiki_size_guideline.py enforces this.LONG_PAGES, with their line counts, and the allowlist only goes down. A page on it may not grow; a page that drops to 1,000 lines or fewer must be removed from it (the test fails until it is); a page that gets shorter but stays over must have its recorded count lowered. Never add a page to the allowlist: split it. The splits are tracked under issue #562.Contents, _Sidebar, Home) are counted like any other, and all three are well under the limit, so none is excluded.Seven long pages are being split under issue #562: the Glossary (an index and letter pages) and six lessons. The merged OpenTofu-From-Zero hub and its four parts are the model; the Build and Destroy, Plans, Rate limiting, Secrets from day one and IDS and IPS lessons follow the same hub-and-parts pattern.
## The parts section that lists every part in order with a one-line summary each, then an index that links straight to the headings (such as each exercise) inside the parts.<Stem>-Part-N-<Topic>.md, where <Stem> is the hub's file name without .md, for example OpenTofu-From-Zero-Part-2-Exercises-3-to-6-Plan-Symbols-State-Count-and-Modules.md.## sections. The part's first heading is the only H1; the exercises inside are ###.#the-parts).series value, the hub entry is first, and the parts follow in order (see the next section).tests/test_opentofu_from_zero_split.py: the hub lists every part, each part links back to the hub and is under the line cap, the manifest holds them as one series with the hub first, and every anchor the hub indexes is a heading of the part it names. A record-based test in tests/test_stale_sibling_statements.py checks the text moved verbatim.The navigation manifest is the directory docs/wiki/_nav/: index.yaml holds the groups, links, readers and goals, and one <group id>.yaml per group holds that group's page entries, one line each. The header of index.yaml explains every field; this is the order of work.
docs/wiki/.docs/wiki/_nav/index.yaml (core, foundations, defend, privacy, grc, build, tools, runs, reference and start). Most new lessons go in a track group (foundations, defend, privacy, grc or build).Add one line to that group's file, docs/wiki/_nav/<group>.yaml, for example:
- {page: Page-File-Name-Without-md, title: "Short title", audience: "learner", subgroup: "Theme", desc: "One line: what the page is for and who it is for."}
page is the file name without .md; audience is one of everyone, newcomer, learner, builder, engineer, operator or security reader. The optional status copies the page's own banner and is never invented: draft for an unverified draft, est. steps for steps written from reading and not run, unbuilt for something not built or not applied. Leave it out when the banner makes none of those claims. Keep title to 80 characters and desc to 220, on one plain line without a |.
series: "Name" value, hub first, parts in order, with the part pages following one another in the same group file. The sidebar folds the series into one line; Contents, Home and the previous and next links still list every page.Regenerate the generated files, then check them:
python -I scripts/gen_wiki_nav.py
python -I scripts/gen_wiki_nav.py --check
The first command rewrites docs/wiki/Contents.md, docs/wiki/_Sidebar.md, the page map on docs/wiki/Home.md (only the block between its generated markers) and the in-page contents block of any page over 300 lines. The second exits 0 when everything is current and exits 1 with a message when something is stale. CI runs the second command.
scripts/gen_wiki_nav.py does not write docs/wiki/Reading-Order.md or any page's body. It writes the generated blocks above, and it removes the navigation blocks from page files (the previous and next links and the breadcrumb are added at publish time, not stored).
Run the checks that cover your change, not the whole suite (CI runs that):
python -I scripts/gen_wiki_nav.py --check
python -I scripts/identifier_check.py --root .
python -I -m pytest tests/test_wiki_size_guideline.py tests/test_wiki_navigation.py tests/test_wiki_nav_manifest.py -q
ruff check scripts tests
Add the tests for the lesson itself when you add or split one (the split test above, and a row in tests/lesson_guard_data.py for a lesson with a claims register). A failing check is fixed, never skipped or loosened.