MaiPai Home
🧱 Build

Write docs and screenshots

How a page declares the code it covers, and how the release-time drift check works.

Declare what a page covers

Every page under content/docs and every key in screenshots.json has an entry in docs/site-fumadocs/docs-covers.json:

"user/everyday-use/use-incognito": { "areas": ["incognito"] }
  • areas names code groups defined once at the top of the file, each a list of globs.
  • covers adds extra globs for one page (for example docs/design/RULES.md).
  • ignore lists globs that never count as a change: tests, locales, docs.
  • baseline is the commit the docs were last verified at, used until a v* tag exists.

Check what changed

bun scripts/docsDrift.ts

It lists the pages to re-check and the pictures to retake since the last release tag. --since <ref> picks another start, --json gives machine output, --check fails if a page or picture has no entry.

Screenshots

Pictures come only from the screenshot script. The drift output prints the DOCS_SHOTS_ONLY=... line that retakes just the affected docs pictures. A picture whose file does not start with docs- comes from the general screenshot run. Open every retaken picture before using it.

Browse every screenshot

bash scripts/gallery.sh

It collects the images in docs/assets, docs/design/assets (with the interactive mockups), docs/site-fumadocs/public/screens, frontend/public/setup-art and frontend/public/chat-art from the latest origin/main, builds one grouped page (filter box, size switch, full-size view with the arrow keys) in data-scratch/gallery, serves it on 127.0.0.1 at a free port and opens it on macOS. A rerun replaces the page and the server.

  • --worktree uses this checkout's files instead of origin/main.
  • --no-open prints the address without opening it.
  • --stop stops the server. The script only ever stops the process it recorded in data-scratch/gallery/server.pid.

The only network use is the git fetch. If it times out, the script retries once through ssh.github.com on port 443.

Kept current by

Keeping the docs current explains the release step. The test scripts/docsDrift.test.ts fails if the map falls out of step with the pages.

On this page