From 7f9102ed0c8a7631e12b7b1d65daf49dc800de4f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 22 Mar 2026 09:13:57 +0100 Subject: [PATCH] Replace manpage build with multi-language mdbook docs in CI - Remove manpage generation step and man2html dependency - Add mdbook theme patching for language selector and utility links - Repack tldr zip with pages/ prefix (uudoc expects this structure) - Build translated docs via build-docs-l10n.sh for 18 languages - Collect translated docs to /coreutils/docs-{lang}/ --- .github/workflows/website.yml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f912282d0..43a706e0c 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -48,7 +48,7 @@ jobs: - name: Install system deps run: | - sudo apt install libacl1-dev libselinux1-dev libsystemd-dev man2html + sudo apt install libacl1-dev libselinux1-dev libsystemd-dev - name: Install necessary tools (mdbook and mdbook-toc) uses: taiki-e/install-action@v2 @@ -66,19 +66,30 @@ jobs: done cp -r coreutils-l10n/src/uucore/* coreutils/src/uucore/ 2>/dev/null || true + - name: Patch mdbook theme with language selector + run: | + uutils.github.io/scripts/patch-mdbook-theme.sh coreutils/docs + - name: Build Coreutils Docs run: | cd coreutils - curl -sfL https://github.com/tldr-pages/tldr/releases/download/v2.3/tldr-pages.zip -o docs/tldr.zip || true + # Download and repack tldr zip: uudoc expects pages/common/ prefix + curl -sfL https://github.com/tldr-pages/tldr/releases/download/v2.3/tldr-pages.zip -o /tmp/tldr-raw.zip || true + if [ -f /tmp/tldr-raw.zip ]; then + mkdir -p /tmp/tldr-repack/pages + cd /tmp/tldr-repack && unzip -o /tmp/tldr-raw.zip -d pages/ > /dev/null + zip -r "$OLDPWD/docs/tldr.zip" pages/ > /dev/null + cd "$OLDPWD" + fi cargo run --bin uudoc --all-features cd docs # Remove deprecated 'multilingual' field unsupported by newer mdbook sed -i '/^multilingual/d' book.toml mdbook build - - name: Build Coreutils Manpages (all languages) + - name: Build Coreutils Docs (translations) run: | - uutils.github.io/scripts/build-all-manpages.sh coreutils manpages-html uutils.github.io/templates + uutils.github.io/scripts/build-docs-l10n.sh coreutils - name: Build Findutils Docs run: | @@ -98,15 +109,11 @@ jobs: cp -r uutils.github.io/public public cp -r coreutils/docs/book public/coreutils/docs cp -r findutils/docs/book public/findutils/docs - # Copy English manpages to /coreutils/manpages/ - mkdir -p public/coreutils/manpages - cp -r manpages-html/en/* public/coreutils/manpages/ - # Copy translated manpages to /coreutils/manpages-{lang}/ - for lang_dir in manpages-html/*/; do - lang=$(basename "$lang_dir") - [ "$lang" = "en" ] && continue - mkdir -p "public/coreutils/manpages-${lang}" - cp -r "${lang_dir}"* "public/coreutils/manpages-${lang}/" + # Copy translated docs to /coreutils/docs-{lang}/ + for lang_dir in coreutils/docs/book-*/; do + [ -d "$lang_dir" ] || continue + lang=$(basename "$lang_dir" | sed 's/^book-//') + cp -r "$lang_dir" "public/coreutils/docs-${lang}" done - name: Upload artifact for checking the output