macro_rules! format {
    ($($arg:tt)*) => { ... };
}
Available on crate features alloc and macros only.
Expand description

Create a stylish::String using interpolation of runtime elements.

The first argument format! receives is a format string literal, the rest are parameters interpolated based on the format string. See the main stylish docs for more info on how the interpolation is controlled.

let s: stylish::String = stylish::format!("Hello {:(fg=green)}!", "World");

assert_eq!(
    stylish::html::format!("{:s}", s),
    "Hello <span style=color:green>World</span>!",
);