Module docs

Module docs 

Source
Expand description

cargo xtask docs β€” build the full documentation portal.

  1. Installs mdbook-mermaid JavaScript assets into docs/.
  2. Builds the mdBook user guide (docs/book/html/).
  3. Builds translated mdBook books for each locale found in docs/po/.
  4. Generates Rust API documentation (target/doc/).
  5. Optionally injects the git version string into the generated HTML.
  6. Writes locales.json with available locales.
  7. Creates symlinks so Zola can find the mdBook and cargo-doc outputs.
  8. 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Β§

CargoMetadata πŸ”’
CargoPackage πŸ”’
DocsArgs
Arguments for cargo xtask docs.
LocaleEntry πŸ”’
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 metadata and 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 cadmus crate’s Cargo.toml.
replace_version_in_html πŸ”’
Walks doc_dir recursively and replaces workspace_version with git_version in every HTML file that contains the version span.
run
Builds the full documentation portal.
symlink_force πŸ”’
write_locales_json πŸ”’
Writes docs/book/html/locales.json with available locales and their display names.