diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b99b86..c0bf647 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -260,11 +260,13 @@ jobs: with: save-if: ${{ github.event_name != 'merge_group' }} - # We test documentation using nightly to match docs.rs. This prevents potential breakages + # We test documentation using nightly to match docs.rs. - name: cargo doc - run: cargo doc --workspace --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples + run: cargo doc --workspace --locked --all-features --no-deps --document-private-items + env: + RUSTDOCFLAGS: '--cfg docsrs -D warnings' - # If this fails, consider changing your text or adding something to .typos.toml + # If this fails, consider changing your text or adding something to .typos.toml. typos: runs-on: ubuntu-latest steps: diff --git a/color/Cargo.toml b/color/Cargo.toml index 6e00619..1bccfdf 100644 --- a/color/Cargo.toml +++ b/color/Cargo.toml @@ -12,17 +12,17 @@ rust-version.workspace = true # Whilst we prepare the initial release publish = false -[features] -default = ["std"] -std = [] -libm = ["dep:libm"] - [package.metadata.docs.rs] all-features = true +# There are no platform specific docs. default-target = "x86_64-unknown-linux-gnu" -# Color is entirely platform-agnostic, so only display docs for one platform targets = [] +[features] +default = ["std"] +std = [] +libm = ["dep:libm"] + [dependencies] [dependencies.libm] diff --git a/color/src/lib.rs b/color/src/lib.rs index 4fcd679..f854196 100644 --- a/color/src/lib.rs +++ b/color/src/lib.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg_attr(all(not(feature = "std"), not(test)), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] // LINEBENDER LINT SET - v1 // See https://linebender.org/wiki/canonical-lints/ // These lints aren't included in Cargo.toml because they diff --git a/color/src/tagged.rs b/color/src/tagged.rs index f35e216..dc3e9d9 100644 --- a/color/src/tagged.rs +++ b/color/src/tagged.rs @@ -34,7 +34,7 @@ pub enum ColorspaceTag { } /// A color with a runtime colorspace tag. This type will likely get merged with -/// [`CssColor`]. +/// [`CssColor`][crate::css::CssColor]. #[derive(Clone, Copy, Debug)] pub struct TaggedColor { pub cs: ColorspaceTag, diff --git a/color_operations/Cargo.toml b/color_operations/Cargo.toml index a654368..4f2223f 100644 --- a/color_operations/Cargo.toml +++ b/color_operations/Cargo.toml @@ -12,17 +12,17 @@ rust-version.workspace = true # Whilst we prepare the initial release publish = false -[features] -default = ["std"] -std = ["color/std"] -libm = ["color/libm"] - [package.metadata.docs.rs] all-features = true +# There are no platform specific docs. default-target = "x86_64-unknown-linux-gnu" -# Color is entirely platform-agnostic, so only display docs for one platform targets = [] +[features] +default = ["std"] +std = ["color/std"] +libm = ["color/libm"] + [dependencies] color = { workspace = true, default-features = false } diff --git a/color_operations/src/lib.rs b/color_operations/src/lib.rs index b9d81ac..309efa9 100644 --- a/color_operations/src/lib.rs +++ b/color_operations/src/lib.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg_attr(all(not(feature = "std"), not(test)), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] // LINEBENDER LINT SET - v1 // See https://linebender.org/wiki/canonical-lints/ // These lints aren't included in Cargo.toml because they