modcli/output/mod.rs
1//! Output utilities for styled text, gradients, progress, and tables.
2//!
3//! # Examples
4//!
5//! ## Styled text builder
6//! ```no_run
7//! use modcli::output::{build, print, BLUE};
8//!
9//! let msg = build()
10//! .part("Hello").color(BLUE).bold().space()
11//! .part("world!")
12//! .get();
13//! print::line(&msg);
14//! ```
15//!
16//! ## Gradients
17//! ```no_run
18//! use modcli::output::{gradient, print, RED, ORANGE};
19//! let text = gradient::two_color("Sunrise", RED, ORANGE);
20//! print::line(&text);
21//! ```
22//!
23//! ## Progress bar
24//! ```no_run
25//! use modcli::output::progress::{show_progress_bar};
26//! show_progress_bar("Downloading", 20, 1000);
27//! ```
28//!
29//! ## Tables
30//! ```no_run
31//! use modcli::output::table::{render_table, TableMode, TableStyle};
32//! let headers = ["Name", "Age"];
33//! let rows = vec![ vec!["Alice", "29"], vec!["Bob", "35"] ];
34//! render_table(&headers, &rows, TableMode::Flex, TableStyle::Rounded);
35//! ```
36pub mod colors;
37pub mod gradient;
38pub mod hook;
39pub mod print;
40pub mod progress;
41pub mod style;
42pub mod table;
43pub mod themes;
44
45// Expose public API
46pub use colors::{
47 BLACK, BLUE, BROWN, CYAN, DARK_BLUE, DARK_BROWN, DARK_GREY, DARK_ORANGE, DARK_PINK,
48 DARK_PURPLE, DARK_TEAL, GREEN, GREY, LIGHT_BLUE, LIGHT_CYAN, LIGHT_GREEN, LIGHT_GREY,
49 LIGHT_MAGENTA, LIGHT_YELLOW, MAGENTA, ORANGE, PINK, PURPLE, RED, TEAL, WHITE, YELLOW,
50};
51pub use progress::{
52 show_percent_progress, show_progress_bar, show_spinner, ProgressBar, ProgressStyle,
53};
54pub use style::build;
55
56// Compile the input submodule crate-visibly; public access is via `modcli::input::*` re-exports
57pub(crate) mod input;