mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-27 04:50:46 +00:00
docs(examples): move flex example to examples folder (#1642)
This commit is contained in:
parent
f5fde0ef53
commit
fa8ca0121a
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -993,6 +993,16 @@ version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
|
||||
|
||||
[[package]]
|
||||
name = "flex"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"color-eyre",
|
||||
"crossterm",
|
||||
"ratatui",
|
||||
"strum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
|
@ -73,6 +73,10 @@ This interactive example shows how different constraints can be used to layout w
|
||||
|
||||
This example shows different types of constraints. [Source](./apps/constraints/).
|
||||
|
||||
## Flex demo
|
||||
|
||||
This interactive example shows how to use the flex layouts. [Source](./apps/flex/).
|
||||
|
||||
## Hello World demo
|
||||
|
||||
This example shows how to create a simple TUI with a text. [Source](./apps/hello-world/).
|
||||
|
15
examples/apps/flex/Cargo.toml
Normal file
15
examples/apps/flex/Cargo.toml
Normal file
@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "flex"
|
||||
publish = false
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
color-eyre.workspace = true
|
||||
crossterm.workspace = true
|
||||
ratatui.workspace = true
|
||||
strum.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
9
examples/apps/flex/README.md
Normal file
9
examples/apps/flex/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Flex demo
|
||||
|
||||
This interactive example shows how to use the flex layouts.
|
||||
|
||||
To run this demo:
|
||||
|
||||
```shell
|
||||
cargo run -p flex
|
||||
```
|
@ -1,18 +1,13 @@
|
||||
//! # [Ratatui] Flex 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 flex layouts.
|
||||
///
|
||||
/// You can also change the spacing between the constraints, and toggle between different types
|
||||
/// of flex layouts.
|
||||
///
|
||||
/// 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::num::NonZeroUsize;
|
||||
|
||||
use color_eyre::Result;
|
@ -152,11 +152,6 @@ name = "docsrs"
|
||||
required-features = ["crossterm"]
|
||||
doc-scrape-examples = false
|
||||
|
||||
[[example]]
|
||||
name = "flex"
|
||||
required-features = ["crossterm"]
|
||||
doc-scrape-examples = true
|
||||
|
||||
[[example]]
|
||||
name = "gauge-widget"
|
||||
required-features = ["crossterm"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user