docs(site): migrate doc site to VitePress with guides and bespoke landing#4
Merged
docs(site): migrate doc site to VitePress with guides and bespoke landing#4
Conversation
…ding - Replace the raw TypeDoc HTML + standalone index.html setup with a VitePress build that orchestrates: a bespoke landing kept in docs/public/index.html (served verbatim at /), 5 user-facing guides under docs/guides/ (quickstart, extract, detached, security, gvisor-kata), and a markdown API reference under docs/api/ generated by typedoc-plugin-markdown. - Add devDeps: vitepress 1.6.4 and typedoc-plugin-markdown 4.11.0. No runtime deps changed (still tar + dockerode). - Restructure npm scripts: docs = docs:typedoc + docs:build (full pipeline), docs:typedoc regenerates the markdown API ref, docs:build runs vitepress build, docs:dev serves locally with live reload. The pre-commit hook now calls docs:typedoc only (faster, no dist artefact churn) so the API reference still auto-syncs when src/ is staged. - Add .github/workflows/docs.yml that rebuilds and deploys to GitHub Pages on every push to main touching docs/, src/, package.json, or typedoc.json. Concurrency-guarded, uses actions/upload-pages-artifact + actions/deploy-pages. - Move docs/banner.webp -> docs/public/banner.webp (still referenced by README, path updated). Add docs/.vitepress/cache and dist to .gitignore. - One-time manual step required: flip GitHub Pages source from "Branch / docs folder" to "GitHub Actions" in repo settings before the next push to main, otherwise the workflow runs but does not publish. build with cc
- Bespoke landing port refactored: HTML body now lives in docs/index.md (was docs/public/index.html); 600+ lines of inline CSS extracted to docs/.vitepress/theme/landing.css with .bespoke-landing scope so .hero / .prim / etc. only apply on the landing route. Removed the duplicate inline <script>; the copy-button + GitHub-version listeners are wired from a single <script setup> + onMounted hook so SSR has no document/window references.
- Custom VitePress theme (docs/.vitepress/theme/custom.css) maps the laboratory palette onto every guide and API page: ink/paper/halo tokens, Fraunces italic h1/h2 with `// ` mono prefix, IBM Plex body, JetBrains Mono labels in nav/sidebar/aside/footer, code blocks with the macOS-style traffic-light bar from the landing, blockquotes in serif italic, table headers in mono uppercase, persistent fixed-position grid + noise background composited on the GPU.
- Reduced-motion fallback added in landing.css so users with prefers-reduced-motion: reduce see the hero elements (eyebrow, h1, lede, meta, banner) at opacity:1 immediately - the animation suppression in custom.css would otherwise leave them invisible.
- API sidebar enumerated by hand from the typedoc-plugin-markdown output: Overview, Classes, Interfaces, Functions, Type aliases. Each section collapsed:false so the tree is fully visible. Adding a new public export now requires adding the matching entry; comment in config.ts flags the maintenance.
- appearance: 'force-dark' on the site - the bespoke landing has no light variant, the toggle is gone, html.dark always applies.
- Tightened API page rhythm: h3 size 18-21px (was 20-24px), code block margins 12px/18px (was 22px each side), `Defined in: src/...:NN` rendered as 11px mono caption via p:has(> a[href*="src/"]), hr at 6px margin instead of 18px.
- Dividers (hr) restyled as a fading cyan filament with subtle glow - reads as a laboratory readout rather than a generic gray rule.
- Background grid lines and noise opacity dropped (rgba(255,255,255,0.018) for grid, 0.025 for noise) and grid spacing widened to 96px so the texture stays atmospheric instead of competing with content.
- Ecosystem cards now show live per-repo release status via data-eco-status / data-gh-repo. Single fetch per unique repo (Set + Promise.all + Map dispatch) so light-runner is queried once even though the header em + hero eyebrow + this-card all consume it. Repos without a published release fall back to data-fallback ("In development"); released repos show "Stable - vX.Y.Z" or "Pre-release - vX.Y.Z".
- Fixed the dev-mode 404 root cause: VitePress did not auto-serve docs/public/index.html when there was no docs/index.md, so the dev server returned a directory listing. Replacing the public file with a real markdown route fixes both dev and build.
build with cc
Resolves conflicts with the v0.10.1 hotfix landed on main while this branch was open: - package.json: keep main's v0.10.1 + recursive files glob (`dist/**/*.js`), layer the branch's vitepress / typedoc-plugin-markdown devDeps and the docs:typedoc / docs:dev / docs:build scripts on top. - package-lock.json: auto-merged, then will be reconciled on next install. - docs/api/*.html: main regenerated the legacy HTML output; the branch ships markdown via typedoc-plugin-markdown. Deleted the HTML side so only the .md tree survives. - typedoc.json: keep the branch's markdown plugin config. build with cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/public/index.htmland is served verbatim at/. VitePress takes over/guides/*and/api/*with its standard chrome (sidebar, dark mode, local search, edit-this-page links, last-updated stamps).docs/guides/:quickstart(recap of the README quick start),extract(folder-vs-file semantics, traversal rules, 1 GiB cap, common patterns),detached(run + attach + state files + cross-host resume + reaping + gotchas),security(threat model, defaults, what is and is not covered, hardening recipes),gvisor-kata(when to use a stronger runtime, install steps for runsc on Linux/WSL2, Kata caveat).typedoc-plugin-markdown@4.11.0. The API reference is regenerated underdocs/api/*.mdand consumed by VitePress as regular markdown routes.entryFileName: "index"so/api/resolves cleanly..github/workflows/docs.ymlthat rebuilds and deploys to GitHub Pages on every push to main touching docs/, src/, or relevant config files. Usesactions/upload-pages-artifact+actions/deploy-pageswith concurrency-guarded deploys.docs:typedocregenerates the markdown API ref (fast, ~1s),docs:buildrunsvitepress build(~8s),docschains both,docs:devserves locally with live reload. The pre-commit hook now callsdocs:typedoconly (no dist artefact churn) so the API reference still auto-syncs whensrc/is staged.vitepress@1.6.4,typedoc-plugin-markdown@4.11.0. No runtime deps changed (still tar + dockerode).One-time manual step required
After merge, in repo Settings -> Pages, flip the source from "Branch / docs folder" to "GitHub Actions". The workflow runs but cannot publish without that. I cannot toggle this via API.
Test plan
npm run docs:buildcompletes locally in 7.6s, no dead links, no warnings beyond TypeDoc's existing one about the privateLightRunnerErrorOptionsinterfacedocs/.vitepress/dist/index.htmlserves the bespoke landing verbatim (CSS + noise + grid intact)docs/.vitepress/dist/guides/*pages render with VitePress chrome (sidebar, search, dark mode toggle)docs/.vitepress/dist/api/index.htmlserves the TypeDoc-generated markdown rendered through VitePressdocs/api/only (no full VitePress build) whensrc/is stageddocs/.vitepress/cache/anddocs/.vitepress/dist/gitignoredNotes
docs/public/to integrate with VitePress' static asset pipeline. The README image link was bumped todocs/public/banner.webp.git revert <squash-sha>,npm uninstall -D vitepress typedoc-plugin-markdown, restore the oldtypedoc.jsonand the workflow.src/will trigger both the pre-commit hook (auto-stages docs/api markdown) and the docs.yml workflow on push (rebuilds + redeploys). No manual intervention needed.build with cc