Aggregation and Reference Pipeline
This site is assembled from generated content plus authored pages.
Inputs
- Repository metadata in
data/repos.json - Authored site pages under
docs/:index.md,architecture/,guides/, andrepos/index.md - Pinned schema versions in
schemas/anolis-version.json - Generator scripts under
scripts/
Schema Injection
scripts/inject-schemas.mjs fetches pinned release artifacts from anolishq/anolis and writes them to docs/public/schemas/anolis/ so VitePress serves them directly.
These injected files are used both as published static assets and as inputs to reference generation.
Repo Docs Aggregation
scripts/aggregate.mjs does the following:
- Clones each repo from
data/repos.jsoninto.tmp/<repo> - Copies docs from
<repo>/<docsPath>intodocs/repos/<repo> - Excludes known tooling artifacts such as
Doxyfile - Generates a fallback
index.mdwhen noindex.mdorREADME.mdexists
The static docs/repos/index.md is preserved between runs.
Only <docsPath> is copied, and VitePress runs with ignoreDeadLinks: false. A relative link in a repo's docs that leaves <docsPath>, such as ../schemas/README.md, resolves in that repo but points nowhere once aggregated, and the site build fails. A doc that references a file outside its docs/ must link to it as an absolute GitHub URL: https://github.com/anolishq/<repo>/blob/main/<path>.
The source repo's own docs check builds its docs in isolation, where the relative link resolves, so green CI there does not mean this site builds. To confirm a fix, re-run a PR build here, which clones every repo fresh.
Reference Generation
scripts/generate-reference.mjs clears docs/reference/ and writes every page into it. Its inputs are pinned in schemas/anolis-version.json: anolis_version for the runtime release and anolis_protocol_version for the protocol tag.
It writes four pages:
runtime-http-api.md: the runtime HTTP API, built from the OpenAPI file thatinject-schemas.mjsdownloaded from theanolis_versionrelease. It does not cloneanolis.adpp-protocol.md: the ADPP protocol reference, built from the.protofiles underproto/anolis/deviceprovider/v1inanolis-protocol, cloned at theanolis_protocol_versiontag.schemas.md: the injected JSON Schemas and the URL of the published OpenAPI file.index.md: a table linking the other pages, and the two pins.
A repo in data/repos.json gets a reference page only if it has a non-empty specPath, and its name picks which page. Today those are anolis and anolis-protocol. For anolis the specPath only turns the page on: nothing is read from it, because the page is built from the injected OpenAPI file. For anolis-protocol the .proto files are read from under its specPath. Any other repo given a specPath gets a generic page listing the files under that path, cloned from its default branch rather than a pinned tag.
The generator reads the injected files and exits with an error when the OpenAPI file is missing, so inject-schemas.mjs must run first. pnpm build runs them in that order.
Full Build Flow
pnpm build runs:
node scripts/inject-schemas.mjsnode scripts/aggregate.mjsnode scripts/generate-reference.mjsnode scripts/fetch-metrics.mjs: fetchesmetrics.jsonfrom each repo's latest release intodocs/public/metrics/node scripts/generate-metrics.mjs: generatesdocs/metrics.mdfrom the fetched metricsvitepress build docs
CI runs pnpm build on every pull request to main. The deploy workflow runs it on every push to main and publishes docs/.vitepress/dist/ to GitHub Pages. On a pull-request build, a release or metrics.json that fetch-metrics.mjs cannot fetch is skipped with a warning; on main it fails the build.
Output Directories
docs/public/schemas/anolis/: injected pinned schema artifactsdocs/repos/: generated from source repositoriesdocs/reference/: generated reference contentdocs/public/metrics/anddocs/metrics.md: fetched metrics and the generated metrics pagedocs/.vitepress/dist/: static site output
Temporary clones are written to .tmp/ and should not be committed.
