feat(docs): emit the canonical public-docs artifact the app renders
MkDocs retires and the Astro app becomes the only public site, so the artifact is the product and the Markdown stays the source -- the split tools/newsgen already states for releases. tools/docsite walks the published set and writes docs/data/generated/docs.json: every page's directory-style url, title, section and raw Markdown body, plus the sidebar tree derived from the layout. Three things the artifact has to get right, each of which was wrong in a draft: - LINKS. The published pages carry relative .md links that MkDocs rewrote at build time and nothing else will. Each is rewritten to the target page's url using the same function that builds urls, so a link and its target cannot disagree; anchors and scheme-qualified links pass through; assets resolve by the same rule and none are referenced. - FRAGMENTS. A link can resolve to a page and still be broken, because a fragment matching no heading lands the reader at the top of a long document. Each is checked against the target's headings, by the slug rule a table of contents uses. - REFUSAL. A link whose target the set holds back, or whose fragment matches no heading, fails the generator naming the file, the line and the target. This found three citations from settled architecture pointing at two PRDs the blanket prds/* exclusion withheld -- links that were already 404s on the published site, so the exclusion broke citations rather than withholding drafts. Both targets are now published, for a reason distinct from the three ratified PRDs already published. The published set moves out of mkdocs.yml into the generator with its reasons: a renderer reading the artifact cannot see why a page is absent. docs/data/generated is accounted for by docsgen's generatedArtifacts, which now names this file beside contracts.json -- one ownership registry for the directory rather than one per writer, so neither tool reports the other's artifact as unaccounted. docs:artifact regenerates; docs:artifact:check reproduces into memory and fails on drift without touching the tree, wired into task check beside news:check. The existing docs:site target is MkDocs and was left alone -- a first attempt at that name silently ran MkDocs and produced nothing. Verified: task check exit 0, docs:artifact:check reporting 23 pages. The artifact carries 23 pages, no archive/ inspiration/ or news/ entry, and the five PRDs the set declares. Coverage: the published set and its count, url derivation, the nav tree, both refusal paths, and check's no-write guarantee.
This commit is contained in:
7 files changed
+1168
-24
No files matched your search
@@ -140,6 +140,7 @@ docs/
|
||||
generated/
|
||||
catalog.json
|
||||
contracts.json
|
||||
docs.json
|
||||
cli.json
|
||||
configuration.json
|
||||
messaging.json
|
||||
@@ -345,7 +346,9 @@ go -C tools run -mod=readonly ./docsgen check --repo-root ..
|
||||
```
|
||||
|
||||
`docsgen all` is still target-only: `docsgen data` and `docsgen asyncapi` do not
|
||||
exist, and only the single `contracts.json` artifact is generated today.
|
||||
exist. Two artifacts are generated today: `contracts.json` from the Go
|
||||
contract types (`docsgen`) and `docs.json` from the Markdown sources
|
||||
(`docsite`, the published set a renderer reads) -- see `task docs:artifact`.
|
||||
|
||||
### Step 9: CI
|
||||
|
||||
|
||||
Reference in new issue
Block a user