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

docs: more intra-doc links #2077

Merged
merged 4 commits into from Apr 19, 2022
Merged

Commits on Apr 14, 2022

  1. 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`.
    ben0x539 committed Apr 14, 2022
    Configuration menu
    Copy the full SHA
    97c40bc View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2022

  1. 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
        }
    ben0x539 committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    6e691dc View commit details
    Browse the repository at this point in the history
  2. 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.
    ben0x539 committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    4ae60e5 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2022

  1. Configuration menu
    Copy the full SHA
    5cbc321 View commit details
    Browse the repository at this point in the history