Maintain the documentation
Preview, verify, and publish the Starlight handbook and API reference.
Markdown files under docs/ are the source for the Akari handbook, while docs/site/ owns the Astro/Starlight configuration, styles, and build scripts.
Directory layout & locales
| Directory | Published to site? | Purpose |
|---|---|---|
getting-started/ | Yes | Toolchain setup and first successful run |
guides/ | Yes | Task-oriented workflows for themes, displays, and testing |
reference/ | Yes | CLI options, JSON schemas, D-Bus specs, and Dart API links |
architecture/ | Yes | Module ownership, runtime boundaries, and code navigation |
internal/ | No (repo only) | In-progress tool documentation (such as Theme Studio notes) |
proposals/ | No (repo only) | Design proposals and hardware validation specs |
Every directory has a Simplified Chinese counterpart under docs/zh-cn/ with matching filenames:
- Astro serves English at the site root (
/Akari/) and Simplified Chinese under/Akari/zh-cn/(zh-CN). - Use relative
.mdlinks in Markdown so links work both in GitHub and in localized site routes. - Generated Dart API docs under
docs/site/public/api/are shared across locales.
Preview and verify locally
Requires Node.js >= 22.12, Python 3, and the repository’s FVM Flutter/Dart toolchain.
cd docs/site
npm ci
npm run dev
To build the Dart API reference, compile the static site, and run link/fragment verification:
npm run api
npm run check
npm run build
npm run verify
npm run preview
npm run check: Validates Astro configuration and component types.npm run verify: Checks all local links, assets, anchor fragments, API entrypoints, and ensuresinternal/andproposals/(includingzh-cn/internal/andzh-cn/proposals/) are excluded from the published bundle.
Generated directories (docs/site/dist/, docs/site/public/api/, and docs/site/node_modules/) are git-ignored and must never be committed.
Add or update a page
- Create or edit the English Markdown file with
titleanddescriptionfrontmatter. - Add or update the corresponding Simplified Chinese page under
docs/zh-cn/. - If adding a new published page, register its slug and
translations: { 'zh-CN': '...' }label indocs/site/astro.config.mjs. - When changing a public Dart API contract, update its
///doc comment and relevant guide in the same commit. Always import package entrypoints (package:theme_sdk/theme_sdk.dart) in examples rather thanlib/src/.
GitHub Pages deployment
The handbook is published to https://anfsity.github.io/Akari/ via GitHub Actions (.github/workflows/docs.yml):
- Triggers: Automatic runs on
mainpushes or pull requests modifying handbook/API sources, manual Documentation workflow dispatch onmain, or pushing/dispatching on thegh-pagesbranch (which invokes themainworkflow withsource_ref: main). - Pipeline: Builds the Starlight site and
dart docreference, runsnpm run verify, and uploadsdocs/site/dist/directly as a GitHub Pages artifact.