Module install_doc_tools

Module install_doc_tools 

Source
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

ToolCache directoryStaleness 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§

InstallDocToolsArgs
Arguments for cargo xtask ci install-doc-tools.

Functions§

append_to_github_path 🔒
Appends path to 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 install if the cached version is stale.
install_mdbook_mermaid 🔒
Installs mdbook-mermaid via cargo install if the cached version is stale.
install_zola 🔒
Downloads and extracts the Zola binary if not already cached.
is_current 🔒
Returns true if bin exists and marker contains expected.
mdbook_arch 🔒
Returns the platform-specific architecture string used in mdBook release URLs.
run
Installs doc tools and appends ~/.local/bin to $GITHUB_PATH.
symlink_bin 🔒
Creates a symlink at link pointing to target, replacing any existing file or symlink.