fix(docs): publish complete API reference on docs.rs#1000
Merged
Conversation
docs.rs built with default features only, so the feature-gated `vcs` module (change-history metrics, #328) was silently missing from the published API reference. Add a `[package.metadata.docs.rs]` section (`all-features = true`, `--cfg docsrs`) so every public surface is documented, and gate `feature(doc_cfg)` on `--cfg docsrs` to render per-item "Available on crate feature ..." badges. Add a `make doc-check-docsrs` target to reproduce the docs.rs build locally on nightly for pre-release verification, and make the book's landing page link the docs.rs reference prominently so it is unmissable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make docs.rs publish the complete API reference and link it
prominently from the book.
docs.rs was building with default features only. Since
default = ["all-languages"]excludesvcs, the entire feature-gatedvcsmodule (change-history metrics, #328) was silently missing from the
published API reference — the reference itself is 100% documented
(
missing_docsclean, CI-gated), but the published copy dropped awhole public surface.
Changes
Cargo.toml— add[package.metadata.docs.rs]withall-features = trueandrustdoc-args = ["--cfg", "docsrs"], sodocs.rs documents every public surface including
vcs.src/lib.rs— gatefeature(doc_cfg)on--cfg docsrsand add adoc(cfg(feature = "vcs-git"))badge onpub mod vcs, rendering aper-item "Available on crate feature
vcs-git" note. The module docalso points users at the
vcsumbrella feature. Thedocsrscfg isinert on stable builds.
Makefile— adddoc-check-docsrsto reproduce the docs.rs buildlocally on nightly (
--cfg docsrs) for pre-release verification;skips cleanly when nightly is absent. Wired into
.PHONYandmake help.big-code-analysis-book/src/README.md— add a prominent APIreference callout on the landing page and clarify the existing "API
docs" section. (An mdBook
SUMMARY.mdsidebar entry was tried firstbut mdBook 0.5.3 rejects external URLs as chapter entries.)
CHANGELOG.md—### Fixedentry under[Unreleased].Why the book was the wrong place for the reference
The request began as "add API documentation to the book." For the Rust
library API the book is the wrong home: rustdoc/docs.rs is canonical,
auto-generated, and already CI-gated — duplicating signatures into
Markdown guarantees drift. The book already deferred there. The real
defect was that docs.rs shipped an incomplete copy; this fixes that and
makes the link unmissable rather than duplicating the reference.
Validation
make pre-commit— pass.make doc-check-docsrs(nightly,--cfg docsrs,-D warnings) —clean; badge renders and the
vcssurface is exercised.make doc-checkandcargo clippy --all-features -- -D warnings— clean (docsrsis a well-known cfg in cargo 1.95, so nounexpected_cfgs; badges stay inert off docs.rs).