Skip to content

Commit 45d1c54

Browse files
committed
docs: docstring about BYOP
1 parent f7fa807 commit 45d1c54

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4545
- `spinner::State` trait: Interface for checking idle state asynchronously
4646
- `spinner::run` function: Executes frame-based spinner animations
4747
- `spinner::frame` module: Provides various spinner frame patterns
48-
- **BYOP (Bring Your Own Preset) example**: Custom prompt implementation example
48+
- **BYOP (Build Your Own Preset) example**: Custom prompt implementation example
4949
- Integration demo of spinner and text editor
5050
- UI state management during async task execution
5151
- Task start, completion, and cancellation functionality

examples/byop/src/byop.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
/// BYOP (Bring Your Own Preset) example for promkit.
1+
/// BYOP (Build Your Own Preset) example for promkit.
2+
///
3+
/// This example demonstrates how to create a custom prompt using the `promkit` library.
4+
/// It includes a text editor for input, a spinner for async task execution, and a task
5+
/// monitor for managing background tasks.
6+
/// The prompt allows users to enter text, start a heavy task (actually a simulated delay),
7+
/// and see the results (actually show the input text) or errors
8+
/// displayed in the UI. The example showcases the integration of various widgets and state
9+
/// management techniques to create a responsive and interactive command-line application.
10+
///
11+
/// # Example Usage
12+
/// To run this example, ensure you have the `promkit` library and its dependencies set up in
13+
/// your Rust project. Then, execute the main function which initializes the BYOP prompt and
14+
/// starts the event loop. You can interact with the prompt by typing commands and pressing
15+
/// Enter to execute tasks. Use Ctrl+C to exit the prompt.
216
use std::{collections::HashSet, sync::Arc, time::Duration};
317

418
use anyhow::Result;
@@ -150,7 +164,7 @@ impl TaskMonitor {
150164
}
151165
}
152166

153-
/// Bring Your Own Prompt
167+
/// Build Your Own Prompt
154168
struct BYOP {
155169
renderer: SharedRenderer<Index>,
156170
task_monitor: Arc<TaskMonitor>,

0 commit comments

Comments
 (0)