-
Notifications
You must be signed in to change notification settings - Fork 9
Get intralink information from rustdoc #236
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
base: main
Are you sure you want to change the base?
Conversation
53084eb to
73101dd
Compare
|
This branch is great! Some notes:
|
I'm thinking about making |
e7541b1 to
ad05620
Compare
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... |
|
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 |
|
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. |
|
Thank you and good luck! no pressure from me :) it's been working great for me so far <3 |
|
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 ad0562032c9b061d03b7710522ec90b6ea51eb4fApply 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. |
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. |
6e60eb2 to
6c8bf18
Compare
Is there an advantage to pinning a specific version? On my branch i'm producing a warning 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 :) |
|
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 |
1f3c04f to
e874d38
Compare
|
I've added configuration options for selecting feature when running rustdoc for intralinks (both command line and config file). Also, if you have the |
ca41dbe to
ef97790
Compare
Closes #177.