docs(examples): move gauge example to examples folder (#1646)
This commit is contained in:
9
Cargo.lock
generated
9
Cargo.lock
generated
@@ -1140,6 +1140,15 @@ dependencies = [
|
||||
"slab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gauge"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"color-eyre",
|
||||
"crossterm",
|
||||
"ratatui",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
|
||||
@@ -85,6 +85,10 @@ This interactive example shows how to use the flex layouts. [Source](./apps/flex
|
||||
|
||||
This example shows how to create a simple TUI with a text. [Source](./apps/hello-world/).
|
||||
|
||||
## Gauge demo
|
||||
|
||||
This example shows different types of gauges. [Source](./apps/gauge/).
|
||||
|
||||
## Input form
|
||||
|
||||
Shows how to render a form with input fields. [Source](./apps/input-form/).
|
||||
|
||||
14
examples/apps/gauge/Cargo.toml
Normal file
14
examples/apps/gauge/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "gauge"
|
||||
publish = false
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
color-eyre.workspace = true
|
||||
crossterm.workspace = true
|
||||
ratatui.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
9
examples/apps/gauge/README.md
Normal file
9
examples/apps/gauge/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Gauge demo
|
||||
|
||||
This example shows different types of gauges.
|
||||
|
||||
To run this demo:
|
||||
|
||||
```shell
|
||||
cargo run -p gauge
|
||||
```
|
||||
@@ -1,18 +1,10 @@
|
||||
//! # [Ratatui] Gauge example
|
||||
//!
|
||||
//! The latest version of this example is available in the [examples] folder in the repository.
|
||||
//!
|
||||
//! Please note that the examples are designed to be run against the `main` branch of the Github
|
||||
//! repository. This means that you may not be able to compile with the latest release version on
|
||||
//! crates.io, or the one that you have installed locally.
|
||||
//!
|
||||
//! See the [examples readme] for more information on finding examples that match the version of the
|
||||
//! library you are using.
|
||||
//!
|
||||
//! [Ratatui]: https://github.com/ratatui/ratatui
|
||||
//! [examples]: https://github.com/ratatui/ratatui/blob/main/examples
|
||||
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
|
||||
|
||||
/// A Ratatui example that demonstrates different types of gauges.
|
||||
///
|
||||
/// This example runs with the Ratatui library code in the branch that you are currently
|
||||
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
|
||||
/// release.
|
||||
///
|
||||
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
|
||||
use std::time::Duration;
|
||||
|
||||
use color_eyre::Result;
|
||||
Reference in New Issue
Block a user