-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Tracking issue for -Zrustdoc-map #8296
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.S-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.Status: An implemented feature is waiting on community feedback for bugs or design concerns.Z-rustdoc-mapNightly: rustdoc-mapNightly: rustdoc-map
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.S-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.Status: An implemented feature is waiting on community feedback for bugs or design concerns.Z-rustdoc-mapNightly: rustdoc-mapNightly: rustdoc-map
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Unstable, baking
Original issue: #6279Nightly: rustdoc-map
Implementation: #8287
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#rustdoc-map
Issues: Z-rustdoc-map
Summary
This feature adds the ability for Cargo to pass external documentation mappings to rustdoc, so that links to dependencies will use those external sites (like docs.rs). See the documentation for details on how to use it.
Unresolved issues
CARGO_CONFIG_DOC_EXTERN_MAP_REGISTRIES_CRATES_IO="…"). This would be very difficult to support, because Cargo doesn't retain the registry name in SourceId. I looked into fixing that, but it is very difficult, and hard to make it reliable. I would lean towards not bothering with this (it has similar issues as thesourcetable).cargo doc. I can think of 3 options: all-deps, no-deps, direct-deps only. I think this would be useful, otherwise to use the rustdoc-map, one would always need to pass--no-deps. This would probably also need a new command-line flag to override the config option (maybe a generalization of--no-deps).crates-io = "https://docs.rs/". I think this should be relatively safe, since it only enhances the current behavior (people who use --no-deps will now have links instead of no links in their docs). DONE: Set docs.rs as the default extern-map for crates.io #8877cargo doc. I would prefer to get more community feedback to see what makes sense. Two options:--no-deps. This would engage rustdoc-map, but is a much more drastic change. The user would not have local indexing available.documentationURL set inCargo.tomlis never consulted. I think this is unlikely to work with rustdoc, because it expects a certain structure to the API docs, and documentation URLs often point to user guides, or other things that aren't API docs. The#![doc(html_root_url = "...")]attribute is overridden by the--extern-html-root-urlflag. This may be a good or bad thing depending on your perspective (should the user have control, or should the crate author?).Future extensions
These things can be done after stabilization, but should be considered to ensure this feature doesn't make them more difficult.
doc.extern-map.std = "include"or something like that. (Or maybe just use build-std?) Support rustdoc root-url feature #6279 (comment)[doc]table.--extern-html-root-urlflag will automatically handle second-level dependencies.cargo doconly direct dependencies #2025 feature request: build docs for dependencies only #2801 Is there a way to run cargo doc and only get the documentation for direct dependencies of my project? #6421 https://crates.io/crates/cargo-makedocs--exclude winapi?), and the rustdoc-map feature would automatically link those excluded crates' items to docs.rs. This could also be added to the[doc]table. Allow skipping of specific dependencies in 'cargo doc' #4049