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

Show crate features in rustdoc #96318

Open
Milo123459 opened this issue Apr 22, 2022 · 3 comments
Open

Show crate features in rustdoc #96318

Milo123459 opened this issue Apr 22, 2022 · 3 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Milo123459
Copy link
Contributor

Show crate features generated in rustdoc.

@epage
Copy link
Contributor

epage commented Apr 22, 2022

There are a couple of ways features can be exposed.

One is in-work, #43781 which shows the needed features on the API items. See argfile::parse_response as an example.

Not all features are exposed on API items (and it takes extra work to make sure the ones that do do show up in rustdoc) and sometimes its helpful to get a summary. This is where the third-party document-features approach comes in. It parses comments in the manifest in a somewhat similar way to comments in source. For an example, check out kstring's manifest and docs.

For this latter case, I imagine there will be work on deciding how the feature list should be exposed via rustdoc because I doubt we would want to do it the same way as document-features (example). Maybe treat features like API items?

We'd also need to hash out the comment conventions. Having practice with third-party crates like document-features helps here.

@epage
Copy link
Contributor

epage commented Apr 22, 2022

From Zulip

@_jsha|315412 said:

This was a big part of the discussion at https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20minimum.20rust.20version.3F and #96028.

The gist of that discussion was: showing MSRV conceptually fits within rustdoc, but not on any current rustdoc page. There are some other things that conceptually fit within rustdoc, like features and dependencies (which are currently shown on docs.rs, but are not part of rustdoc itself). It would probably be a good idea to have rustdoc generate a page with features, dependencies, and MSRV (and maybe some other things). Ideally that should make it possible to eventually remove the page on docs.rs with that information, since that page would become redundant.

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Apr 22, 2022
@epage
Copy link
Contributor

epage commented Apr 22, 2022

A related issue is rust-lang/cargo#4956 which is about adding descriptions to features for crates.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants