From f4175a4ad4c9a341e9d693cf12a78f2289fb84c8 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 8 Mar 2025 17:24:12 +0000 Subject: [PATCH] chore: fix doc recipe --- justfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 177ae8e3..8d00a935 100644 --- a/justfile +++ b/justfile @@ -70,8 +70,19 @@ test-docs toolchain="": && doc test-all toolchain="": (test toolchain) (test-docs toolchain) # Document crates in workspace. -doc *args: +doc *args: && doc-set-workspace-crates + rm -f "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js" RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --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) | .targets | map(select(.doc) | .name)] | flatten' + echo ";" + ) > "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js" # Document crates in workspace and watch for changes. doc-watch: