feat(docs): torb docs declarations generates the signature blocks of std pages #243
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/32-std-declarations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #32
What
torb docs declarations [root] [--standard-library <path>] [--check](compiler/src/documentation/declarations.trb, wired indocumentation/command.trbandmain.trb). A line<!-- torb:declaration: <Name> -->directly above atrb fragmentfence marks the block; the command checksstd/, builds thetorb docmodel and writes each marked block from the package the page'stitle: std/<name>names (kind: packagepages only). Several markers above one fence show several constructs in their order. Everything outside the marked fences stays byte for byte.public, the non-private members indented, and the package'sextendblocks targeting the construct: the header of a trait implementation (its members are the trait's), the whole block of an inherentextend. A name that is no construct but only anextendtarget (Bytes,String,List, ...) shows those blocks.trb fragmentfence, an unclosed block, a marked page that is no package of the model, and an unknown name (at the marker's page and line; its block stays as it is).--checkwrites nothing and reports every stale block with the first line that differs.docs declarations --check docsbesidedocs index --checkintools/gates.sh.compiler/tests/documentation-declarations.test.trb): byte-for-byte regeneration, an up-to-date page unchanged, text outside the markers untouched (including a marker inside another fence and an unmarked fence), two markers under one heading, a foreignextendtarget, an unknown name, a misplaced marker, a page that is no package, a stale block reported by--check, and a clean--check.standard-library/index.md,contributing/checks.md(the declarations section and the synopsis),contributing/adding-a-page.md(the std template),tooling/torb-doc.md,contributing/research.md.## Declarationssignature fence of the std pages has its markers, the blocks are regenerated, andskills/is regenerated.Why
The hand-written blocks had drifted from
std/(missing members,public, missingextendheaders). Generated, they are the full public surface as the model states it, and the gate keeps them that way.Choices made while migrating the pages
Fileinfs.md,Bytesincompression.md,Hmac.pbkdf2indigest.md,Sinkinstream.md,Listinarchive.md), the first fence is marked and generated with the full surface; the later fences are removed and their prose stays under its heading.network.md), the prelude, the configuration blocks ofproject.md, an example intask.md.ExtractErrorofstd/archive/extractstays hand-written: the model documents a package by what its entry module exports, andextractis a module of its own, so only itsextendblocks reach the model. Generating it would have dropped the type.Test
torb check compilerandtorb format --checkon the touched.trbfiles, locally with the nightly.9c71f157(run 443): success. The new unit tests run in tier A'stest compiler/tests (native)(165 s); the regenerated pages match whatmain's generator writes.docs declarations --check: 19 s in the docs lane, besidedocs index --check(18 s). That is under the 40 s limit, so the gate keeps its own check ofstd/and does not share the one ofdoc --check --no-run std(11 s).## Declarationssections of the standard library pages #32Review of
9c71f157(checklist):documentation-declarations.test.trbcovers every case the issue lists (byte-for-byte regeneration, untouched text incl. a marker inside another fence, two markers under one heading, unknown name, misplaced marker, non-package page, stale block via--check, clean--check). CI is green for this head, including tier A, tier B, gates and pdisc.--checkwrites nothing, and a package that does not check stops with a clear message.skills/regenerated). No new automation.tools/gates.sh.Non-blocking:
docs declarations --checkis not stated in the body, so a follow-up comment or issue note with the number would close it.