Skip to main content

rich/
lib.rs

1//! # rich
2//!
3//! A **faithful** Rust port of the Python [`rich`](https://github.com/Textualize/rich)
4//! terminal-rendering library. This crate mirrors upstream module-for-module and
5//! its version tracks the upstream release it reflects (see `UPSTREAM.toml`).
6//!
7//! Local features and the plugin registry live in the separate `rich-ext` crate
8//! — do **not** add non-upstream behavior here. See `AGENTS.md`.
9//!
10//! ## Ported so far (the first vertical slice)
11//!
12//! [`color`] · [`style`] · [`cells`] · [`segment`] · [`markup`] · [`text`] ·
13//! [`theme`] · [`console`] · [`protocol`] (extension points) · [`measure`] ·
14//! [`errors`]
15//!
16//! The remaining modules are tracked as roadmap issues; see `docs/PORTING.md`
17//! for the module map and per-module parity status.
18
19pub mod align;
20pub mod ansi;
21pub mod bar;
22pub mod r#box;
23pub mod cells;
24pub mod color;
25mod color_names;
26pub mod columns;
27pub mod console;
28pub mod constrain;
29pub mod control;
30pub mod emoji;
31mod emoji_codes;
32pub mod errors;
33pub mod export;
34pub mod filesize;
35pub mod highlighter;
36pub mod json;
37pub mod layout;
38pub mod live;
39pub mod live_render;
40pub mod log_render;
41pub mod markdown;
42pub mod markup;
43pub mod measure;
44pub mod padding;
45pub mod pager;
46pub mod panel;
47pub mod pretty;
48pub mod progress;
49pub mod progress_bar;
50pub mod prompt;
51pub mod protocol;
52pub mod ratio;
53mod repr_patterns;
54pub mod rule;
55pub mod screen;
56pub mod segment;
57pub mod spinner;
58mod spinner_data;
59pub mod status;
60pub mod style;
61pub mod styled;
62pub mod svg;
63pub mod syntax;
64pub mod table;
65pub mod terminal_theme;
66pub mod text;
67pub mod theme;
68pub mod traceback;
69pub mod tree;
70pub mod wrap;
71
72// A small, curated prelude mirroring the most-used names from `rich`'s top level.
73pub use crate::align::{Align, HorizontalAlign};
74pub use crate::ansi::AnsiDecoder;
75pub use crate::bar::Bar;
76pub use crate::color::{Color, ColorSystem, ColorTriplet};
77pub use crate::columns::Columns;
78pub use crate::console::{Console, ConsoleOptions, Justify, Overflow};
79pub use crate::constrain::Constrain;
80pub use crate::control::{Control, ControlType};
81pub use crate::errors::{Result, RichError};
82pub use crate::highlighter::{ISO8601Highlighter, RegexHighlighter, ReprHighlighter};
83pub use crate::json::Json;
84pub use crate::layout::Layout;
85pub use crate::live::{AutoLive, Live};
86pub use crate::live_render::LiveRender;
87pub use crate::log_render::{LogLevel, LogRender};
88pub use crate::padding::Padding;
89pub use crate::pager::{Pager, SystemPager};
90pub use crate::panel::Panel;
91pub use crate::pretty::Pretty;
92pub use crate::progress::{Progress, ProgressColumn};
93pub use crate::progress_bar::ProgressBar;
94pub use crate::protocol::{Highlighter, Renderable};
95pub use crate::rule::Rule;
96pub use crate::screen::Screen;
97pub use crate::segment::Segment;
98pub use crate::spinner::Spinner;
99pub use crate::status::Status;
100pub use crate::style::{Style, StyleType};
101pub use crate::styled::Styled;
102pub use crate::syntax::Syntax;
103pub use crate::table::Table;
104pub use crate::terminal_theme::{
105    TerminalTheme, DEFAULT_TERMINAL_THEME, DIMMED_MONOKAI, MONOKAI, NIGHT_OWLISH, SVG_EXPORT_THEME,
106};
107pub use crate::text::Text;
108pub use crate::theme::Theme;
109pub use crate::traceback::Traceback;
110pub use crate::tree::Tree;