docs(examples): move inline example to examples folder (#1651)
This commit is contained in:
18
Cargo.lock
generated
18
Cargo.lock
generated
@@ -1554,6 +1554,16 @@ version = "2.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
|
||||
|
||||
[[package]]
|
||||
name = "inline"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"color-eyre",
|
||||
"crossterm",
|
||||
"rand 0.9.0",
|
||||
"ratatui",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "input-form"
|
||||
version = "0.0.0"
|
||||
@@ -3738,12 +3748,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.12.1"
|
||||
version = "1.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b"
|
||||
checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0"
|
||||
dependencies = [
|
||||
"atomic",
|
||||
"getrandom 0.2.15",
|
||||
"getrandom 0.3.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3911,7 +3921,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"sha2",
|
||||
"thiserror 1.0.69",
|
||||
"uuid 1.12.1",
|
||||
"uuid 1.13.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -79,7 +79,8 @@ This example shows how to create a custom widget that can be interacted with the
|
||||
|
||||
## Hyperlink demo
|
||||
|
||||
Shows how to render hyperlinks in a terminal using [OSC 8](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). [Source](./apps/hyperlink/).
|
||||
Shows how to render hyperlinks in a terminal using [OSC
|
||||
8](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). [Source](./apps/hyperlink/).
|
||||
|
||||
## Flex demo
|
||||
|
||||
@@ -93,6 +94,10 @@ This example shows how to create a simple TUI with a text. [Source](./apps/hello
|
||||
|
||||
This example shows different types of gauges. [Source](./apps/gauge/).
|
||||
|
||||
## Inline demo
|
||||
|
||||
Shows how to use the inlined viewport to render in a specific area of the screen. [Source](./apps/inline/).
|
||||
|
||||
## Input form
|
||||
|
||||
Shows how to render a form with input fields. [Source](./apps/input-form/).
|
||||
|
||||
15
examples/apps/inline/Cargo.toml
Normal file
15
examples/apps/inline/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "inline"
|
||||
publish = false
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
color-eyre.workspace = true
|
||||
crossterm.workspace = true
|
||||
rand = "0.9.0"
|
||||
ratatui.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
9
examples/apps/inline/README.md
Normal file
9
examples/apps/inline/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Inline demo
|
||||
|
||||
This example shows how to use the inlined viewport to render in a specific area of the screen.
|
||||
|
||||
To run this demo:
|
||||
|
||||
```shell
|
||||
cargo run -p inline
|
||||
```
|
||||
@@ -1,18 +1,12 @@
|
||||
//! # [Ratatui] Inline 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 use the inlined viewport.
|
||||
///
|
||||
/// It shows a list of downloads in progress, with a progress bar for each download.
|
||||
///
|
||||
/// 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::{
|
||||
collections::{BTreeMap, VecDeque},
|
||||
sync::mpsc,
|
||||
@@ -141,11 +141,6 @@ bench = false
|
||||
name = "main"
|
||||
harness = false
|
||||
|
||||
[[example]]
|
||||
name = "inline"
|
||||
required-features = ["crossterm"]
|
||||
doc-scrape-examples = true
|
||||
|
||||
[[example]]
|
||||
name = "list-widget"
|
||||
required-features = ["crossterm"]
|
||||
|
||||
Reference in New Issue
Block a user