|
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. |
2 | 16 | use std::{collections::HashSet, sync::Arc, time::Duration}; |
3 | 17 |
|
4 | 18 | use anyhow::Result; |
@@ -150,7 +164,7 @@ impl TaskMonitor { |
150 | 164 | } |
151 | 165 | } |
152 | 166 |
|
153 | | -/// Bring Your Own Prompt |
| 167 | +/// Build Your Own Prompt |
154 | 168 | struct BYOP { |
155 | 169 | renderer: SharedRenderer<Index>, |
156 | 170 | task_monitor: Arc<TaskMonitor>, |
|
0 commit comments