1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! The recommended way to bring Farben's public API into scope.
//!
//! Prefer `use farben::prelude::*` over `use farben::*`. The raw glob import
//! pulls in internal items (`color_runtime`, `validate_color`) that are `pub`
//! only to satisfy macro expansion requirements. This prelude exports only the
//! intentional public surface, gated by the same feature flags as their
//! definitions.
//!
//! # Usage
//!
//! ```rust
//! use farben::prelude::*;
//!
//! // try_color returns Result<String, LexError>; LexError is re-exported
//! // here so callers can pattern-match without a separate import.
//! match try_color("[red]Hello[/]") {
//! Ok(s) => print!("{s}"),
//! Err(e) => eprintln!("parse error: {e}"),
//! }
//! ```
//!
//! # What is included
//!
//! | Item | Condition |
//! |------|-----------|
//! | [`try_color`], [`strip_ansi`] | always |
//! | [`color`], [`colorb`] | always (function without `compile`; proc-macro with `compile`) |
//! | [`markdown`] | `markdown` or `markdown-compile` feature |
//! | [`LexError`] | always (needed to match on [`try_color`] results) |
//! | [`color_fmt!`], [`cprint!`], [`cprintln!`], [`cprintb!`], [`cprintbln!`], [`cwrite!`], [`cwriteln!`], [`cwriteb!`], [`cwritebln!`] | always |
//! | [`ceprint!`], [`ceprintln!`], [`ceprintb!`], [`ceprintbln!`] | always |
//! | [`ansi_strip!`] | always |
//! | [`markup_strip!`] | always |
//! | [`md_fmt!`], [`mdprint!`], [`mdprintln!`], [`mdeprint!`], [`mdeprintln!`] | `markdown` or `markdown-compile` feature |
//! | [`style!`], [`prefix!`] | `format` feature |
//! | [`Style`], [`insert_style`], [`set_prefix`] | `format` feature |
//!
//! `color_runtime` and `validate_color` are excluded. Both are `pub` only so
//! that Farben's procedural macros can call them; they carry no stability
//! guarantees and are not part of the user-facing API.
pub use cratestrip_ansi;
pub use cratetry_color;
pub use crate::;
pub use crate::;
pub use cratemarkdown;
pub use LexError;
pub use crate::;
pub use crate::;
pub use crateexpand;
pub use crate::;
pub use crate::;
pub use crate::;
pub use crate::;