Skip to content

Allow overriding docs.rs URLs #17283

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

Open
gautamg795 opened this issue May 23, 2024 · 3 comments
Open

Allow overriding docs.rs URLs #17283

gautamg795 opened this issue May 23, 2024 · 3 comments
Labels
C-feature Category: feature request

Comments

@gautamg795
Copy link

This is a follow-up request to #12867.
Our organization has documentation hosted internally for our Rust workspace (built via cargo doc --workspace --document-private-items), so most users don't have docs built locally.
Right now, the autogenerated docs.rs URL is invalid for any of our internal crates, so it'd be very helpful to override the "base URL" or provide a format string to get to the docs for a crate.

@gautamg795 gautamg795 added the C-feature Category: feature request label May 23, 2024
@Veykril
Copy link
Member

Veykril commented May 23, 2024

Does using #![doc(html_root_url = "...")] not work for you?

@gautamg795
Copy link
Author

We'd have to insert that on every crate, I think.
But also I'm not sure it works at all for us from reading the docs -- it seems that it affects how docs are generated; our docs are already generated just fine in CI and hosted on GH Pages. We just want rust-analyzer / VSCode to open a different base URL.

Maybe your suggestion is to have a html_root_url set conditionally so it's not set in CI, and perhaps that would work? But having to insert the attribute on every crate is still not ideal.

That said, I'm happy to take a look at what the implementation for this would look like!

@davidbarsky
Copy link
Contributor

I think I have a branch that allows overriding docs.rs somewhere, lemme see if I can dig it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

3 participants