-
Notifications
You must be signed in to change notification settings - Fork 601
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
Display doc comments for private types #1042
Display doc comments for private types #1042
Conversation
Fixes rust-lang#911 - Adds a [package.metadata.docs.rs] to Cargo.toml - Sets the rustdoc-args key to [ "--no-defaults --passes collapse-docs --passes unindent-comments" ]
Could you figure out if there's a way to test this? The difficulty is that this needs to work with docs.rs, and so far, a way I think we could test this is to run docs.rs locally, but I'm not fully across how crates.io and docs.rs are linked. Alternatively, we could just accept this PR and see if it works, and submit more PRs until it does. It is a pretty small change after all :). |
@vignesh-sankaran I could try running docs.rs locally. Not sure how I would test my changes though. Also CI tests are failing because crates.io uses the Do I have to add a |
@vignesh-sankaran unfortunately installing docs.rs won't allow you to test this PR, docs.rs currently only works with crates released into crates.io, there is no way to test any crate that is not released. |
@onur So a locally running docs.rs instance won't work with a local crates.io instance? As a matter of interest, what's the mechanism docs.rs gets notified by of an updated crate version? |
@mattgathu Yes I remember running into this issue, I'm afraid I'm not sure how to work around this problem and I won't be able to look into it for at least the next few days :( |
@vignesh-sankaran docs.rs is fetching crates.io-index repository every minute and checking if there is any difference. That is how docs.rs is getting aware of new crate releases. Your second suggestion makes more sense. Docs.rs is actually a pretty basic program it's just checking new releases and running |
this fixes cargo test error
@onur Would we need to point docs.rs at the local crates.io index? If so, how would we do this? Admittedly there is the immediate problem of trying to get the Cargo.toml to be valid, I'm not sure how to get it to work. Any ideas? @mattgathu We're trying to figure out how you can go ahead and test this :). |
@mattgathu Did you try compiling it on your machine? You can check if the Cargo.toml is valid by running |
@vignesh-sankaran @onur great. thanks a lot for the help. In the meantime I have renamed |
Any ideas on how to test this? |
I'd say that the quick'n'dirty solution would be publishing this branch on crates.io under another name and see how it renders on docs.rs ? Then we can yank it and not hear from it again. |
Thank you for the PR @mattgathu !!! I'm up for just publishing this, and if it doesn't work, we'll publish another version! version numbers are free!! |
Found out from this comment that the command to use rustdoc in this case with arguments like these is actually:
I ran this locally and it completed successfully and documented private types, so I think this is worth a try! I'm going to have bors merge this in and then I'll bump the version number and publish :) bors: r+ |
Build failed |
bors: r+ |
Build succeeded |
Fixes #911