Files
infix/.github/actions/setup-mkdocs/action.yml
T
Joachim Wiberg e412c28c37 webui: bundle on-device User's Guide
Build the mkdocs User's Guide into WebUI images and surface it in the UI.
post-build.sh runs `mkdocs build` from the top-level mkdocs.yml into
/var/www/guide when the webui package is selected and mkdocs is on the
build host; nginx serves it read-only at /guide/.  The build is
best-effort — a missing mkdocs warns and ships without the guide rather
than failing — and minimal images (no webui) skip it.

The WebUI gates a book icon in the topbar and a User Guide item in the
user menu on the docs being present on disk (os.Stat, fail-closed), both
opening /guide/ in a new tab.

CI: a local setup-mkdocs composite action installs mkdocs and the
plugins from mkdocs.yml; the build and release workflows run it before
the build so images produced in CI include the guide.  developers-guide
documents the new build dependency and restores the missing
mkdocs-glightbox plugin.

Fixes #633

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-06-15 19:45:25 +02:00

21 lines
997 B
YAML

name: 'Setup MkDocs'
description: "Install MkDocs and the plugins required to build the Infix User's Guide (post-build.sh bundles it into WebUI images)."
# Mirrors the dependency set in .github/workflows/docs.yml. Kept in-repo
# (rather than an external action) so any checkout of a commit needing
# docs-in-image can reproduce it without an out-of-tree dependency.
runs:
using: composite
steps:
- name: Install MkDocs and plugins
shell: bash
run: |
command -v pipx >/dev/null 2>&1 || python3 -m pip install --user pipx
python3 -m pipx install --force mkdocs
python3 -m pipx inject mkdocs \
mkdocs-material pymdown-extensions mkdocs-callouts mike mkdocs-to-pdf mkdocs-glightbox
# Make the pipx-installed mkdocs visible to later steps (the build,
# where post-build.sh invokes it).
python3 -m pipx environment --value PIPX_BIN_DIR >> "$GITHUB_PATH" 2>/dev/null \
|| echo "$HOME/.local/bin" >> "$GITHUB_PATH"