Skip to content

Feature request: list crate features at the top of package index.html #590

Closed

Description

When learning Rust, it's surprising to not find a namespace available within a package. Having crate features available at the top of the docs.rs package would be a great indication that some namespaces are gated behind features.

Activity

  1. jyn514 commented on Feb 6, 2020

    @jyn514
    Member

    I think listing all the features of the crate is useful and in scope (maybe under the crate tab). However, we can't put it on the page for every module since those pages are generated by rustdoc.

  2. jyn514 commented on Feb 6, 2020

    @jyn514
    Member

    Or in other words: just finding which features are available is simple, we just parse Cargo.toml; finding what changes when a given feature is enabled/disabled requires expanding macros and parsing the code and also lies on a weird boundary between cargo and rustdoc.

  3. jyn514 commented on Mar 19, 2020

    @jyn514
    Member

    There's an extension that adds this already and I like their approach - they put an extra Features drop-down in the header at the top.

    https://rust-search-extension.now.sh/feature-flags.png

  4. jyn514 commented on Apr 24, 2020

    @jyn514
    Member

    Relevant code:

  5. Nemo157 commented on May 6, 2020

    @Nemo157
    Contributor

    One change I would suggest for the example drop-down would be to highlight the default feature, maybe by moving it to the top and adding a little whitespace/horizontal rule between it and the rest.

  6. added
    E-mediumEffort: This requires a fair amount of work
    and removed on Jun 27, 2020
  7. jyn514 commented on Nov 16, 2020

    @jyn514
    Member

    This was added in #1144.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Web frontendE-mediumEffort: This requires a fair amount of workP-mediumMedium priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions