docs(examples): move table example to examples folder (#1657)
This commit is contained in:
12
Cargo.lock
generated
12
Cargo.lock
generated
@@ -3303,6 +3303,18 @@ dependencies = [
|
||||
"syn 2.0.98",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "table"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"color-eyre",
|
||||
"crossterm",
|
||||
"fakeit",
|
||||
"itertools 0.13.0",
|
||||
"ratatui",
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "target-triple"
|
||||
version = "0.1.3"
|
||||
|
||||
@@ -118,18 +118,6 @@ Shows how to handle mouse events. [Source](./apps/mouse-drawing/).
|
||||
|
||||
Shows how to create a minimal application. [Source](./apps/minimal/).
|
||||
|
||||
## Panic demo
|
||||
|
||||
Shows how to handle panics in your application. [Source](./apps/panic/).
|
||||
|
||||
## Popup demo
|
||||
|
||||
Shows how to handle popups. [Source](./apps/popup/).
|
||||
|
||||
## Tracing demo
|
||||
|
||||
Shows how to use the [tracing](https://crates.io/crates/tracing) crate to log to a file. [Source](./apps/tracing/).
|
||||
|
||||
## Weather demo
|
||||
|
||||
Shows how to render weather data using barchart widget. [Source](./apps/weather/).
|
||||
|
||||
17
examples/apps/table/Cargo.toml
Normal file
17
examples/apps/table/Cargo.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "table"
|
||||
publish = false
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
color-eyre.workspace = true
|
||||
crossterm.workspace = true
|
||||
fakeit = "1.1"
|
||||
itertools.workspace = true
|
||||
ratatui.workspace = true
|
||||
unicode-width.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
9
examples/apps/table/README.md
Normal file
9
examples/apps/table/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Table demo
|
||||
|
||||
This example shows how to create an interactive table.
|
||||
|
||||
To run this demo:
|
||||
|
||||
```shell
|
||||
cargo run -p table
|
||||
```
|
||||
@@ -1,18 +1,10 @@
|
||||
//! # [Ratatui] Table 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 how to create an interactive table with a scrollbar.
|
||||
///
|
||||
/// 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 crossterm::event::KeyModifiers;
|
||||
use itertools::Itertools;
|
||||
@@ -152,11 +152,6 @@ name = "scrollbar-widget"
|
||||
required-features = ["crossterm"]
|
||||
doc-scrape-examples = true
|
||||
|
||||
[[example]]
|
||||
name = "table-widget"
|
||||
required-features = ["crossterm"]
|
||||
doc-scrape-examples = true
|
||||
|
||||
[[example]]
|
||||
name = "user_input"
|
||||
required-features = ["crossterm"]
|
||||
|
||||
Reference in New Issue
Block a user