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

Document feature flags and scrape examples #672

Merged
merged 3 commits into from
Jun 30, 2024

Commits on Jun 27, 2024

  1. Document feature flags

    - Use [document-features](https://crates.io/crates/document-features)
      crate to automatically add documentation about the features to the
      crate documentation at the crate level.
    - Use the doc_auto_cfg feature to automatically add documentation
      to every item that requires a feature flag to be enabled. This is
      behind a docsrs feature flag as it can only be enabled using the
      nightly toolchain and this allows the documentation to be built with
      the stable toolchain when the feature is not enabled. See
      <https://doc.rust-lang.org/rustdoc/unstable-features.html#doc_auto_cfg-automatically-generate-doccfg>
      for more information.
    - Automatically scrape example code into the documentation using the
      unstable rustdoc-scrape-examples feature. See
      <https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html> for
      more information.
    
    To test this change, run:
    ```shell
    RUSTDOCFLAGS="--cfg docsrs" \
      cargo +nightly doc \
        -Zunstable-options -Zrustdoc-scrape-examples \
        --all-features --no-deps --open
    ```
    joshka committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    882d0b4 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2024

  1. Configuration menu
    Copy the full SHA
    93f5865 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2024

  1. Configuration menu
    Copy the full SHA
    ddff4c4 View commit details
    Browse the repository at this point in the history