Vietnamese Linux kernel documentation snapshot, packaged as a Cloudflare
Worker project and served at
kernel.go-mizu.dev.
- Builds the kernel Sphinx docs from a sibling
kernel-docs-vicheckout, overlaying Vietnamese translations (bothvi_VN/andvi_VN_mt/) onto the upstream tree pinned inkernel-docs-vi/UPSTREAM. dist/is generated (not committed): it exceeds 150 MB after the full Sphinx build. Runnpm run build:staticbefore deploying;npm run deploychains this automatically.- Falls back to
kernel.org/doc/html/latestfor any path that the snapshot does not cover, so the full kernel docs remain reachable at all times.
kernel-worker/
├── dist/ # committed Sphinx output used by preview/deploy
├── scripts/build-static.mjs
├── scripts/preview-local.mjs
├── src/index.ts
├── wrangler.jsonc
└── package.json
scripts/build-static.mjsreads the pinned SHA from../kernel-docs-vi/UPSTREAM, then performs a blobless, shallow, sparse partial clone oftorvalds/linuxlimited toDocumentation/,tools/,scripts/, and the license files.- Vietnamese translations from
../kernel-docs-vi/Documentation/translations/vi_VN/are overlaid on the sparse checkout. - A local Python virtual environment is created and the kernel's own
Documentation/sphinx/requirements.txtis installed into it. sphinx-build -b htmlis run againstDocumentation/and the output is copied todist/.- The Worker serves
dist/as assets and rewrites any absolutewww.kernel.org/doc/html/latest/URLs in HTML so that the site is self-consistent on its own domain. - Paths not present in
dist/are proxied tohttps://www.kernel.org/doc/html/latest/.
- Node 22 recommended.
wrangler logincompleted for the target Cloudflare account.- The
go-mizu.devzone already active in Cloudflare. - A sibling checkout of
tamnd/kernel-docs-viat../kernel-docs-vi, orDOCS_REPO=/path/to/kernel-docs-vi. - Python 3,
python3 -m venvavailable, and enough disk space for the kernel sparse checkout (roughly 150 MB) plus the Sphinx build (another few hundred MB).
git clone https://github.com/tamnd/kernel-worker.git
cd kernel-worker
npm install
npm run previewLocal preview runs at:
http://127.0.0.1:8787
# regenerate dist/ from the sibling kernel-docs-vi repo
npm run build:static
# skip the Sphinx build and emit only a minimal landing page
SKIP_SPHINX=1 npm run build:static
# stable local preview of the committed dist/
npm run preview
# wrangler-based dev entrypoint
npm run dev:wrangler
# rebuild snapshot and deploy
npm run deployThe worker config lives in wrangler.jsonc and is set up for:
- Worker name:
kernel-worker - Custom domain:
kernel.go-mizu.dev - Static asset binding from
./dist
Deploy with:
npm run deploydist/is intentionally not committed: the kernel Sphinx build produces over 150 MB of output, which is impractical for a regular git repository. Rebuild withnpm run build:staticbefore serving locally or deploying.- Local preview uses
scripts/preview-local.mjsbecause it starts faster thanwrangler devand makes the proxy fallback easy to inspect. - Rebuild the snapshot whenever
kernel-docs-visyncs upstream or lands new translations, then commit the updateddist/. - The Vietnamese translation is maintained at
tamnd/kernel-docs-vi. As translation progresses, more pages indist/are served in Vietnamese automatically on the next build.
Project-specific Worker glue in this repo is under MIT. Upstream documentation content originates from the Linux kernel (GPL-2.0 by default, per-file SPDX otherwise) and Vietnamese translations inherit the license of their source files.