-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature request: #[doc(canonical)]
#3011
Comments
rust-lang/docs.rs#1588 (comment) has a lot of things that are very similar but not the same; I'd love to have a plan for how this affects links to transitive dependencies as well. |
We discussed this in the 2024-01-08 t-rustdoc meeting and the 2024-03-11 t-rustdoc meeting. To summarize: This is a useful problem to solve, and we want to solve it, but we're still not sure yet exactly what the solution should look like. Getting concrete, there are two main use cases:
For examples of (2):
For examples of (1):
Another problem that came up is directionality. A crate that is depended-upon doesn't know about the crates that depend on it. So if, e.g. I also wrote down what I consider the important use case for a feature like this:
One idea that came up towards the end of the meeting was that rather than try to do something complicated with declaring things canonical, we could, when generating inlined re-export docs, add a notation saying "this is a re-export of foo::Bar." |
A notation to make clear that a re-export happened sounds very good. |
I don't have time for a full write-up of this right now, so I'm just opening an issue so I have somewhere to point people when they open rustdoc issues.
Motivation:
doc(canonical)
could tell rustdoc the 'one true path' the item should appear at.Possible difficulties:
doc(canonical)
is necessarily unique across all crates. rustdoc should give an error if it's duplicated.Unresolved questions:
doc(canonical)
? Should all other usages just link to the canonical crate? How does this work if the canonical usage is in a reverse-dependency?cc @camelid
The text was updated successfully, but these errors were encountered: