From 4a1072f4d052b827a7b22966e0ab5e9cf6edb22e Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Sun, 21 Jul 2024 01:58:56 +0300 Subject: [PATCH] Add special configuration for docsrs https://github.com/bevyengine/bevy/pull/12366 https://github.com/bevyengine/bevy/pull/12642 --- Cargo.toml | 12 ++++++++++++ src/lib.rs | 1 + 2 files changed, 13 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 2d094fa..b5e4ed5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,10 @@ categories = ["game-development", "network-programming"] license = "MIT OR Apache-2.0" include = ["/src", "/tests", "LICENSE*"] +[package.metadata.docs.rs] +rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"] +all-features = true + [dependencies] bevy_replicon = { version = "0.27", default-features = false } bevy_renet = { version = "0.0.12", default-features = false } @@ -49,3 +53,11 @@ renet_transport = ["bevy_renet/transport"] [[test]] name = "transport" required-features = ["server", "client", "renet_transport"] + +[[example]] +name = "simple_box" +required-features = ["server", "client", "renet_transport"] + +[[example]] +name = "tic_tac_toe" +required-features = ["server", "client", "renet_transport"] diff --git a/src/lib.rs b/src/lib.rs index 8fa2822..b7eab04 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,7 @@ let connection_config = ConnectionConfig { For a full example of how to initialize a server or client see the example in the repository. */ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(feature = "client")] pub mod client;