From 3c262b6c1b1657589c96e685e8e6fe585da72b97 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 12 Aug 2026 13:32:55 +0200 Subject: [PATCH] docs: rename docs/components to docs/crates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generated landing page's own H1 already said "Crate reference" — the directory name should match. Rename docs/components/ -> docs/crates/ and update the generating derivation (nix/packages/reference-docs.nix), its default.nix caller comment, and docs/README.md's link. Fixes #3193 --- docs/README.md | 2 +- docs/{components => crates}/README.md | 0 nix/packages/default.nix | 2 +- nix/packages/reference-docs.nix | 26 +++++++++++++------------- 4 files changed, 15 insertions(+), 15 deletions(-) rename docs/{components => crates}/README.md (100%) diff --git a/docs/README.md b/docs/README.md index f33fd28b..e4af2b9b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -89,7 +89,7 @@ declarations. ## Crate reference - **What does a specific Rust crate do, on its own terms?** → - [`components/`](components/README.md) — every workspace crate's own + [`crates/`](crates/README.md) — every workspace crate's own `README.md`, one level up from source (hyperhive#3051); the crate itself is still the source of truth, this is just a walkable mirror. diff --git a/docs/components/README.md b/docs/crates/README.md similarity index 100% rename from docs/components/README.md rename to docs/crates/README.md diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 9f44d686..f47724d0 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -190,7 +190,7 @@ in # ./reference-docs.nix. (`docs` below is the auto-generated # nix-options reference, a different artifact.) `self` is needed to # read each workspace crate's own README.md into the virtual - # `components/` subdir. + # `crates/` subdir. reference-docs = pkgs.callPackage ./reference-docs.nix { inherit self; }; # XDG icon set + .desktop entries for hyperhive processes. # Narrow input: only the branding SVG, so unrelated source changes diff --git a/nix/packages/reference-docs.nix b/nix/packages/reference-docs.nix index eac1fc36..d8eae450 100644 --- a/nix/packages/reference-docs.nix +++ b/nix/packages/reference-docs.nix @@ -11,9 +11,9 @@ # reuse the exact same tree as a flake input. # # The docs/ tree is copied verbatim (never transformed). On top of that, -# `$out/components/.md` is synthesized — one per workspace crate +# `$out/crates/.md` is synthesized — one per workspace crate # with a README.md, virtualized under docs/ (mara's ask: "behaves as if -# hive-core/README.md lives at docs/components/hive-core.md"). The +# hive-core/README.md lives at docs/crates/hive-core.md"). The # crate's own README stays the single source of truth; this derivation # only projects it into the docs tree, so there is no second copy to keep # in sync by hand. `docs.nix` (website repo) needs no changes to pick these @@ -21,10 +21,10 @@ # # Output layout: # $out/ — the repo docs/ tree verbatim (e.g. $out/setup.md) -# $out/components/.md — one per workspace crate README, plus the -# hand-written docs/components/README.md -# landing page (copied verbatim like any -# other docs/ file, not generated here) +# $out/crates/.md — one per workspace crate README, plus the +# hand-written docs/crates/README.md +# landing page (copied verbatim like any +# other docs/ file, not generated here) let cargoToml = builtins.fromTOML (builtins.readFile ../../Cargo.toml); @@ -32,7 +32,7 @@ let # A member-name relative link (`../`, no specific file — # forge's browser renders that as a directory listing today) becomes a - # sibling components/.md link once every crate README + # sibling crates/.md link once every crate README # lives flat in the same directory. Built once, applied per file below, # rather than a fresh `lib.concatMapStrings` per crate's own transform — # every crate needs the exact same substitution list (every *other* @@ -51,7 +51,7 @@ stdenv.mkDerivation { version = "0.1.0"; # Narrow src (just docs/) keeps the *base tree*'s input hash decoupled # from the rest of the workspace — a doc edit only re-hashes this half. - # The components/ generation below necessarily widens that: it reads + # The crates/ generation below necessarily widens that: it reads # each crate's own README.md via `self`, so this derivation's hash now # also tracks the whole repo tree (Nix has no cheaper way to depend on # "just these few files" out of a flake `self`). Accepted trade-off — @@ -67,7 +67,7 @@ stdenv.mkDerivation { runHook preInstall mkdir -p $out cp -r ./* $out/ - mkdir -p "$out/components" + mkdir -p "$out/crates" ${lib.concatMapStrings (member: '' if [ -f "$self/${member}/README.md" ]; then @@ -75,16 +75,16 @@ stdenv.mkDerivation { # position in the repo tree but aren't once the file is # virtually one level under docs/ instead: # ../docs/x.md (crate root -> repo docs/) -> ../x.md - # (components/ -> docs/ is one directory shallower than + # (crates/ -> docs/ is one directory shallower than # / -> docs/ was, so the leading docs/ segment drops) # ../ (that crate's own directory, no file) # -> ./.md, once that sibling also has a - # components page every crate README lives flat beside it. + # crates page every crate README lives flat beside it. sed -E \ -e 's,\]\(\.\./docs/,](../,g' \ ${siblingLinkFixups member} \ "$self/${member}/README.md" \ - > "$out/components/${member}.md" + > "$out/crates/${member}.md" fi '') members} @@ -94,7 +94,7 @@ stdenv.mkDerivation { dontFixup = true; meta = { - description = "hyperhive reference docs (the repo docs/ tree, plus a virtual components/.md per workspace crate README)"; + description = "hyperhive reference docs (the repo docs/ tree, plus a virtual crates/.md per workspace crate README)"; homepage = "https://forge.darkest.space/hyperhive/hyperhive"; }; }