Skip to content

Commit

Permalink
chore: Hide elements events autocompletion modules in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Jan 8, 2025
1 parent 36f9cae commit 89e0917
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions crates/elements/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repository = "https://github.com/marc2332/freya"
keywords = ["gui", "ui", "desktop", "skia", "dioxus"]
categories = ["gui", "asynchronous"]

[features]
docs = []

[dependencies]
torin = { workspace = true }

Expand Down
8 changes: 3 additions & 5 deletions crates/elements/src/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,12 +940,13 @@ pub mod events {
false,
).into()
}


#[cfg(not(feature = "docs"))]
#[doc(hidden)]
$( #[$attr] )*
pub mod $name {
use super::*;

// When expanding the macro, we use this version of the function if we see an inline closure to give better type inference
$( #[$attr] )*
pub fn call_with_explicit_closure<
Expand All @@ -961,9 +962,6 @@ pub mod events {
)*
};

(@name $name:ident $event:literal) => {
$event
};
(@name $name:ident) => {
stringify!($name)
};
Expand Down
2 changes: 1 addition & 1 deletion crates/freya/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ default = ["skia"]
performance-overlay = []
fade-cached-incremental-areas = ["freya-core/fade-cached-incremental-areas"]
disable-zoom-shortcuts = ["freya-renderer/disable-zoom-shortcuts"]
docs = ["dep:freya-testing", "dep:dioxus-i18n", "dep:dioxus-router"]
docs = ["dep:freya-testing", "dep:dioxus-i18n", "dep:dioxus-router", "freya-elements/docs"]

[dependencies]
freya-devtools = { workspace = true, optional = true }
Expand Down

0 comments on commit 89e0917

Please sign in to comment.