Skip to content
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

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Improve the docs.rs situation #17

merged 1 commit into from
Mar 28, 2023

Conversation

daxpedda
Copy link
Contributor

I noticed broken links on the proc-macros and them not showing as being re-exported on docs.rs.


[package.metadata.docs.rs]
all-features = true
targets = []
Copy link
Contributor Author

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. pollsterss 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))]
Copy link
Contributor Author

@daxpedda daxpedda Mar 28, 2023

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
Copy link
Contributor Author

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 ...

Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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.

@zesterer zesterer merged commit 767e6db into zesterer:master Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants