Expand description
Procedural macros for the Farben terminal styling library.
Provides compile-time processing of farben markup, baking the final ANSI-escaped
strings directly into the binary with zero runtime overhead. Also provides
compile-time format string splitting via cformat and cformatb.
All macros in this crate are re-exported through farben and should not be
used directly in most cases.
§Macros
color!– parse and render markup at compile time, returns aFarbenStrcolorb!– same ascolor!but without a trailing resetcformat!– compile-time split of markup format strings with runtime argscformatb!– bleed variant ofcformat!validate_color!– validates markup at compile time, returns the original string
Macros§
- cformat
- Compiles a farben markup format string into an inlined
String-building block. - cformatb
- Like
cformat!but omits the trailing SGR reset. - color
- Parses and colorizes a farben markup string at compile time.
- colorb
- Parses and colorizes a farben markup string at compile time, without appending a trailing SGR reset.
- compile_
cprint - Proc-macro backend for the compile-variant
($fmt:literal)arms ofcprint!,cprintln!,cprintb!, etc. - compile_
cprintb - Proc-macro backend for the compile-variant
($fmt:literal)arms of the bleed variants (cprintb!,cprintbln!, etc.). Same logic ascompile_cprintbut omits the trailing SGR reset. - validate_
color - Validates farben markup at compile time and returns the original string literal unchanged.