Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docsrs labels #380

Merged
merged 6 commits into from
Dec 20, 2024
Merged

Docsrs labels #380

merged 6 commits into from
Dec 20, 2024

Conversation

qrnch-jan
Copy link
Contributor

rustdoc/docs.rs support adding cfg/feature labels to generated docs, but it's currently nightly only and put behind a feature gate. Apparently there are some future goals to make generation of these automatic, but for now it requires adding the entries manually. docs.rs happens to use nightly to generate docs, so we can make use of that while retaining compatibility with stable rustdoc.

With these changes, cargo doc will work the same as it always has, but following the added instructions in the readme will yield labels like the ones (for instance) tokio has: https://docs.rs/tokio/1.42.0/tokio/#modules

qrnch-jan and others added 6 commits December 16, 2024 19:38
… rustc-serialize, which has had a history of causing builds to print deprecation warnings.
… pull in rustc-serialize, which has had a history of causing builds to print deprecation warnings."

This reverts commit 36138ca.
This is a nightly-only feature, and can used locally by setting
`RUSTFLAGS="--cfg docsrs"` and `RUSTDOCFLAGS="--cfg docsrs"` and then
generating the documentation using `cargo +nightly doc --all-features`.

Generating documentation using stable `cargo doc` (without the
`--cfg docsrs`) should work just as normal.
@Wojtek242
Copy link
Collaborator

LGTM - thanks for the suggestion!

@Wojtek242 Wojtek242 merged commit b2fe759 into rust-pcap:main Dec 20, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants