Make document-features an opt-in dependency

This commit is contained in:
Emil Ernerfeldt 2022-06-09 17:41:37 +02:00
parent 4525cad7af
commit 29973e5d02
20 changed files with 50 additions and 44 deletions

View file

@ -59,9 +59,6 @@ wgpu = ["dep:wgpu", "egui-wgpu"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
egui = { version = "0.18.0", path = "../egui", default-features = false, features = [
"bytemuck",
"tracing",
@ -69,6 +66,9 @@ egui = { version = "0.18.0", path = "../egui", default-features = false, feature
tracing = "0.1"
#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
egui_glow = { version = "0.18.0", path = "../egui_glow", optional = true, default-features = false }
egui-wgpu = { version = "0.18.0", path = "../egui-wgpu", optional = true, features = ["winit"] }
glow = { version = "0.11", optional = true }
@ -84,7 +84,7 @@ egui-winit = { version = "0.18.0", path = "../egui-winit", default-features = fa
glutin = { version = "0.28.0" }
winit = "0.26.1"
# optional:
# optional native:
puffin = { version = "0.13", optional = true }
directories-next = { version = "2", optional = true }

View file

@ -54,7 +54,7 @@
//! ```
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::needless_doctest_main)]

View file

@ -33,9 +33,6 @@ winit = ["dep:pollster", "dep:winit"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
egui = { version = "0.18.1", path = "../egui", default-features = false, features = [
"bytemuck",
] }
@ -46,5 +43,8 @@ type-map = "0.5.0"
wgpu = { version = "0.12", features = ["webgl"] }
#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
pollster = { version = "0.2", optional = true }
winit = { version = "0.26", optional = true }

View file

@ -1,7 +1,7 @@
//! This crates provides bindings between [`egui`](https://github.com/emilk/egui) and [wgpu](https://crates.io/crates/wgpu).
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(unsafe_code)]

View file

@ -41,9 +41,6 @@ serde = ["egui/serde", "dep:serde"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
egui = { version = "0.18.0", path = "../egui", default-features = false, features = [
"tracing",
] }
@ -51,13 +48,19 @@ instant = { version = "0.1", features = ["wasm-bindgen"] } # We use instant so w
tracing = "0.1"
winit = "0.26.1"
#! ### Optional dependencies
arboard = { version = "2.1", optional = true, default-features = false }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
puffin = { version = "0.13", optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
webbrowser = { version = "0.7", optional = true }
# feature screen_reader
tts = { version = "0.20", optional = true } # stuck on old version due to compilation problems on linux
webbrowser = { version = "0.7", optional = true }
[target.'cfg(any(target_os="linux", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies]
smithay-clipboard = { version = "0.6.3", optional = true }

View file

@ -4,7 +4,7 @@
//! updates the cursor, open links clicked in egui, etc.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::manual_range_contains)]

View file

@ -55,16 +55,17 @@ persistence = ["serde", "epaint/serde", "ron"]
serde = ["dep:serde", "epaint/serde"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
epaint = { version = "0.18.1", path = "../epaint", default-features = false }
ahash = "0.7"
nohash-hasher = "0.2"
#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
ron = { version = "0.7", optional = true }
serde = { version = "1", optional = true, features = ["derive", "rc"] }
# egui doesn't log much, but when it does, it uses `tracing`
# egui doesn't log much, but when it does, it uses [`tracing`](https://docs.rs/tracing).
tracing = { version = "0.1", optional = true }

View file

@ -293,7 +293,7 @@
//! ```
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]

View file

@ -30,17 +30,16 @@ syntax_highlighting = ["syntect"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
egui = { version = "0.18.0", path = "../egui", default-features = false }
egui_extras = { version = "0.18.0", path = "../egui_extras" }
enum-map = { version = "2", features = ["serde"] }
tracing = "0.1"
unicode_names2 = { version = "0.5.0", default-features = false }
# Optional:
#! ### Optional dependencies
chrono = { version = "0.4", optional = true, features = ["js-sys", "wasmbind"] }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
serde = { version = "1", optional = true, features = ["derive"] }
syntect = { version = "4", optional = true, default-features = false, features = ["default-fancy"] }

View file

@ -5,7 +5,7 @@
//! The demo is also used in benchmarks and tests.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]

View file

@ -47,6 +47,9 @@ egui = { version = "0.18.0", path = "../egui", default-features = false }
# Date operations needed for datepicker widget
chrono = { version = "0.4", optional = true }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
## Add support for loading images with the [`image`](https://docs.rs/image) crate.
##
## You also need to ALSO opt-in to the image formats you want to support, like so:
@ -65,6 +68,3 @@ serde = { version = "1", features = ["derive"], optional = true }
# feature "tracing"
tracing = { version = "0.1", optional = true }
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"

View file

@ -3,7 +3,7 @@
//! This crate are for experimental features, and features that require big dependencies that does not belong in `egui`.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]

View file

@ -39,9 +39,6 @@ screen_reader = ["egui-winit/screen_reader"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
egui = { version = "0.18.0", path = "../egui", default-features = false, features = [
"bytemuck",
] }
@ -51,5 +48,10 @@ ahash = "0.7"
bytemuck = "1.7"
glium = "0.31"
#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
[dev-dependencies]
image = { version = "0.24", default-features = false, features = ["png"] }

View file

@ -5,7 +5,7 @@
//! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]

View file

@ -47,9 +47,6 @@ winit = ["egui-winit",]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
egui = { version = "0.18.0", path = "../egui", default-features = false, features = [
"bytemuck",
] }
@ -59,6 +56,10 @@ glow = "0.11"
memoffset = "0.6"
tracing = "0.1"
#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
# Native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
egui-winit = { version = "0.18.0", path = "../egui-winit", optional = true, default-features = false }

View file

@ -5,7 +5,7 @@
//! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]

View file

@ -34,11 +34,11 @@ extra_asserts = []
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast `emath` types to `&[u8]`.
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
## [`mint`](https://docs.rs/mint) enables interopability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
mint = { version = "0.5.6", optional = true }
## Allow serialization using [`serde`](https://docs.rs/serde).
serde = { version = "1", optional = true, features = ["derive"] }
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"

View file

@ -16,7 +16,7 @@
//! and enable the `mint` feature flag in `emath` to enable implicit conversion to/from `emath`.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]

View file

@ -53,9 +53,6 @@ mint = ["emath/mint"]
serde = ["dep:serde", "ahash/serde", "emath/serde"]
[dependencies]
# Needed when generating the docs, but unfortunately also needed by `cargo check`
document-features = "0.2"
emath = { version = "0.18.0", path = "../emath" }
ab_glyph = "0.2.11"
@ -71,6 +68,9 @@ cint = { version = "0.3.1", optional = true }
## Enable the [`hex_color`] macro.
color-hex = { version = "0.2.0", optional = true }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
## Allow serialization using [`serde`](https://docs.rs/serde) .
serde = { version = "1", optional = true, features = ["derive", "rc"] }

View file

@ -6,7 +6,7 @@
//! that you can then paint using some graphics API of your choice (e.g. OpenGL).
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]