From cd301a6932e274229ced4904d87600500a692229 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 10 Jun 2024 23:30:51 +0100 Subject: [PATCH] docs: local docs doc everything but only list workspace crates --- justfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 2ea6031f8..f44236ece 100644 --- a/justfile +++ b/justfile @@ -68,8 +68,17 @@ test-coverage-lcov toolchain="": (test-coverage toolchain) cargo {{ toolchain }} llvm-cov report --doctests --lcov --output-path=lcov.info # Document crates in workspace. -doc *args: - RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --workspace {{ all_crate_features }} {{ args }} +doc *args: && doc-set-workspace-crates + RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --workspace {{ all_crate_features }} {{ args }} + +[private] +doc-set-workspace-crates: + #!/usr/bin/env bash + ( + echo "window.ALL_CRATES =" + cargo metadata --format-version=1 | jq '[.packages[] | select(.source == null) | .name]' + echo ";" + ) > "$CARGO_TARGET_DIR/doc/crates.js" # Document crates in workspace and watch for changes. doc-watch: