Docs Architecture
Single source pipeline for static docs, grammar artefacts, and SEO/security outputs.
Pipeline (exact)
tools/build_docs_site.pytools/build_grammar_extras.pytools/sync_ebnf_memory_pages.pytools/build_static_extras.py
Sources
docs/*.html(EN root editable pages)src/vitte/grammar/vitte.ebnf(source of truth)docs/css/*,docs/js/*
Example
Edit the HTML page directly in docs/ to update the site. The build pipeline then injects canonical metadata, refreshes the SEO metadata, and updates the search index automatically.
Generated outputs
docs/search-index*.jsondocs/sitemap.xml,docs/robots.txtdocs/build-manifest.json,docs/status.jsondocs/grammar/rules*.json,docs/grammar/grammar.sha256
Assets policy
- Local docs assets (
docs/css/*,docs/js/*) must not carryintegrity=orcrossorigin=attributes. - Enforced by
tools/docs/check_assets_policy.pyand CIdocs-quality. - Automatic cleanup tool:
tools/docs/refresh_assets_policy.py.
Refresh and cache policy
- Development auto-refresh is built into
docs/js/main.js. - Enable it by opening any page with
?dev-refresh=1&refresh=5to reload every 5 seconds. - While dev auto-refresh is enabled, the docs service worker is unregistered to avoid stale local cache during editing.
- Production cache headers for static hosting live in
docs/_headers: HTML, CSS, JS, search indexes, and SVGs are all forced to revalidate so the site does not stay pinned to stale browser cache. docs/_headersis honored by hosts such as Netlify, Cloudflare Pages, and many custom static servers; GitHub Pages may ignore it, so query-versioned assets still matter there.
Editable vs generated
| Editable | Generated |
|---|---|
docs/*.html, docs/css/*, docs/js/*, src/vitte/grammar/vitte.ebnf |
search-index*.json, sitemap.xml, build-manifest.json, checksums.txt, *.sha256 |
Ownership map
| Artifact | Updater |
|---|---|
| Header/footer/nav + core search index | tools/build_docs_site.py |
| Grammar toolbox/diff/status/rules API | tools/build_grammar_extras.py |
| EBNF memory pages + checksum | tools/sync_ebnf_memory_pages.py |
| SEO/CSP/checksums/health/static extras + asset policy cleanup | tools/build_static_extras.py |
| Doctor checks and fix suggestions | tools/docs_doctor.py |
| No-SRI policy gate for local assets | tools/docs/check_assets_policy.py |