From f74347aac73bd256dc612811a8fe39475a762038 Mon Sep 17 00:00:00 2001 From: Jonathan Goren Date: Sun, 31 Mar 2024 16:12:54 +0300 Subject: [PATCH 1/2] Add features to generated docs --- Cargo.toml | 4 ++++ src/lib.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 33fe7ba..76d7d69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -131,3 +131,7 @@ required-features = ["std"] name = "benchmarks" harness = false required-features = ["std"] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/src/lib.rs b/src/lib.rs index f0f00b4..4c260bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,6 +195,7 @@ #![deny(rustdoc::broken_intra_doc_links)] #![deny(rustdoc::redundant_explicit_links)] #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] extern crate alloc; @@ -280,5 +281,6 @@ pub use world::World; pub(crate) use query::ArchetypeSearcher; pub(crate) use vtable::ComponentVTable; +#[doc(inline)] #[cfg(feature = "derive")] pub use flax_derive::*; From 88cf4782788441bf54bc36255601ebffd9c02305 Mon Sep 17 00:00:00 2001 From: Jonathan Goren Date: Sun, 31 Mar 2024 16:15:53 +0300 Subject: [PATCH 2/2] Fix broken doc links in readme and lib.rs --- README.md | 10 +++++----- src/lib.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1a5e7c3..fe2cb7a 100644 --- a/README.md +++ b/README.md @@ -19,17 +19,17 @@ Consider reading the [User Guide](https://ten3roberts.github.io/flax/guide) ## Features - [Declarative component macro](https://docs.rs/flax/latest/flax/macro.component.html) -- [Expressive query system](https://docs.rs/flax/latest/flax/struct.Query.html) -- [Change detection](https://docs.rs/flax/latest/flax/struct.Component.html#method.modified) +- [Expressive query system](https://docs.rs/flax/latest/flax/query/struct.Query.html) +- [Change detection](https://docs.rs/flax/latest/flax/component/struct.Component.html#method.modified) - [Query filtering](https://docs.rs/flax/latest/flax/filter/index.html) - [System execution](https://docs.rs/flax/latest/flax/system/struct.System.html) - [Multithreaded system execution](https://docs.rs/flax/latest/flax/schedule/struct.Schedule.html) - [Many to many entity relation and graphs](https://docs.rs/flax/latest/flax/macro.component.html#relations) - [Reflection through component metadata](https://docs.rs/flax/latest/flax/macro.component.html) -- [Ergonomic entity builder](https://docs.rs/flax/latest/flax/struct.EntityBuilder.html) +- [Ergonomic entity builder](https://docs.rs/flax/latest/flax/entity/struct.EntityBuilder.html) - [Serialization and deserialization](https://docs.rs/flax/latest/flax/serialize/) -- [(async) event subscription](https://docs.rs/flax/latest/flax/struct.World.html#method.subscribe) -- [Runtime components](https://docs.rs/flax/latest/flax/struct.World.html#method.spawn_component) +- [(async) event subscription](https://docs.rs/flax/latest/flax/world/struct.World.html#method.subscribe) +- [Runtime components](https://docs.rs/flax/latest/flax/world/struct.World.html#method.spawn_component) - ...and more ## [Live Demo](https://ten3roberts.github.io/flax/asteroids) diff --git a/src/lib.rs b/src/lib.rs index 4c260bc..7e7b83f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,17 +9,17 @@ //! ## Features //! //! - [Declarative component macro](https://docs.rs/flax/latest/flax/macro.component.html) -//! - [Queries](https://docs.rs/flax/latest/flax/struct.Query.html) -//! - [Change detection](https://docs.rs/flax/latest/flax/struct.Component.html#method.modified) +//! - [Expressive query system](https://docs.rs/flax/latest/flax/query/struct.Query.html) +//! - [Change detection](https://docs.rs/flax/latest/flax/component/struct.Component.html#method.modified) //! - [Query filtering](https://docs.rs/flax/latest/flax/filter/index.html) //! - [System execution](https://docs.rs/flax/latest/flax/system/struct.System.html) //! - [Multithreaded system execution](https://docs.rs/flax/latest/flax/schedule/struct.Schedule.html) //! - [Many to many entity relation and graphs](https://docs.rs/flax/latest/flax/macro.component.html#relations) //! - [Reflection through component metadata](https://docs.rs/flax/latest/flax/macro.component.html) -//! - [Ergonomic entity builder](https://docs.rs/flax/latest/flax/struct.EntityBuilder.html) +//! - [Ergonomic entity builder](https://docs.rs/flax/latest/flax/entity/struct.EntityBuilder.html) //! - [Serialization and deserialization](https://docs.rs/flax/latest/flax/serialize/) -//! - [(async) event subscription](https://docs.rs/flax/latest/flax/struct.World.html#method.subscribe) -//! - [Runtime components](https://docs.rs/flax/latest/flax/struct.World.html#method.spawn_component) +//! - [(async) event subscription](https://docs.rs/flax/latest/flax/world/struct.World.html#method.subscribe) +//! - [Runtime components](https://docs.rs/flax/latest/flax/world/struct.World.html#method.spawn_component) //! - ...and more //! //! ## [Live Demo](https://ten3roberts.github.io/flax/asteroids)