diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f51b61a..4627681 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,3 +49,20 @@ jobs: with: components: miri - run: cargo miri test + + doc: + name: cargo doc + # NOTE: We don't have any platform specific docs in this workspace, so we only run on Ubuntu. + # If we get per-platform docs (win/macos/linux/wasm32/..) then doc jobs should match that. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: install nightly toolchain + uses: dtolnay/rust-toolchain@nightly + + # We test documentation using nightly to match docs.rs. + - name: cargo doc + run: cargo doc --workspace --all-features --no-deps --document-private-items + env: + RUSTDOCFLAGS: '--cfg docsrs -D warnings' diff --git a/Cargo.toml b/Cargo.toml index 6d84aa1..409dd9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,12 @@ repository = "https://github.com/dfrg/swash" homepage = "https://github.com/dfrg/swash" readme = "README.md" +[package.metadata.docs.rs] +all-features = true +# There are no platform specific docs. +default-target = "x86_64-unknown-linux-gnu" +targets = [] + [features] default = ["std", "scale", "render"] diff --git a/src/lib.rs b/src/lib.rs index 13000ee..74e399b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,7 @@ the respective modules. #![allow(clippy::needless_lifetimes)] #![allow(clippy::redundant_static_lifetimes)] #![allow(clippy::too_many_arguments)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(not(any(test, feature = "std")), no_std)] extern crate alloc; diff --git a/src/scale/mod.rs b/src/scale/mod.rs index 9fbabd5..8fdc44c 100644 --- a/src/scale/mod.rs +++ b/src/scale/mod.rs @@ -782,7 +782,7 @@ impl<'a> Render<'a> { } /// Specifies the target format for rasterizing an outline. Default is - /// [`Format::Alpha`](zeno::Format::Alpha). + /// [`Format::Alpha`]. pub fn format(&mut self, format: Format) -> &mut Self { self.format = format; self