Aggregation and reference pipeline
This site is assembled from generated content plus authored pages.
Inputs
data/repos.json: each source repository, the release tag it is published from (ref), its docs path and, optionally, its spec path. Renovate opens a pull request to bump arefwhen that repository publishes a release.- Authored site pages under
docs/:index.md,get-started/,concepts/,contributing/, andrepos/index.md - Generator scripts under
scripts/
Schema injection
scripts/inject-schemas.mjs fetches the schema artifacts of the anolis release in data/repos.json 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 in
data/repos.jsonat itsrefinto.tmp/<repo> - Copies docs from
<repo>/<docsPath>intodocs/repos/<repo>, skippingDoxyfileand anything listed in<docsPath>/.indexignore - Generates a fallback
index.mdwhen noindex.mdorREADME.mdexists
Each line in .indexignore is a path relative to <docsPath> (TODO.md, rfcs/review.md). A leading **/ matches that name at any depth, and a trailing slash matches directories only. Blank lines and lines starting with # are ignored.
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 the anolis and anolis-protocol refs in data/repos.json.
It writes four pages:
runtime-http-api.md: the runtime HTTP API, built from the OpenAPI file thatinject-schemas.mjsdownloaded from theanolisrelease. It does not cloneanolis.adpp-protocol.md: the ADPP protocol reference, built from the.protofiles underproto/anolis/deviceprovider/v1inanolis-protocol, cloned at itsref.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 at its ref.
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 the release at each repo'srefintodocs/public/metrics/, except for repos marked"metrics": falsenode 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 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.
