Skip to content

Conversation

@orium
Copy link
Owner

@orium orium commented May 31, 2024

Closes #177.

@angrynode
Copy link

This branch is great! Some notes:

  • it allows unqualified links as asked in Allow intralinks that do not start with crate:: #151, removing the cargo doc warning about unnecessary complete path
  • it does not allow to resolve links without an actual URI (so you have to write [Api](Api) instead of just [Api] in usual rustdoc)
  • i had to bump some crates and EXPECTED_RUSTDOC_FORMAT_VERSION to 42 but all went fine
  • it complained at runtime that nightly toolchain was not installed... i wonder if there could be a way to statically bundle whatever's needed from nightly in a single cargo-rdme binary

@orium
Copy link
Owner Author

orium commented Mar 25, 2025

it complained at runtime that nightly toolchain was not installed... i wonder if there could be a way to statically bundle whatever's needed from nightly in a single cargo-rdme binary

I'm thinking about making cargo-rdme install by running cargo rdme setup or something like that.

@orium orium force-pushed the rustdoc-json branch 2 times, most recently from e7541b1 to ad05620 Compare April 11, 2025 21:29
@angrynode
Copy link

I'm thinking about making cargo-rdme install by running cargo rdme setup or something like that.

Would that work by running rustup at runtime? Are you aware if there's a way to bundle what's needed directly in the binary (maybe depending on feature flags), or a tracking issue for that on rust side? I personally very much prefer to have it all in the binary, but maybe it's just not possible at the moment...

@angrynode
Copy link

Hello, is there something blocking this? Can i contribute somehow despite 0 experience with rustc/rustdoc internals?

I've started my own branch here https://github.com/angrynode/cargo-rdme/tree/rustdoc-json
It passes CI but after bumping deps i had to bump MSRV to v1.86 but i'm not happy about it because the latest Debian stable has v1.85.

@orium
Copy link
Owner Author

orium commented Aug 27, 2025

Hi @angrynode. This one I need to finish myself, but thank you for interest. I want to get around to do that in the next couple of months, but no promises.

@angrynode
Copy link

Thank you and good luck! no pressure from me :)

it's been working great for me so far <3

@nik-rev
Copy link

nik-rev commented Oct 1, 2025

for anyone who wants to use this branch, and gets an error like "unsupported rustdoc format, expected version 43 but got version 40" do this:

cd ~/.cargo/bins/
git clone https://github.com/orium/cargo-rdme.git cargo-rdme-project
cd cargo-rdme-project
# this is the commit that builds
git checkout ad0562032c9b061d03b7710522ec90b6ea51eb4f

Apply this patch:

diff --git a/src/transform/intralinks/rustdoc.rs b/src/transform/intralinks/rustdoc.rs
index 4d20c54..da1f0b9 100644
--- a/src/transform/intralinks/rustdoc.rs
+++ b/src/transform/intralinks/rustdoc.rs
@@ -506,13 +506,14 @@ fn run_rustdoc(
 
     let rustdoc_crate = crate_from_file(&rustdoc_json_path)?;
 
-    match rustdoc_crate.format_version {
-        EXPECTED_RUSTDOC_FORMAT_VERSION => Ok(rustdoc_crate),
-        format_version => Err(IntralinkError::UnsupportedRustdocFormatVersion {
-            version: format_version,
-            expected_version: EXPECTED_RUSTDOC_FORMAT_VERSION,
-        }),
-    }
+    Ok(rustdoc_crate)
 }
 
 fn items_info(rustdoc_crate: &Crate) -> HashMap<ItemId, ItemInfo<'_>> {

Then build it

cargo build --release
mv target/release/cargo-rdme ..

Seems to work fine.

@orium
Copy link
Owner Author

orium commented Oct 2, 2025

for anyone who wants to use this branch, and gets an error like "unsupported rustdoc format, expected version 43 but got version 40" do this:

If you are getting 40 you have an old nightly toolchain. After you update it you should have version 56.

I've updated this branch to use version 56.

@orium orium force-pushed the rustdoc-json branch 4 times, most recently from 6e60eb2 to 6c8bf18 Compare October 7, 2025 21:52
@angrynode
Copy link

I've updated this branch to use version 56.

Is there an advantage to pinning a specific version? On my branch i'm producing a warning Warning: Unknown newer rustdoc version 56. Trying to run anyway. but i've never encountered issues yet.

I think it's better to run anyway and maybe in the future encounter problems, than failing to run every time the rustdoc version is bumped, which happens quite often. But maybe that's a bit too adventurous for your taste :)

@nik-rev
Copy link

nik-rev commented Jan 18, 2026

You could be forced to specify a flag to allow the version to be ignored, that would also be a good solution. For those who are happy to deal with consequences of mismatching versions

@orium orium force-pushed the rustdoc-json branch 2 times, most recently from 1f3c04f to e874d38 Compare January 24, 2026 23:03
@orium
Copy link
Owner Author

orium commented Jan 24, 2026

I've added configuration options for selecting feature when running rustdoc for intralinks (both command line and config file).

Also, if you have the unsupported rustdoc format, expected version X but got version Y cargo-rdme will tell you what nightly toolchain to install (in the final version there will probably be a command line option to install the right nightly version).

@orium orium force-pushed the rustdoc-json branch 2 times, most recently from ca41dbe to ef97790 Compare January 24, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get intralink information from rustdoc

3 participants