-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
chore: audit all doc links #1473
Comments
@ipetkov that would be great. Historically, that option wasn't mature enough, but maybe that works now 👍 |
Would we like to replace all static links by some kind of script? Potentially helpful link here |
Using ripgrep you can quickly find a lot of these:
|
I've made some changes #2381 Next steps
|
Included changes - all simple references like `<type>.<name>.html` for these types - enum - fn - struct - trait - type - simple references for methods, like struct.DelayQueue.html#method.poll Refs: #1473
Broken links are fixed in #2400 However, some of the links from #1473 (comment) couldn't be fixed, here's the overview Should be fixed in rustdoc: rust-lang/rust#65983 because they are re-exports Docs should re rephrased, because according to git log 27e5b41067d01c0c9fac230c5addb58034201a63`
So What is
|
Hey @xliiv, thank you for doing this! The |
Fixed in e19a0d4 commit and discussed in the thread starting with this comment #2400 (comment) |
Links to |
The link to tokio::main was relative to tokio_macros crate in the source directory. This is why it worked in local build of documentation and not in doc.rs. Related to tokio-rs#1473.
Use rustdoc automatic link resolution over relative path to have compile time error when it could not resolve links. Fix invalid links to AsyncRead and AsyncWrite in tokio-util. Related to tokio-rs#1473.
Thanks, I'll fix it as 3rd step of #1473 (comment) if it's not handled earlier |
Note that #2423 was just opened. |
The link to tokio::main was relative to tokio_macros crate in the source directory. This is why it worked in local build of documentation and not in doc.rs. Refs: #1473
The link to tokio::main was relative to tokio_macros crate in the source directory. This is why it worked in local build of documentation and not in doc.rs. Refs: tokio-rs#1473
Use rustdoc automatic link resolution over relative path to have compile time error when it could not resolve links. Fix invalid links to AsyncRead and AsyncWrite in tokio-util. Refs: tokio-rs#1473
Is there more work to do on this issue? |
In short yes. I would still change all > rg '(struct|trait|enum|macro|fn|attr|type)\.[a-zA-Z0-9_]*\.html|#method.' -t rust -g '!target' -g '!tokio-test'|rg '#method'|wc -l
48
My plan is to finish resolved rust-lang/rust#70802 issue and get back to this issue. |
Sounds good! No rush, I was just going through issues to figure out the status. |
I need more time because, .. you know life. ;) |
Status update.. In ShortWith this MR #2575 In LongOther non intra-links still exist. This is the complete list
tokio/src/lib.rs://! [main]: attr.main.html
tokio/src/runtime/mod.rs://! [`tokio::main`]: ../attr.main.html
tokio/src/runtime/mod.rs: /// [main]: ../attr.main.html This doesn't work. My guess, it's because of this? Maybe? Lines 397 to 430 in a5c1a7d
For sure, I just checked intra-links for proc macros and it works, .. Test detailsextern crate proc_macro;
use proc_macro::TokenStream;
/// [`this_proc_macro`](crate::this_proc_macro)
#[proc_macro_attribute]
pub fn this_proc_macro(_attr: TokenStream, item: TokenStream) -> TokenStream { } so .. If anyone wants to dig it, go ahead. |
@Darksonn should we close it? |
Many of the doc links currently point to arbitrary URLs or don't actually link anywhere.
We should instead rely on rustdoc's resolution feature to link to the appropriate item, and block the CI on any errors/warnings there.
The text was updated successfully, but these errors were encountered: