Expand description
cargo xtask ci install-doc-tools — install mdBook, mdbook-epub,
mdbook-mermaid, mdbook-i18n-helpers, and optionally Zola into ~/.cache/ with version pinning.
This task is the Rust replacement for the bash install script that previously
lived in .github/actions/install-doc-tools/action.yml. It is designed to
run after actions/cache has restored any previously cached binaries, so it
only downloads and builds what is missing or stale.
§Cache layout
| Tool | Cache directory | Staleness marker |
|---|---|---|
| mdBook | ~/.cache/mdbook/ | binary presence |
| mdbook-epub | ~/.cache/mdbook-epub/ | ~/.cache/mdbook-epub/.rev |
| mdbook-mermaid | ~/.cache/mdbook-mermaid/ | ~/.cache/mdbook-mermaid/.version |
| mdbook-i18n-helpers | ~/.cache/mdbook-i18n-helpers/ | ~/.cache/mdbook-i18n-helpers/.version |
| Zola | ~/.cache/zola/ | binary presence |
§PATH update
After installation, ~/.local/bin is appended to the file pointed to by
$GITHUB_PATH. This makes all four tools available to subsequent GitHub
Actions steps without any additional shell configuration.
Structs§
- Install
DocTools Args - Arguments for
cargo xtask ci install-doc-tools.
Functions§
- append_
to_ 🔒github_ path - Appends
pathto the file referenced by$GITHUB_PATH. - home_
dir 🔒 - Returns the user’s home directory.
- install_
mdbook 🔒 - Downloads and extracts the mdBook binary if not already cached.
- install_
mdbook_ 🔒epub - Builds and installs mdbook-epub from source if the cached revision is stale.
- install_
mdbook_ 🔒i18n_ helpers - Installs mdbook-i18n-helpers via
cargo installif the cached version is stale. - install_
mdbook_ 🔒mermaid - Installs mdbook-mermaid via
cargo installif the cached version is stale. - install_
zola 🔒 - Downloads and extracts the Zola binary if not already cached.
- is_
current 🔒 - Returns
trueifbinexists andmarkercontainsexpected. - mdbook_
arch 🔒 - Returns the platform-specific architecture string used in mdBook release URLs.
- run
- Installs doc tools and appends
~/.local/binto$GITHUB_PATH. - symlink_
bin 🔒 - Creates a symlink at
linkpointing totarget, replacing any existing file or symlink.