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`]), error types ([`errors`]), color degradation
6//! ([`degrader`]), inline syntax pre-processing ([`inline`]), stripping utilities
7//! ([`strip`]), environment detection ([`mod@env`]), and persistent style state
8//! (via [`active_stack`], [`set_active_stack`], [`clear_active_stack`]).
9//!
10//! Typical usage flows through the [`lexer::tokenize`] and [`parser::render`] functions,
11//! with optional style definitions via the [`registry`] module.
12#![warn(missing_docs)]
13#![deny(rustdoc::broken_intra_doc_links)]
14#![warn(rustdoc::private_intra_doc_links)]
15// Single-letter names (`r`, `g`, `b`, `h`, `s`, `v`, `l`, `a`, `c`, etc.) are standard
16// mathematical notation in color-space conversion code.
17#![allow(clippy::many_single_char_names)]
18
19pub mod ansi;
20pub mod debug;
21pub mod degrader;
22pub mod env;
23pub mod errors;
24pub mod lexer;
25pub mod parser;
26pub mod registry;
27mod state;
28pub use state::{active_stack, clear_active_stack, set_active_stack};
29pub mod strip;
30
31#[cfg(feature = "anstyle")]
32pub mod anstyle_conv;
33
34#[cfg(feature = "inline")]
35pub mod inline;