Editing these docs
The docs site lives in wiki/ and is built with VitePress. Pages and images are in wiki/content. The code that builds the site is in wiki/website. The sidebar and the sections are set in wiki/website/.vitepress/navigation.ts.
Run it locally
VitePress is a dev dependency of the package, so the root install is enough.
npm install
npm run docs:devnpm run docs:buildbuilds the site and fails on a dead internal link or anchor.npm run docs:previewserves the built site.npm run docs:checkfinds missing and unused images, and raw sizes in the theme.
The site is served from /docs/, so local pages open at http://localhost:5173/docs/.
Where files go
- User pages are in
wiki/content/guide, with one folder for each sidebar group named after it. - Contributor pages are in
wiki/content/contributing, with one folder for each sidebar group named after it. The pages above the groups stay at the top level. Add every new page to the sidebar inwiki/website/.vitepress/navigation.ts. - The introduction is
wiki/content/guide/index.md. The build serves it as the home page at/docs/. - Images are in
wiki/content/assets. Reference them with a relative path from the page, for example../../assets/name.pngfrom a page inside a guide folder. Every image must be used by a page, and the check fails on an unused one. - PNG images render at half their width, so capture them at twice the display size.
- Name a page file after its sidebar title, in lowercase with dashes, and start it with a number. For example,
guide/send-requests/02-schema-and-auto-fill.md. - The number follows the sidebar order within the folder. The URL leaves it out, so the page opens at
/guide/send-requests/schema-and-auto-fill. Sectionindex.mdfiles have no number.
Upgrade guide and release version
- The upgrade guide is
wiki/content/guide/02-upgrade-guide.md. Add a version note there for every breaking change. - The release notes page links to
CHANGELOG.md, which release-please writes. - The header shows the version set in
wiki/website/.vitepress/config.mts. release-please updates it with every release, so do not edit it.
Deployment
The docs are built and deployed with the demo site. A release triggers the nimbus-dev deploy, which builds the docs from the tag that is installed and serves them under /docs/. It builds them from the base branch when that tag has no docs site. The build output is wiki/website/dist. Page addresses have no .html ending, so the server must try the .html file for a path.
To publish docs changes without a release, run the nimbus-dev deploy workflow by hand and turn on docs_from_base. It builds the docs from the base branch.
Search
The wiki searches in the browser until Algolia is set up. To use Algolia, copy wiki/website/.env.example to wiki/website/.env and fill in the values. The site only receives the search key.
Run npm run docs:sync-search to update the index after the wiki changes. It builds the records from the pages and replaces the index with them. It needs a write key with the addObject, editSettings and deleteIndex permissions on the index and on its _tmp copy. Keep that key out of the repository.
The deploy syncs the index after the site is live. It reads the app ID, the search key and the index name from the variables of the production environment in the nimbus-dev repository. It reads the write key from the ALGOLIA_WRITE_KEY secret of the same environment.
The empty search window suggests a few pages. Edit the list in theme/components/SearchDiscover.vue.
Screenshots
After a UI change, refresh the affected screenshots with the update doc screenshots skill. It drives the workbench with Playwright and can refresh one feature or all of them. Open every new image and check it before you commit. The record demo video skill does the same for the GIF in the main README.
Theme
The theme extends the VitePress default theme in wiki/website/.vitepress/theme. It reads the design tokens of the app from resources/css/structure.css and resources/css/themes/base.css, so the docs follow the app when a token changes.
- The root block of
style.cssmaps VitePress to Nimbus tokens and defines the--wiki-*variables. It is the only place for a raw size. - Every other rule must use a Nimbus token or a wiki variable.
npm run docs:checkenforces this. layout.cssstyles the frame, andcontent.cssstyles the page content.- Icons come from Hugeicons. Add a name to
wiki/website/.vitepress/icons.tsand use it through its--icon-*variable.
Steps
Wrap a numbered list in <Steps> for a procedure. Keep an empty line after the opening tag and before the closing tag. Indent code blocks and images by three spaces, so they stay inside their step.
<Steps>
1. Open the **Body** tab.
2. Send the request.
</Steps>Flow diagrams
Use <Flow label="name"> for a diagram that reads from top to bottom. Each <FlowStep> is a box with a title, an optional code and an optional note. Wrap steps in <FlowBranch label="text"> to place them side by side, and add ordered to stack paths that are tried in order. Do not leave empty lines inside a flow. The text inside a flow is plain, so Markdown does not render there.
Walkthrough video
Use <Walkthrough video="id"> with the YouTube id of a video. Put a <video> element with a looping demo inside it, with no empty lines. The demo on the introduction page is demo.webm, demo.mp4 and demo-poster.webp in wiki/content/assets.
Writing rules
- Use short plain sentences. One idea per sentence.
- Write each sentence on one line. Break lines only after a period or a comma when a line must wrap.
- Do not use em dashes, hype words, metaphors or idioms.
- One task per page. Put a short description in the frontmatter. Start the body with the page title as the only first level heading, then a short intro.
- Name things the way the code and the UI name them.
- Do not mention pull request numbers or issue numbers.
- Use absolute site paths for links between pages, for example
/contributing/setup. The build adds the/docsprefix. - Use
::: info,::: tip,::: warningand::: dangerfor callouts. - Keep a standards page short. State the rules a contributor must know, then link to the skill that holds the detail. Do not copy the skill.
When to update the docs
Update the user guide for a user facing change. Update this guide for a change to the architecture, a flow or the setup. See commits and pull requests.