Skip to content

Commit f138131

Browse files
committed
Improve top-level crate docs, and sort features is Cargo.toml
1 parent 8ef4439 commit f138131

File tree

7 files changed

+43
-38
lines changed

7 files changed

+43
-38
lines changed

crates/eframe/Cargo.toml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,23 @@ default = [
3939
## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/).
4040
accesskit = ["egui/accesskit", "egui-winit/accesskit"]
4141

42+
# Allow crates to choose an android-activity backend via Winit
43+
# - It's important that most applications should not have to depend on android-activity directly, and can
44+
# rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
45+
# - It's also important that we don't impose an android-activity backend by taking this choice away from applications.
46+
47+
## Enable the `game-activity` backend via `egui-winit` on Android
48+
android-game-activity = ["egui-winit/android-game-activity"]
49+
## Enable the `native-activity` backend via `egui-winit` on Android
50+
android-native-activity = ["egui-winit/android-native-activity"]
51+
4252
## If set, egui will use `include_bytes!` to bundle some fonts.
4353
## If you plan on specifying your own fonts you may disable this feature.
4454
default_fonts = ["egui/default_fonts"]
4555

4656
## Use [`glow`](https://github.com/grovesNL/glow) for painting, via [`egui_glow`](https://github.com/emilk/egui/tree/master/crates/egui_glow).
4757
glow = ["dep:glow", "dep:egui_glow", "dep:glutin", "dep:glutin-winit"]
4858

49-
## Enables wayland support and fixes clipboard issue.
50-
wayland = ["egui-winit/wayland"]
51-
52-
## Enables compiling for x11.
53-
x11 = ["egui-winit/x11"]
54-
5559
## Enable saving app state to disk.
5660
persistence = [
5761
"directories-next",
@@ -63,32 +67,29 @@ persistence = [
6367

6468
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
6569
##
66-
## Only enabled on native, because of the low resolution (1ms) of clocks in browsers.
6770
## `eframe` will call `puffin::GlobalProfiler::lock().new_frame()` for you
71+
##
72+
## Only enabled on native, because of the low resolution (1ms) of clocks in browsers.
6873
puffin = ["dep:puffin", "egui/puffin", "egui_glow?/puffin", "egui-wgpu?/puffin"]
6974

75+
## Enables wayland support and fixes clipboard issue.
76+
wayland = ["egui-winit/wayland"]
77+
7078
## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web.
7179
##
72-
## For other platforms, use the "accesskit" feature instead.
80+
## For other platforms, use the `accesskit` feature instead.
7381
web_screen_reader = ["tts"]
7482

75-
## If set, eframe will look for the env-var `EFRAME_SCREENSHOT_TO` and write a screenshot to that location, and then quit.
76-
## This is used to generate images for the examples.
77-
__screenshot = []
78-
7983
## Use [`wgpu`](https://docs.rs/wgpu) for painting (via [`egui-wgpu`](https://github.com/emilk/egui/tree/master/crates/egui-wgpu)).
8084
## This overrides the `glow` feature.
8185
wgpu = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster", "dep:raw-window-handle"]
8286

83-
# Allow crates to choose an android-activity backend via Winit
84-
# - It's important that most applications should not have to depend on android-activity directly, and can
85-
# rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
86-
# - It's also important that we don't impose an android-activity backend by taking this choice away from applications.
87+
## Enables compiling for x11.
88+
x11 = ["egui-winit/x11"]
8789

88-
## Enable the `native-activity` backend via `egui-winit` on Android
89-
android-native-activity = ["egui-winit/android-native-activity"]
90-
## Enable the `game-activity` backend via `egui-winit` on Android
91-
android-game-activity = ["egui-winit/android-game-activity"]
90+
## If set, eframe will look for the env-var `EFRAME_SCREENSHOT_TO` and write a screenshot to that location, and then quit.
91+
## This is used to generate images for examples.
92+
__screenshot = []
9293

9394
[dependencies]
9495
egui = { version = "0.22.0", path = "../egui", default-features = false, features = [

crates/egui-winit/Cargo.toml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ default = ["clipboard", "links", "wayland", "winit/default", "x11"]
2323
## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/).
2424
accesskit = ["accesskit_winit", "egui/accesskit"]
2525

26+
# Allow crates to choose an android-activity backend via Winit
27+
# - It's important that most applications should not have to depend on android-activity directly, and can
28+
# rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
29+
# - It's also important that we don't impose an android-activity backend by taking this choice away from applications.
30+
## Enable the `game-activity` backend via Winit on Android
31+
android-game-activity = ["winit/android-game-activity"]
32+
## Enable the `native-activity` backend via Winit on Android
33+
android-native-activity = ["winit/android-native-activity"]
34+
2635
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`egui::epaint::Vertex`], [`egui::Vec2`] etc to `&[u8]`.
2736
bytemuck = ["egui/bytemuck"]
2837

@@ -45,16 +54,6 @@ wayland = ["winit/wayland"]
4554
## Enables compiling for x11.
4655
x11 = ["winit/x11"]
4756

48-
# Allow crates to choose an android-activity backend via Winit
49-
# - It's important that most applications should not have to depend on android-activity directly, and can
50-
# rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
51-
# - It's also important that we don't impose an android-activity backend by taking this choice away from applications.
52-
53-
## Enable the `native-activity` backend via Winit on Android
54-
android-native-activity = ["winit/android-native-activity"]
55-
## Enable the `game-activity` backend via Winit on Android
56-
android-game-activity = ["winit/android-game-activity"]
57-
5857
[dependencies]
5958
egui = { version = "0.22.0", path = "../egui", default-features = false, features = [
6059
"log",

crates/egui/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ all-features = true
2222
[features]
2323
default = ["default_fonts"]
2424

25+
## Exposes detailed accessibility implementation required by platform
26+
## accessibility APIs. Also requires support in the egui integration.
27+
accesskit = ["dep:accesskit"]
28+
2529
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`epaint::Vertex`], [`emath::Vec2`] etc to `&[u8]`.
2630
bytemuck = ["epaint/bytemuck"]
2731

@@ -81,8 +85,6 @@ ahash = { version = "0.8.1", default-features = false, features = [
8185
nohash-hasher = "0.2"
8286

8387
#! ### Optional dependencies
84-
## Exposes detailed accessibility implementation required by platform
85-
## accessibility APIs. Also requires support in the egui integration.
8688
accesskit = { version = "0.11", optional = true }
8789

8890
backtrace = { version = "0.3", optional = true }

crates/egui/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
//! Then you add a [`Window`] or a [`SidePanel`] to get a [`Ui`], which is what you'll be using to add all the buttons and labels that you need.
1313
//!
1414
//!
15+
//! ## Feature flags
16+
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
17+
//!
18+
//!
1519
//! # Using egui
1620
//!
1721
//! To see what is possible to build with egui you can check out the online demo at <https://www.egui.rs/#demo>.
@@ -325,10 +329,6 @@
325329
//! }); // the temporary settings are reverted here
326330
//! # });
327331
//! ```
328-
//!
329-
//! ## Feature flags
330-
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
331-
//!
332332
333333
#![allow(clippy::float_cmp)]
334334
#![allow(clippy::manual_range_contains)]

crates/egui_glow/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! [`egui`] bindings for [`glow`](https://github.com/grovesNL/glow).
22
//!
3-
//! The main types you want to look are are [`Painter`].
3+
//! The main type you want to look at is [`Painter`].
44
//!
55
//! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead.
66
//!

crates/egui_plot/src/items/values.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ impl PlotPoint {
4747

4848
// ----------------------------------------------------------------------------
4949

50+
/// Solid, dotted, dashed, etc.
5051
#[derive(Debug, PartialEq, Clone, Copy)]
5152
pub enum LineStyle {
5253
Solid,
@@ -319,6 +320,7 @@ impl PlotPoints {
319320

320321
// ----------------------------------------------------------------------------
321322

323+
/// Circle, Diamond, Square, Cross, …
322324
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
323325
pub enum MarkerShape {
324326
Circle,

crates/egui_plot/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Simple plotting library.
1+
//! Simple plotting library for [`egui`](https://github.com/emilk/egui).
22
//!
33
//! ## Feature flags
44
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
@@ -77,6 +77,7 @@ impl Default for CoordinatesFormatter {
7777

7878
const MIN_LINE_SPACING_IN_POINTS: f64 = 6.0; // TODO(emilk): large enough for a wide label
7979

80+
/// Two bools, one for each axis (X and Y).
8081
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
8182
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
8283
pub struct AxisBools {

0 commit comments

Comments
 (0)