Files
Max Isbey 6d3a840779 Add tooling and build support for translated docs sites
A manually-run tool under scripts/docs/i18n translates prose pages and
navigation labels into the languages registered in i18n/languages.yml,
guided by per-language instruction files and glossaries, with structural
and meaning checks before anything is written. The docs build stages each
language into its own site under /<code>/ (English pages overlaid with the
available translations plus status banners) with translated navigation and
a language switcher. Human-authored inputs and generated output both live
under i18n/; docs/translations.md explains the model to readers.
2026-07-31 17:47:22 +00:00

24 lines
901 B
Bash
Executable File

#!/usr/bin/env bash
#
# Serve the v2 documentation locally with live reload (the English site only).
#
# Regenerates the API reference and the concrete Zensical config, then serves
# it. Re-run the script to pick up changes to `src/` (the API reference) or the
# nav; edits to prose pages under `docs/` are picked up by live reload.
#
# Only the English site is built here, so the language switcher is limited to
# English (`--switcher-languages ""`): the translated sites under /<code>/ are
# never made locally, and offering them would only link to 404s.
#
# Usage:
# scripts/serve-docs.sh [<extra zensical serve args>...]
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cd "$REPO_ROOT"
uv run --frozen python scripts/docs/build_config.py --switcher-languages ""
exec uv run --frozen zensical serve -f mkdocs.gen.yml "$@"