diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml new file mode 100644 index 00000000..93584b80 --- /dev/null +++ b/.github/workflows/check-docs.yml @@ -0,0 +1,23 @@ +name: Check documentation + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + RUSTDOCFLAGS: '--cfg docsrs -D warnings' + +jobs: + # We test documentation using nightly to match docs.rs. + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Install nightly Rust + run: rustup default nightly + - name: Check docs + run: cargo doc --workspace --no-deps --document-private-items diff --git a/fidget/src/lib.rs b/fidget/src/lib.rs index 4770b9b1..ab7b9260 100644 --- a/fidget/src/lib.rs +++ b/fidget/src/lib.rs @@ -262,6 +262,7 @@ //! //! # Feature flags #![doc = document_features::document_features!()] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn(missing_docs)] // Re-export everything from fidget::core into the top-level namespace diff --git a/fidget/src/render/config.rs b/fidget/src/render/config.rs index 338545c4..4ad43769 100644 --- a/fidget/src/render/config.rs +++ b/fidget/src/render/config.rs @@ -81,7 +81,7 @@ pub struct ImageRenderConfig { /// Tile sizes to use during evaluation. /// /// You'll likely want to use - /// [`RenderHints::tile_sizes_2d`](crate::shape::RenderHints::tile_sizes_2d) + /// [`RenderHints::tile_sizes_2d`](crate::render::RenderHints::tile_sizes_2d) /// to select this based on evaluator type. pub tile_sizes: TileSizes, @@ -130,7 +130,7 @@ pub struct VoxelRenderConfig { /// Tile sizes to use during evaluation. /// /// You'll likely want to use - /// [`RenderHints::tile_sizes_3d`](crate::shape::RenderHints::tile_sizes_3d) + /// [`RenderHints::tile_sizes_3d`](crate::render::RenderHints::tile_sizes_3d) /// to select this based on evaluator type. pub tile_sizes: TileSizes,