farben_core/lib.rs
1//! Core library for the farben terminal styling crate.
2//!
3//! Provides the full pipeline for parsing farben markup strings into ANSI escape sequences:
4//! tokenization ([`lexer`]), ANSI encoding ([`ansi`]), rendering ([`parser`]),
5//! named style registration ([`registry`]), and error types ([`errors`]).
6//!
7//! v0.7.0 adds two supporting modules:
8//!
9//! - [`env`]: runtime detection of whether ANSI output should be enabled. [`env::color_enabled`]
10//! respects `NO_COLOR` and `FORCE_COLOR`, falling back to TTY detection (`isatty(1)` on Unix,
11//! `GetConsoleMode` on Windows).
12//! - [`strip`]: exposes [`strip::strip_ansi`], which removes CSI escape sequences from a string.
13//! Useful for measuring display width, plain-text logging, or piping output to tools that do
14//! not interpret ANSI codes.
15//!
16//! Typical usage flows through the [`lexer::tokenize`] and [`parser::render`] functions,
17//! with optional style definitions via the [`registry`] module and its macros.
18
19pub mod ansi;
20pub mod degrader;
21pub mod env;
22pub mod errors;
23pub mod lexer;
24pub mod parser;
25pub mod registry;
26pub mod strip;
27
28#[cfg(feature = "anstyle")]
29pub mod anstyle_conv;