-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support rustdoc root-url feature #6279
Comments
Okay I want to take on this issue, because I've wanted this for literally ages. Talking to @QuietMisdreavus, she said the key parts are (1) figuring out whether the user has rustup installed I figure finding rust-docs and rustup should be jobs for cargo and that this is probably where I should start. The only code I see looking at rustup from cargo is for fingerprinting. I'm wondering if I should add a fn in util::config similar to config::rustdoc which calls into Once we have verified we have rustup, the next step is to figure out if rust-docs (I'm assuming this is the local copy of the std docs) is installed, no idea how to do that yet. And then from there it seems pretty easy to just wire all the args around so the proper flags get passed into rustdoc. |
Further discussion with @QuietMisdreavus has made it seem like it might be a bit simpler than I thought. I don't think we need to involve rustup at all. rustc gives us the sysroot which is all we need. So...
|
Just wanted to drop by and say a word of support for this issue, it'd be really great to be able to be able to have a single tab open when developing :) (wrt. #7071 I think ideally it'd be possible to have a way to add std to the search index, for local development purposes, but this can certainly come in a second step) |
Rustdoc has an unstable flag
--extern-html-root-url
which allows you to redirect external links to a different site. It might be useful if cargo exposed native support for this feature somehow so that it could automatically fill in all the flags. This could allow libstd links to go to your local copy of libstd downloaded by rustup instead of doc.rust-lang.org for better offline support. Or redirect dependency links to another site like docs.rs instead of building all dependency docs.Currently you can use it like this:
And you can add other sysroot crates like
proc_macro
.Some design work needs to be done to figure out exactly how this works. Some things to consider:
--no-deps
?I'm imagine there are many other questions to be resolved.
See #8104 for a detailed use case example.
cc @QuietMisdreavus
The text was updated successfully, but these errors were encountered: