diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 403731b4ca2..c83ea28f388 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -39,7 +39,7 @@ jobs: - name: Generate Docs run: cargo doc --workspace --all-features --no-deps env: - RUSTDOCFLAGS: --cfg docsrs + RUSTDOCFLAGS: --cfg iroh_docsrs - name: Deploy Docs to Preview Branch uses: peaceiris/actions-gh-pages@v4 diff --git a/iroh/Cargo.toml b/iroh/Cargo.toml index 6ef27b308ea..b87689545e3 100644 --- a/iroh/Cargo.toml +++ b/iroh/Cargo.toml @@ -87,9 +87,7 @@ 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"] - +rustdoc-args = ["--cfg", "iroh_docsrs"] [[example]] name = "hello-world-provide" diff --git a/iroh/src/lib.rs b/iroh/src/lib.rs index 72957bc66b5..90f372c3ba9 100644 --- a/iroh/src/lib.rs +++ b/iroh/src/lib.rs @@ -88,7 +88,7 @@ //! - `metrics`: Enable metrics collection. Enabled by default. //! - `fs-store`: Enables the disk based storage backend for `iroh-blobs`. Enabled by default. //! -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(iroh_docsrs, feature(doc_cfg))] #![deny(missing_docs, rustdoc::broken_intra_doc_links)] // re-export the iroh crates @@ -111,5 +111,5 @@ mod rpc_protocol; /// Expose metrics module #[cfg(feature = "metrics")] -#[cfg_attr(all(docsrs, feature = "metrics"), doc(cfg(feature = "metrics")))] +#[cfg_attr(iroh_docsrs, doc(cfg(feature = "metrics")))] pub mod metrics; diff --git a/iroh/src/node/builder.rs b/iroh/src/node/builder.rs index 4bf07e3346e..3641a6b138a 100644 --- a/iroh/src/node/builder.rs +++ b/iroh/src/node/builder.rs @@ -121,6 +121,7 @@ where node_discovery: DiscoveryConfig, docs_storage: DocsStorage, #[cfg(any(test, feature = "test-utils"))] + #[cfg_attr(iroh_docsrs, doc(cfg(any(test, feature = "test-utils"))))] insecure_skip_relay_cert_verify: bool, /// Callback to register when a gc loop is done #[debug("callback")] @@ -509,6 +510,7 @@ where /// /// May only be used in tests. #[cfg(any(test, feature = "test-utils"))] + #[cfg_attr(iroh_docsrs, doc(cfg(any(test, feature = "test-utils"))))] pub fn insecure_skip_relay_cert_verify(mut self, skip_verify: bool) -> Self { self.insecure_skip_relay_cert_verify = skip_verify; self @@ -516,6 +518,7 @@ where /// Register a callback for when GC is done. #[cfg(any(test, feature = "test-utils"))] + #[cfg_attr(iroh_docsrs, doc(cfg(any(test, feature = "test-utils"))))] pub fn register_gc_done_cb(mut self, cb: Box) -> Self { self.gc_done_callback.replace(cb); self