Skip to content

Commit

Permalink
fix: generate docs for all features on docs.rs (#767)
Browse files Browse the repository at this point in the history
* fix: generate docs for all features

* ci: check for --cfg docsrs

* fix nit: rustdoc::broken_intra_doc_links
  • Loading branch information
niklasad1 committed May 13, 2022
1 parent 4fbf244 commit d821c7b
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -48,8 +48,22 @@ jobs:
command: clippy
args: --all-targets

- name: Check rustdoc links
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items
check-docs:
name: Check rustdoc
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: nightly
override: true

- name: Check rustdoc
run: RUSTDOCFLAGS="--cfg docsrs --deny rustdoc::broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items --all-features

check-code:
name: Check
Expand Down
7 changes: 7 additions & 0 deletions client/http-client/Cargo.toml
Expand Up @@ -29,3 +29,10 @@ tokio = { version = "1.16", features = ["net", "rt-multi-thread", "macros"] }
[features]
default = ["tls"]
tls = ["hyper-rustls/webpki-tokio"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true
7 changes: 7 additions & 0 deletions client/transport/Cargo.toml
Expand Up @@ -54,3 +54,10 @@ web = [
"anyhow",
"thiserror",
]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true
1 change: 1 addition & 0 deletions client/transport/src/lib.rs
Expand Up @@ -25,6 +25,7 @@
// DEALINGS IN THE SOFTWARE.

#![warn(missing_debug_implementations, missing_docs, unreachable_pub)]
#![cfg_attr(docsrs, feature(doc_cfg))]

//! # jsonrpsee-client-transports
//!
Expand Down
7 changes: 7 additions & 0 deletions client/ws-client/Cargo.toml
Expand Up @@ -23,3 +23,10 @@ serde_json = "1"
[features]
tls = ["jsonrpsee-client-transport/tls"]
default = ["tls"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true
7 changes: 7 additions & 0 deletions core/Cargo.toml
Expand Up @@ -68,3 +68,10 @@ async-wasm-client = [
serde_json = "1.0"
tokio = { version = "1.16", features = ["macros", "rt"] }
jsonrpsee = { path = "../jsonrpsee", features = ["server", "macros"] }

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true
1 change: 1 addition & 0 deletions core/src/lib.rs
Expand Up @@ -27,6 +27,7 @@
//! Shared utilities for `jsonrpsee`.

#![warn(missing_docs, missing_debug_implementations, unreachable_pub)]
#![cfg_attr(docsrs, feature(doc_cfg))]

// Macros useful internally within this crate, but not to be exposed outside of it.
#[macro_use]
Expand Down
7 changes: 7 additions & 0 deletions jsonrpsee/Cargo.toml
Expand Up @@ -37,3 +37,10 @@ macros = ["jsonrpsee-proc-macros", "jsonrpsee-types", "jsonrpsee-core/client", "
client = ["http-client", "ws-client", "wasm-client"]
server = ["http-server", "ws-server"]
full = ["client", "server", "macros", "async-client", "client-ws-transport"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true
2 changes: 2 additions & 0 deletions jsonrpsee/src/lib.rs
Expand Up @@ -48,6 +48,8 @@
//! - **`client-ws-transport`** - Enables `ws` transport with TLS.
//! - **`client-ws-transport-no-tls`** - Enables `ws` transport without TLS.

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

// Macros useful below, but not to be exposed outside of the crate.
#[macro_use]
mod macros;
Expand Down

0 comments on commit d821c7b

Please sign in to comment.