Skip to content

Documentation site development ​

The site uses a custom VitePress theme. Content comes from maintained Markdown, structured landing-page data, and pages synced / generated during builds. Check the source before editing and synchronize Chinese and English.

Before Editing ​

  1. Home / landing page → edit .vitepress/data/*.ts
  2. quick-start / changelog → edit the root README / CHANGELOG
  3. Submodule-synced pages → edit the submodule source repo, then bump the pointer in the parent
  4. repowiki → edit the tracked Markdown directly
  5. Other maintained pages → edit the corresponding Chinese and English files

Local preview and builds ​

bash
cd docs
npm ci
npm run docs:dev

# Build and preview the production output
npm run docs:build
npm run docs:preview

docs:dev listens on http://localhost:3030. Both docs:dev and docs:build run sync, fetch-issues, and swagger-to-md before VitePress. Use docs:preview for built output; avoid running the dev server during a production build, which makes its watcher process large changes under .vitepress/dist.

Content sources ​

Page / fileSourceWhere to edit
index.md / en/index.mdCustom landing.vitepress/data/*.ts, .vitepress/theme/components/landing/*.vue
faq.md / architecture*.md / clients.md / repowiki/**Maintained MarkdownCorresponding Chinese and English files
quick-start.md / en/quick-start.mdSyncedRoot README.md / README.en.md
changelog.mdSyncedRoot CHANGELOG.md
NOTICE.md / PRIVACY.md / TERMS.md and English variantsSyncedCorresponding root statements
player/** / en/player/** / player-lynx/** / en/player-lynx/**Synced from client submodulesFlutter's docs/cn and docs/en, and the public Lynx guides. See the mappings in sync-docs.mjs
addon/** / plugin-toolchain/**Synced from submodulesSources listed in sync-docs.mjs
swagger.json / swagger.yaml / docs.goGenerated by swag, trackedHandler annotations + make swagger
swagger-api/**Generated during builds, ignoreddocs/swagger.json → scripts/swagger-to-md.mjs
issues/**Generated from GitHub, ignoredIssues labeled 文档

Landing index.md only mounts <Landing />. Installation options live in downloads.ts, features in features.ts, and shared copy in landing-i18n.ts. Keep each {zh,en} pair synchronized.

repowiki is tracked, maintained Markdown with no regeneration script in this repository. Edit relevant pages when code changes; it differs from the ignored Swagger API pages.

Edit submodule documentation in its source repository, then update the parent pointer. The to: target paths in sync-docs.mjs are deliberately decoupled from source paths (e.g. integrations/home-assistant/README.md → docs/addon/index.md), because public URLs such as /addon/ are already in the sitemap and must not follow source-repo renames. The sync script only warns when a submodule is absent, so pages silently disappear; the initialization list in .github/workflows/static.yml must include them.

Sync and generation scripts ​

  • scripts/sync-docs.mjs syncs root and submodule documents and rewrites relative links. Public target URLs can differ from source paths.
  • scripts/fetch-issues.mjs reads GitHub issues. Without VITE_GITHUB_ISSUES_TOKEN, it clears previous generated pages and skips fetching.
  • scripts/swagger-to-md.mjs converts tracked Swagger JSON to ignored API Markdown. Add handler annotations and run make swagger before documenting new endpoints.

These steps must run before VitePress scans pages. Check docs/.gitignore for exact boundaries; some generated files are tracked.