Skip to main content

Module crate_docs

Module crate_docs 

Source
Expand description

Harvest crates.io → docs.rs links from Cargo.toml (+ optional Cargo.lock).

Used by bootstrap/setup so agents can rustbrain query serde and land on a note with the correct docs.rs URL. Purely algorithmic — no network fetch of docs HTML (URLs follow the public docs.rs convention).

§What is included

  • Direct deps from every Cargo.toml under the workspace (skip target/, …)
  • Sections: [dependencies], [dev-dependencies], [build-dependencies], and [workspace.dependencies]
  • Exact versions from Cargo.lock when present (better docs.rs deep links)

§What is skipped

  • path = "…" dependencies (local crates — not on docs.rs)
  • Renamed packages use the package name for docs.rs, not the key

§Output

  • docs/references/crate-docs.generated.md — index of all harvested deps
  • docs/references/crates/{crate}.md — one note per crates.io package (node_type: reference, generated: true)

Structs§

CrateDep
One direct dependency harvested from a manifest.

Functions§

collect_crate_deps
Collect unique crates.io dependencies from a workspace tree.
crates_io_url
crates.io URL for a package.
docs_rs_url
docs.rs URL for a package (optionally pinned to an exact version).
write_crate_docs_notes
Write index + per-crate notes under docs/references/.