1 | //! ANSI Text Styling |
2 | //! |
3 | //! *A portmanteau of "ansi style"* |
4 | //! |
5 | //! `anstyle` provides core types describing [ANSI styling escape |
6 | //! codes](https://en.wikipedia.org/wiki/ANSI_escape_code) for interoperability |
7 | //! between crates. |
8 | //! |
9 | //! Example use cases: |
10 | //! - An argument parser allowing callers to define the colors used in the help-output without |
11 | //! putting the text formatting crate in the public API |
12 | //! - A style description parser that can work with any text formatting crate |
13 | //! |
14 | //! Priorities: |
15 | //! 1. API stability |
16 | //! 2. Low compile-time and binary-size overhead |
17 | //! 3. `const` friendly API for callers to statically define their stylesheet |
18 | //! |
19 | //! For integration with text styling crate, see: |
20 | //! - [anstyle-ansi-term](https://docs.rs/anstyle-ansi-term) |
21 | //! - [anstyle-crossterm](https://docs.rs/anstyle-crossterm) |
22 | //! - [anstyle-owo-colors](https://docs.rs/anstyle-owo-colors) |
23 | //! - [anstyle-termcolor](https://docs.rs/anstyle-termcolor) |
24 | //! - [anstyle-yansi](https://docs.rs/anstyle-yansi) |
25 | //! |
26 | //! User-styling parsers: |
27 | //! - [anstyle-git](https://docs.rs/anstyle-git): Parse Git style descriptions |
28 | //! - [anstyle-ls](https://docs.rs/anstyle-ls): Parse LS_COLORS style descriptions |
29 | //! |
30 | //! Convert to other formats |
31 | //! - [anstream](https://docs.rs/anstream): A simple cross platform library for writing colored text to a terminal |
32 | //! - [anstyle-roff](https://docs.rs/anstyle-roff): For converting to ROFF |
33 | //! |
34 | //! Utilities |
35 | //! - [anstyle-lossy](https://docs.rs/anstyle-lossy): Convert between `anstyle::Color` types |
36 | //! - [anstyle-parse](https://docs.rs/anstyle-parse): Parsing ANSI Style Escapes |
37 | //! - [anstyle-wincon](https://docs.rs/anstyle-wincon): Styling legacy Microsoft terminals |
38 | //! |
39 | //! # Examples |
40 | //! |
41 | //! The core type is [`Style`]: |
42 | //! ```rust |
43 | //! let style = anstyle::Style::new().bold(); |
44 | //! ``` |
45 | |
46 | #![cfg_attr (not(feature = "std" ), no_std)] |
47 | |
48 | #[macro_use ] |
49 | mod macros; |
50 | |
51 | mod color; |
52 | mod effect; |
53 | mod reset; |
54 | mod style; |
55 | |
56 | pub use color::*; |
57 | pub use effect::*; |
58 | pub use reset::*; |
59 | pub use style::*; |
60 | |