mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-02 15:25:54 +00:00
docs(examples): move popup example to examples folder (#1656)
see #1512
This commit is contained in:
parent
d87354f400
commit
7c40c0bbdd
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -2294,6 +2294,15 @@ dependencies = [
|
|||||||
"plotters-backend",
|
"plotters-backend",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "popup"
|
||||||
|
version = "0.0.0"
|
||||||
|
dependencies = [
|
||||||
|
"color-eyre",
|
||||||
|
"crossterm",
|
||||||
|
"ratatui",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "powerfmt"
|
name = "powerfmt"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -114,6 +114,10 @@ Shows how to handle mouse events. [Source](./apps/mouse-drawing/).
|
|||||||
|
|
||||||
Shows how to create a minimal application. [Source](./apps/minimal/).
|
Shows how to create a minimal application. [Source](./apps/minimal/).
|
||||||
|
|
||||||
|
## Popup demo
|
||||||
|
|
||||||
|
Shows how to handle popups. [Source](./apps/popup/).
|
||||||
|
|
||||||
## Weather demo
|
## Weather demo
|
||||||
|
|
||||||
Shows how to render weather data using barchart widget. [Source](./apps/weather/).
|
Shows how to render weather data using barchart widget. [Source](./apps/weather/).
|
||||||
|
14
examples/apps/popup/Cargo.toml
Normal file
14
examples/apps/popup/Cargo.toml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[package]
|
||||||
|
name = "popup"
|
||||||
|
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/popup/README.md
Normal file
9
examples/apps/popup/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Popup demo
|
||||||
|
|
||||||
|
This example shows how to render line, bar, and scatter charts.
|
||||||
|
|
||||||
|
To run this demo:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cargo run -p popup
|
||||||
|
```
|
@ -1,21 +1,12 @@
|
|||||||
//! # [Ratatui] Popup example
|
/// A Ratatui example that demonstrates how to handle popups.
|
||||||
//!
|
|
||||||
//! 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
|
|
||||||
|
|
||||||
// See also https://github.com/joshka/tui-popup and
|
// See also https://github.com/joshka/tui-popup and
|
||||||
// https://github.com/sephiroth74/tui-confirm-dialog
|
// https://github.com/sephiroth74/tui-confirm-dialog
|
||||||
|
///
|
||||||
|
/// 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 color_eyre::Result;
|
use color_eyre::Result;
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
crossterm::event::{self, Event, KeyCode, KeyEventKind},
|
crossterm::event::{self, Event, KeyCode, KeyEventKind},
|
@ -158,11 +158,6 @@ name = "panic"
|
|||||||
required-features = ["crossterm"]
|
required-features = ["crossterm"]
|
||||||
doc-scrape-examples = true
|
doc-scrape-examples = true
|
||||||
|
|
||||||
[[example]]
|
|
||||||
name = "popup"
|
|
||||||
required-features = ["crossterm"]
|
|
||||||
doc-scrape-examples = true
|
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "scrollbar-widget"
|
name = "scrollbar-widget"
|
||||||
required-features = ["crossterm"]
|
required-features = ["crossterm"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user