-
Notifications
You must be signed in to change notification settings - Fork 605
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
Crate page should list the crate's Cargo "features" #465
Comments
Crates.io automatically shows README.md contents, so features can be documented there. This is what rand does. Since this is more flexible than a flat list, I'd argue the issue is sufficiently well solved already (or it's just a crate doc issue)? |
@dhardy the problem with relying on the |
I actually with you @Lonami, but have one caveat to add: Cargo considers any optional dependency a "feature", though sometimes these are not intended for use by end users. Ideally there would be some way of annotating features with documentation in the |
TOML supports comments so perhaps if there's one above a feature it could be used as its description. But I don't think there's any visible standard on this. |
There are 2 possible solutions to this:
|
I would love this feature! It's frustrating trying to find a crate's feature set and having to hunt down its I believe all features (including optional dependencies) should be listed on a crate's page. There should be a distinction between custom features and dependency features, which would be a good middle ground for @dhardy's concern about "internal" features. This list should also express what features get enabled by other features. |
Note that optional dependencies are listed like the rest of dependencies with the "optional" text following the dependency name. See for example https://crates.io/crates/tokio. |
I stumbled upon this with refinery, barrel, diesel. |
lib.rs shows available features, by the way. |
This seems to actually already be implemented: on the Now I guess the question is, is it discoverable enough. |
That's how I was doing it too, but when there are lots of features it gets pretty hard to use (e.g. https://crates.io/crates/windows/versions vs https://lib.rs/crates/windows/features). |
It's currently hard to discover optional features for a crate. It would be useful for crates.io to list these along with the dependencies. Unfortunately there's no way to declare docs or other metadata for a feature, so this will just have to be a flat list, but maybe more info can be added in the future.
The text was updated successfully, but these errors were encountered: