Skip to main content

cformat

Macro cformat 

Source
cformat!() { /* proc-macro */ }
Expand description

Compiles a farben markup format string into an inlined String-building block.

Splits the format string at {...} placeholders at compile time. Static segments between placeholders are rendered to ANSI escape sequences once, baked into the binary as string literals, and written with a single push_str. Dynamic arguments are written via format_args! at the call site, preserving full format-spec support ({name}, {0}, {:.2}, etc.) and allowing variable captures from the surrounding scope.

A trailing \x1b[0m reset is appended. For the bleed variant see cformatb!. This macro is the compile-time backend for cformat! from the farben crate.