1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00

Document feature flags using crate document-features (#1725)

This commit is contained in:
Emil Ernerfeldt
2022-06-09 15:27:22 +02:00
committed by GitHub
parent 218d4d4eea
commit 3169ce62d5
21 changed files with 193 additions and 83 deletions

View File

@@ -22,16 +22,17 @@ all-features = true
[features]
default = ["default_fonts", "glow"]
# detect dark mode system preference
## Detect dark mode system preference using [`dark-light`](https://docs.rs/dark-light).
dark-light = ["dep:dark-light"]
# If set, egui will use `include_bytes!` to bundle some fonts.
# If you plan on specifying your own fonts you may disable this feature.
## If set, egui will use `include_bytes!` to bundle some fonts.
## If you plan on specifying your own fonts you may disable this feature.
default_fonts = ["egui/default_fonts"]
## Use [`glow`](https://github.com/grovesNL/glow) for painting, via [`egui_glow`](https://github.com/emilk/egui/tree/master/egui_glow).
glow = ["dep:glow", "egui_glow"]
# Enable saving app state to disk.
## Enable saving app state to disk.
persistence = [
"directories-next",
"egui-winit/serde",
@@ -40,29 +41,34 @@ persistence = [
"serde",
]
# Enable profiling with the puffin crate: https://github.com/EmbarkStudios/puffin
# Only enabled on native, because of the low resolution (1ms) of time keeping in browsers.
# eframe will call `puffin::GlobalProfiler::lock().new_frame()` for you
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
##
## Only enabled on native, because of the low resolution (1ms) of time keeping in browsers.
## `eframe` will call `puffin::GlobalProfiler::lock().new_frame()` for you
puffin = ["dep:puffin", "egui_glow/puffin"]
# enable screen reader support (requires `ctx.options().screen_reader = true;`)
## Enable screen reader support (requires `ctx.options().screen_reader = true;`)
screen_reader = [
"egui-winit/screen_reader",
"tts",
]
# Use WGPU as the backend instead of glow
## Use [`wgpu`](https://docs.rs/wgpu) for painting (via [`egui_wgpu`](https://github.com/emilk/egui/tree/master/egui_wgpu)).
## This overrides the `glow` feature.
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",
] }
tracing = "0.1"
# optional:
#! ### Optional dependencies
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 }
@@ -133,6 +139,6 @@ web-sys = { version = "0.3.52", features = [
"Window",
] }
# optional:
# optional
# feature screen_reader
tts = { version = "0.20", optional = true } # stuck on old version due to compilation problems on linux

View File

@@ -52,6 +52,10 @@
//! eframe::start_web(canvas_id, Box::new(|cc| Box::new(MyApp::new(cc))))
//! }
//! ```
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!
#![allow(clippy::needless_doctest_main)]