ansic 0.1.7

Ansic is a crate which does ansi parsing in a dynamic DSL and at compile time for efficient and zero cost ansi styling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Ideal when you want to easily style a dynamic string and terminate it and allocate a String for it at runtime.
/// This is not a fully compiletime or no_std option as it allows for dynamic strings as text. If you want fully compile time, refer to the ansi! macro.
/// ## Usage:
/// ```rust
/// styled!("myString", br.red bold underline)
/// ```
///
/// In place of the "myString" literal can be anything that implemements Display.
#[macro_export]
macro_rules! styled {
    ($text:expr, $($style:tt)+) => {{
        format!("{}{}{}", ansi!($($style)+), $text, ansi!(reset))
    }}
}