-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improve the docs.rs situation #17
Conversation
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
targets = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tells docs.rs
to build the default target only. pollsters
s API is the same everywhere.
See https://docs.rs/about/metadata.
@@ -1,4 +1,5 @@ | |||
#![doc = include_str!("../README.md")] | |||
#![cfg_attr(docsrs, feature(doc_auto_cfg))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice because it shows the crate feature needed to use a specific API in the Rust documentation.
See rust-lang/rust#43781.
@@ -46,6 +48,8 @@ pub fn main( | |||
/// my_fut.await; | |||
/// } | |||
/// ``` | |||
/// | |||
/// [`pollster::block_on`]: https://docs.rs/pollster/0.3.0/pollster/fn.block_on.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit annoying because it needs to be kept up-to-date with version bumps.
Initially I was thinking putting this to "latest" but this is more correct in the sense that old versions won't link to new versions ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a little annoying... Perhaps the macro crate could be made to depend on the main crate when building for docsrs, allowing us to directly link through to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with dev-dependencies
, but rust-lang/cargo#3475.
So not any way I know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah well. I'm sure this is fine for now.
I noticed broken links on the proc-macros and them not showing as being re-exported on docs.rs.