Contributing Docs
This page explains where to put docs and what your changes do in the site UI.
Run docs commands from the monorepo root (the folder that contains package.json).
Where to write docs
Keep docs beside the code they describe:
- Plugin docs:
plugins/<plugin-slug>/docs/ - Theme docs:
themes/<theme-slug>/docs/
Every package with docs uses the same audience split:
index.md(required): short landing page that links to both audience pagesuser-docs.md: the landing page for content authors and site editorsdeveloper-docs.md: the landing page for developers
New plugins and themes should follow this layout from the start.
Put topic pages under user/ or developer/. User topics appear directly under the package in the sidebar; developer topics are grouped beneath a collapsed Developer Docs entry. Nested folders are supported and become collapsible groups. Link to the topic pages from the matching audience landing page. Keep images and other assets outside these topic folders.
Example:
plugins/example-plugin/
docs/
index.md
user-docs.md
user/
getting-started.md
configuration.md
developer-docs.md
developer/
local-development.md
testing.mdWhat changes appear where
- Add
docs/index.mdin a plugin or theme -> package appears in the left sidebar underPluginsorThemes. - Add
user-docs.mdanddeveloper-docs.md-> user topics appear directly under the package, andDeveloper Docsappears as a collapsed group. - Add markdown files under
user/-> topic links appear directly under the package. - Add markdown files under
developer/-> topic links appear beneathDeveloper Docs. - Add markdown files elsewhere -> they get page routes but no sidebar entry. Link to them from an audience landing page.
- Add a heading like
## Setupin a page -> appears in the right-side "On this page" links asSetup. - Rename a heading -> right-side "On this page" link text also changes.
- Remove a heading -> its right-side link disappears.
Note: only headings in page content (##, ###, etc.) create "On this page" links. A normal bold line is not a heading.
Do not edit generated docs
docs/content/ is generated output. Do not edit files there directly because they are replaced during sync.
How docs:sync works
pnpm docs:sync runs tools/sync-docs.mjs.
It:
- deletes
docs/content/(generated output) - recreates
docs/content/ - copies package docs from:
plugins/<slug>/docs/**->docs/content/plugins/<slug>/themes/<slug>/docs/**->docs/content/themes/<slug>/
Why this exists:
- The VitePress-based site builds from
docs/ - package docs are owned inside package folders
- sync combines both into one build input
Safe workflow (step-by-step)
- Edit docs only in
plugins/.../docsorthemes/.../docs - Start docs:
pnpm docs:dev(runs sync once on start, then re-runs sync whenplugins/**/docs/**,themes/**/docs/**, ortools/sync-docs.mjschanges) - Check your package in the left sidebar shows user topics at package level and developer topics under
Developer Docs - Open your page and check right-side "On this page" links
- Commit source docs only (not generated
docs/content)