Skip to content

Commit

Permalink
Show proper cfgs on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Dec 24, 2023
1 parent 84d07ea commit 821a55d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
rustup default nightly
- name: Run Rustdoc
env:
RUSTDOCFLAGS: --crate-version main
RUSTDOCFLAGS: --crate-version main --cfg=docsrs
run: cargo doc --no-deps -Z rustdoc-map -Z rustdoc-scrape-examples --target wasm32-unknown-unknown
- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ name = "benchmark"
path = "benches/benchmark.rs"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg=docsrs"]
targets = ["wasm32-unknown-unknown"]

[lints.rust]
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
//! [`Performance.timeOrigin`]: https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin
//! [`wasm-bindgen`]: https://crates.io/crates/wasm-bindgen

#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(all(
target_family = "wasm",
not(any(target_os = "emscripten", target_os = "wasi"))
Expand All @@ -119,6 +121,7 @@ mod time;
),
docsrs
))]
#[cfg_attr(docsrs, doc(cfg(Web)))]
pub mod web;

#[cfg(not(all(
Expand Down

0 comments on commit 821a55d

Please sign in to comment.