Expand description
cargo xtask docs β build the full documentation portal.
- Installs mdbook-mermaid JavaScript assets into
docs/. - Builds the mdBook user guide (
docs/book/html/). - Builds translated mdBook books for each locale found in
docs/po/. - Generates Rust API documentation (
target/doc/). - Optionally injects the git version string into the generated HTML.
- Writes
locales.jsonwith available locales. - Creates symlinks so Zola can find the mdBook and cargo-doc outputs.
- Builds the Zola documentation portal (
docs-portal/public/).
Β§Output
The final portal is written to docs-portal/public/ and is ready to be
deployed to Cloudflare Pages or GitHub Pages.
StructsΒ§
- Cargo
Metadata π - Cargo
Package π - Docs
Args - Arguments for
cargo xtask docs. - Locale
Entry π - Represents a locale entry in the locales.json file.
FunctionsΒ§
- build_
cargo_ πdoc - Generates Rust API documentation for all workspace crates.
- build_
mdbook π - Builds the mdBook user guide.
- build_
translated_ πbooks - Builds translated mdBook books for each locale found in
docs/po/. - build_
zola π - Builds the Zola documentation portal.
- cargo_
metadata π - Runs
cargo metadataand returns the parsed result. - create_
portal_ πsymlinks - Creates symlinks in
docs-portal/static/so Zola can serve the mdBook and cargo-doc outputs as static assets. - extract_
lang_ πname - Extracts the display name from the PO file header.
- inject_
git_ πversion - Injects the git version string into the generated Rust documentation HTML.
- install_
mermaid_ πassets - Installs the Mermaid JavaScript assets required by mdbook-mermaid.
- read_
git_ πversion - Returns the git version string (
git describe --tags --always --dirty). - read_
workspace_ πversion - Reads the workspace version from the
cadmuscrateβsCargo.toml. - replace_
version_ πin_ html - Walks
doc_dirrecursively and replacesworkspace_versionwithgit_versionin every HTML file that contains the version span. - run
- Builds the full documentation portal.
- symlink_
force π - write_
locales_ πjson - Writes
docs/book/html/locales.jsonwith available locales and their display names.