Browse Source

Add inter-linking between different forms of documentations and examples

pull/1018/head
Emil Ernerfeldt 3 years ago
parent
commit
0960f38552
  1. 6
      eframe/README.md
  2. 2
      eframe/src/lib.rs
  3. 5
      egui/examples/README.md
  4. 3
      egui_demo_lib/README.md
  5. 2
      epaint/src/text/fonts.rs

6
eframe/README.md

@ -10,6 +10,10 @@
To get started, go to <https://github.com/emilk/eframe_template/> and follow the instructions there!
You can also take a look at [the `eframe` examples folder](https://github.com/emilk/egui/tree/master/eframe/examples). There is also an excellent tutorial video at <https://www.youtube.com/watch?v=NtUkr_z7l84>.
For how to use `egui`, see [the egui docs](https://docs.rs/egui).
---
`eframe` is a very thin crate that re-exports [`egui`](https://github.com/emilk/egui) and[`epi`](https://github.com/emilk/egui/tree/master/epi) with thin wrappers over the backends.
@ -34,7 +38,7 @@ eframe = { version = "*", default-features = false, features = ["default_fonts",
## Companion crates
Not all rust crates work when compiles to WASM, but here are some useful crates have been designed to work well both natively and as WASM:
Not all rust crates work when compiled to WASM, but here are some useful crates have been designed to work well both natively and as WASM:
* Audio: [`cpal`](https://github.com/RustAudio/cpal).
* HTTP client: [`ehttp`](https://github.com/emilk/ehttp).

2
eframe/src/lib.rs

@ -6,6 +6,8 @@
//!
//! To get started, look at <https://github.com/emilk/eframe_template>.
//!
//! You can also take a look at [the `eframe` examples folder](https://github.com/emilk/egui/tree/master/eframe/examples).
//!
//! You write your application code for [`epi`] (implementing [`epi::App`]) and then
//! call from [`crate::run_native`] your `main.rs`, and/or call `eframe::start_web` from your `lib.rs`.
//!

5
egui/examples/README.md

@ -0,0 +1,5 @@
There are no stand-alone egui examples, because egui is not stand-alone!
There are plenty of examples in [the online demo](https://emilk.github.io/egui/). You can find the source code for it at <https://github.com/emilk/egui/tree/master/egui_demo_lib>.
If you are using `eframe`, check out [the `eframe` examples](https://github.com/emilk/egui/tree/master/eframe/examples) and [the `eframe` template repository](https://github.com/emilk/eframe_template/).

3
egui_demo_lib/README.md

@ -8,7 +8,8 @@
This crate contains example code for [`egui`](https://github.com/emilk/egui).
It is in a separate crate for two reasons:
The demo library is a separate crate for three reasons:
* To ensure it only uses the public `egui` api.
* To remove the amount of code in `egui` proper.
* To make it easy for other integrations to use the egui demos a test.

2
epaint/src/text/fonts.rs

@ -56,7 +56,7 @@ pub enum FontFamily {
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct FontData {
/// The data of a `.ttf` or `.otf` file.
/// The content of a `.ttf` or `.otf` file.
pub font: std::borrow::Cow<'static, [u8]>,
/// Which font face in the file to use.
/// When in doubt, use `0`.

Loading…
Cancel
Save