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 hook;
38#[cfg(feature = "images")]
39pub mod images;
40pub mod input;
41pub mod markdown;
42pub mod messages;
43pub mod print;
44pub mod progress;
45pub mod style;
46pub mod table;
47pub mod themes;
48
49// Optional modules
50#[cfg(feature = "gradients")]
51pub mod gradient;
52#[cfg(feature = "gradients")]
53pub mod gradient_extras;
54#[cfg(feature = "layouts")]
55pub mod layout;
56
57// Expose public API
58pub use colors::{
59    BLACK, BLUE, BROWN, CYAN, DARK_BLUE, DARK_BROWN, DARK_GREY, DARK_ORANGE, DARK_PINK,
60    DARK_PURPLE, DARK_TEAL, GREEN, GREY, LIGHT_BLUE, LIGHT_CYAN, LIGHT_GREEN, LIGHT_GREY,
61    LIGHT_MAGENTA, LIGHT_YELLOW, MAGENTA, ORANGE, PINK, PURPLE, RED, TEAL, WHITE, YELLOW,
62};
63#[cfg(feature = "images")]
64pub use images::{show as show_image, show_mosaic as show_image_mosaic, ImageOpts};
65pub use progress::{
66    show_percent_progress, show_progress_bar, show_spinner, MultiProgress, ProgressBar,
67    ProgressStyle,
68};
69pub use style::build;