docs(examples): move constraint-explorer example to examples folder (#1640)

This commit is contained in:
Orhun Parmaksız
2025-02-05 03:23:12 +03:00
committed by GitHub
parent 325f96102a
commit fc70288954
6 changed files with 50 additions and 20 deletions

11
Cargo.lock generated
View File

@@ -583,6 +583,17 @@ dependencies = [
"static_assertions", "static_assertions",
] ]
[[package]]
name = "constraint-explorer"
version = "0.0.0"
dependencies = [
"color-eyre",
"crossterm",
"itertools 0.13.0",
"ratatui",
"strum",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.10.0" version = "0.10.0"

View File

@@ -65,6 +65,10 @@ Shows how to render a canvas with different shapes. [Source](./apps/canvas/).
This example shows the full range of RGB colors in an animation. [Source](./apps/colors-rgb/). This example shows the full range of RGB colors in an animation. [Source](./apps/colors-rgb/).
## Constraint Explorer demo
This interactive example shows how different constraints can be used to layout widgets. [Source](./apps/constraint-explorer/).
## Hello World demo ## Hello World demo
This example shows how to create a simple TUI with a text. [Source](./apps/hello-world/). This example shows how to create a simple TUI with a text. [Source](./apps/hello-world/).

View File

@@ -0,0 +1,16 @@
[package]
name = "constraint-explorer"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
itertools.workspace = true
ratatui.workspace = true
strum.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Constraint explorer demo
This interactive example shows how different constraints can be used to layout widgets.
To run this demo:
```shell
cargo run -p constraint-explorer
```

View File

@@ -1,18 +1,13 @@
//! # [Ratatui] Constraint explorer example /// A Ratatui example that demonstrates how different layout constraints work.
//! ///
//! The latest version of this example is available in the [examples] folder in the repository. /// It also supports swapping constraints, adding and removing blocks, and changing the spacing
//! /// between blocks.
//! 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 /// This example runs with the Ratatui library code in the branch that you are currently
//! crates.io, or the one that you have installed locally. /// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
//! /// release.
//! See the [examples readme] for more information on finding examples that match the version of the ///
//! library you are using. /// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
//!
//! [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
use color_eyre::Result; use color_eyre::Result;
use itertools::Itertools; use itertools::Itertools;
use ratatui::{ use ratatui::{

View File

@@ -142,11 +142,6 @@ bench = false
name = "main" name = "main"
harness = false harness = false
[[example]]
name = "constraint-explorer"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]] [[example]]
name = "constraints" name = "constraints"
required-features = ["crossterm"] required-features = ["crossterm"]