Skip to main content

Crate rich

Crate rich 

Source
Expand description

§rich

A faithful Rust port of the Python rich terminal-rendering library. This crate mirrors upstream module-for-module and its version tracks the upstream release it reflects (see UPSTREAM.toml).

Local features and the plugin registry live in the separate rich-ext crate — do not add non-upstream behavior here. See AGENTS.md.

§Ported so far (the first vertical slice)

color · style · cells · segment · markup · text · theme · console · protocol (extension points) · measure · errors

The remaining modules are tracked as roadmap issues; see docs/PORTING.md for the module map and per-module parity status.

Re-exports§

pub use crate::align::Align;
pub use crate::align::HorizontalAlign;
pub use crate::ansi::AnsiDecoder;
pub use crate::bar::Bar;
pub use crate::color::Color;
pub use crate::color::ColorSystem;
pub use crate::color::ColorTriplet;
pub use crate::columns::Columns;
pub use crate::console::Console;
pub use crate::console::ConsoleOptions;
pub use crate::console::Justify;
pub use crate::console::Overflow;
pub use crate::constrain::Constrain;
pub use crate::control::Control;
pub use crate::control::ControlType;
pub use crate::errors::Result;
pub use crate::errors::RichError;
pub use crate::highlighter::ISO8601Highlighter;
pub use crate::highlighter::RegexHighlighter;
pub use crate::highlighter::ReprHighlighter;
pub use crate::json::Json;
pub use crate::layout::Layout;
pub use crate::live::AutoLive;
pub use crate::live::Live;
pub use crate::live_render::LiveRender;
pub use crate::log_render::LogLevel;
pub use crate::log_render::LogRender;
pub use crate::padding::Padding;
pub use crate::pager::Pager;
pub use crate::pager::SystemPager;
pub use crate::panel::Panel;
pub use crate::pretty::Pretty;
pub use crate::progress::Progress;
pub use crate::progress::ProgressColumn;
pub use crate::progress_bar::ProgressBar;
pub use crate::protocol::Highlighter;
pub use crate::protocol::LineRenderable;
pub use crate::protocol::Renderable;
pub use crate::rule::Rule;
pub use crate::screen::Screen;
pub use crate::segment::Segment;
pub use crate::spinner::Spinner;
pub use crate::status::Status;
pub use crate::style::Style;
pub use crate::style::StyleType;
pub use crate::styled::Styled;
pub use crate::syntax::Syntax;
pub use crate::table::Table;
pub use crate::terminal_theme::TerminalTheme;
pub use crate::terminal_theme::DEFAULT_TERMINAL_THEME;
pub use crate::terminal_theme::DIMMED_MONOKAI;
pub use crate::terminal_theme::MONOKAI;
pub use crate::terminal_theme::NIGHT_OWLISH;
pub use crate::terminal_theme::SVG_EXPORT_THEME;
pub use crate::text::Text;
pub use crate::theme::Theme;
pub use crate::traceback::Traceback;
pub use crate::tree::Tree;

Modules§

align
Horizontal alignment.
ansi
Decoding ANSI escape sequences back into styled Text.
bar
Horizontal bars.
box
Box-drawing character sets.
cells
Terminal cell measurement.
color
Colors and color-system handling.
columns
Columns — arrange renderables in a grid.
console
The Console — the high-level rendering entry point.
constrain
Width constraint.
control
Terminal control codes.
emoji
Emoji shortcode replacement.
errors
Error types.
export
Exporting rendered output to HTML.
filesize
Human-readable file sizes.
highlighter
Built-in highlighters.
json
JSON pretty-printing.
layout
Screen layout — split a region into ratioed rows and columns.
live
Live (in-place updating) displays.
live_render
In-place live rendering.
log_render
Rendering log records.
markdown
Markdown rendering.
markup
Console markup parsing.
measure
Renderable measurement.
padding
Padding around a renderable.
pager
Paging long output through the system pager.
panel
Panels — a box drawn around a renderable.
pretty
Pretty-printing of values.
progress
Progress displays (static rendering).
progress_bar
Progress bars (static rendering).
prompt
Interactive prompts.
protocol
Rendering & extension protocols.
ratio
Ratio-based size resolution.
rule
Horizontal rules.
screen
A full-screen renderable.
segment
Segments — the atoms of rendering.
spinner
Spinners.
status
A status indicator with a spinner.
style
Text styles.
styled
Applying a style across a whole renderable.
svg
Exporting rendered output to SVG.
syntax
Syntax highlighting.
table
Tables.
terminal_theme
Terminal color themes for export.
text
Styled text with spans.
theme
Themes — named styles.
traceback
Rendering errors.
tree
Trees.
wrap
Word wrapping.