Skip to content

Commit

Permalink
docs(iroh): improved feature flag documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed May 3, 2024
1 parent b967bd5 commit 54ec489
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:

check_fmt_and_docs:
timeout-minutes: 30
name: Checking fmt and docs
name: Checking fmt
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
Expand All @@ -123,8 +123,23 @@ jobs:
- name: fmt
run: cargo fmt --all -- --check

name: Checking docs
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2024-05-02
- name: Install sccache
uses: mozilla-actions/[email protected]

- name: Docs
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs

clippy_check:
timeout-minutes: 30
Expand Down
6 changes: 6 additions & 0 deletions iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ testdir = "0.9.1"
tokio = { version = "1", features = ["macros", "io-util", "rt"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[package.metadata.docs.rs]
all-features = true
# enable unstable features in the documentation
rustdoc-args = ["--cfg", "docsrs"]


[[example]]
name = "hello-world-provide"

Expand Down
8 changes: 8 additions & 0 deletions iroh/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
//! Send data over the internet.
//!
//! ## Feature Flags
//!
//! - `metrics`: Enable metrics collection
//! - `fs-store`: Enables the disk based storage backend for `iroh-bytes`.
//!
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(missing_docs, rustdoc::broken_intra_doc_links)]

// re-export the iroh crates
Expand All @@ -20,4 +27,5 @@ mod sync_engine;

/// Expose metrics module
#[cfg(feature = "metrics")]
#[cfg_attr(all(docsrs, feature = "metrics"), doc(cfg(feature = "metrics")))]
pub mod metrics;

0 comments on commit 54ec489

Please sign in to comment.