orium / cargo-rdme

Cargo command to create the README.md from your crate's documentation
Mozilla Public License 2.0
126 stars 5 forks source link

Support intralinks to foreign impl items #234

Open orium opened 4 months ago

orium commented 4 months ago

After #177 we can't generate intralinks to foreign impl items such as:

//! [String::from_utf8_lossy](String::from_utf8_lossy)
//! [char::is_ascii_lowercase](char::is_ascii_lowercase)

These fail because we can't resolve them with the paths field of the rustdoc json: we would need to have all index items of the standard library, and they are not included in rustdoc's output.

Now, there's a way to get the rustdoc json for the standard library with component rust-docs-json (see https://github.com/rust-lang/rust/issues/76578#issuecomment-1823477825), but the json files, which will be installed in ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/json/, do not contain item ids consistent with the output of rustdoc in our crate (see "Foreign ID Lookup" in https://github.com/rust-lang/rust/issues/106697).