forked from tokio-rs/tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: more intra-doc links (tokio-rs#2077)
* docs: `cargo intraconv` for more intra-doc links ... also it deleted some redundant ones, and it got some things wrong, and it was gonna delete some of the cross-crate docs.rs links we can't do as intra-doc links so I passed `--no-favored`. * docs: convert https:// links to std/core/alloc to intra-doc links Note that this adds some more broken intra doc links when building without std support, but that was already a thing and I expect people who build their own docs without std support can handle it. This time I gave up on sed and used ruby. find -name '*.rs' -exec ruby -i -p blah.rb {} + with $_.gsub!(%r{ https://doc\.rust-lang\.org/ (?: stable/)? ((?:core | std | alloc)(?:/\S+?)*) /(\w+)\.(\w+)\.html}x ) { path, kind, name = $~.captures suffix = case kind when 'method' then '()' when 'macro' then '!' else '' end r = [path.gsub('/', '::'), '::', name, suffix].join STDERR.puts [path, kind, name, suffix, r].inspect r } $_.gsub!(%r{ https://doc\.rust-lang\.org/ (?: stable/)? ((?: core | std | alloc)(?:/\S+?)*) /(?: index\.html | $ | (?= \#) )}x ) { path, _ = $~.captures r = path.gsub('/', '::') STDERR.puts [path, r].inspect r } * docs: more cross-crate intra-doc links cargo intraconv doesn't seem to get them reliably and also plenty of links to other crates aren't actually intra-doc because they're in crates that don't depend (or only dev-depend, or only conditionally depend) on those crates, so this wasn't very automated. I tried to only convert docs.rs links to unconditional dependencies to intra-crate links, but it's possible that some slipped through in either direction.
- Loading branch information
Showing
13 changed files
with
76 additions
and
99 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.