English
Improve the docs
You will change a page of this site and see it live, in both languages, with the same checks the CI runs. The rule behind every page: what the docs tell a person to run, someone ran, and what they show as output is what the command printed.
Before you begin 10 minutes
- The repository, installed: see Your first pull request.
Run the site
The site is built with VitePress, from the
docs-sitefolder. Start it and open the address it prints; a page reloads as you save it.Terminalshnpm run docs:devEvery page has an "Edit this page" link at the bottom that opens its file on GitHub.
Find the file
A page's address is its path:
/charts/quickstartisdocs-site/charts/quickstart.md, and its French version isdocs-site/fr/charts/quickstart.md. Two kinds of pages live there:- Written by hand: their front matter says
type: guide(or tutorial, concept, reference, index), without quotes. Edit them. - Generated: the reference of the CLI, the SDK, the author MCP, the errors, the fields of each standard and the troubleshooting page. Their front matter says
type: "reference", with quotes. Do not edit them: change their source (the standard, the code, or the generator indocs-site/scripts/), then regenerate.
Terminalshnpm run docs:gen- Written by hand: their front matter says
Write the page
Each page does one job, and reads the same way:
- The outcome first: the front matter's
descriptionand the paragraph under the title say what the reader will have at the end. - A block to copy within the first screen for a tutorial or a guide.
- Real output only. A code block is never typed from memory: the line before it is an example marker, an HTML comment that starts with
example:and names a file (and, for JSON, a pointer such as#/parts). The build prints the file, or the part the pointer names, in place of the block. Outputs come fromdocs-site/.generated/, written by a generator that runs the realaltain a temporary folder. - A next step at the bottom: the NextSteps component, with up to three cards.
- English and French, same structure, same commands; the French says "tu". A new page also needs its entry in the sidebar,
docs-site/.vitepress/nav.ts, or the docs tests report it as an orphan.
Use one word for one thing: chart, value, sign-in, part, proof, repair, grant, release, repository, index, publisher, locality. The components (Steps, Prereqs, Callout, NextSteps, ErrorRef) are in
docs-site/.vitepress/theme/components/; look at an existing page of the same type and follow it.- The outcome first: the front matter's
Run the checks
docs:buildfirst checks that every generated page is up to date, then builds the site and fails on a dead link. The tests check that every page has its type and its French twin, that no internal word slipped in, that every example marker points at a real value, and that the quickstarts still run as written.Terminalshnpm run docs:build npx vitest run tests/docs-site.test.ts tests/docs-snippets.test.ts node docs-site/scripts/audit.mjsThe last command scores every page against the checklist above (outcome first, a block to copy, real output, a next step, French, one word per thing) and prints what each page misses. Run every command your page tells a reader to run, the way they would, in a temporary folder.
Then open the pull request as for any change: Your first pull request. A docs change needs the evidence too: the checks above, and a screenshot of the page in light and dark mode if you changed how it looks.