#terminal-colors #terminal-text #terminal #colored-text #color #style #proc-macro

bunt

Simple macros to write colored and formatted text to a terminal. Based on termcolor, thus also cross-platform

11 releases

0.2.8 Jan 29, 2023
0.2.7 Nov 29, 2022
0.2.6 Sep 9, 2021
0.2.5 Jun 9, 2021
0.1.0 Jul 30, 2020

#146 in Command-line interface

Download history 336/week @ 2024-07-21 291/week @ 2024-07-28 287/week @ 2024-08-04 394/week @ 2024-08-11 484/week @ 2024-08-18 313/week @ 2024-08-25 313/week @ 2024-09-01 415/week @ 2024-09-08 239/week @ 2024-09-15 275/week @ 2024-09-22 315/week @ 2024-09-29 212/week @ 2024-10-06 336/week @ 2024-10-13 398/week @ 2024-10-20 420/week @ 2024-10-27 307/week @ 2024-11-03

1,471 downloads per month
Used in 23 crates

MIT/Apache

24KB
233 lines

Bunt: simple macro-based terminal colors and styles

CI status of master Crates.io Version docs.rs

bunt offers macros to easily print colored and formatted text to a terminal. It is just a convenience API on top of termcolor. bunt is implemented using procedural macros, but it does not depend on syn and compiles fairly quickly.

Minimum Supported Rust Version: 1.46.0

// Style tags will color/format text between the tags.
bunt::println!("I really like {$yellow}lemons{/$}! Like, {$blue+italic}a lot{/$}.");

// To style a single argument, you can also use the `{[style]...}` syntax. This
// can be combined with style tags.
let v = vec![1, 2, 3];
bunt::println!("Here is some data: {[green]:?}. {$bold}Length: {[cyan]}{/$}", v, v.len());

See the documentation for more information.

Status of this project

This is still a young project, but I already use it in two applications of mine. The syntax is certainly not final yet. Seeking feedback from the community!



License

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.3–7MB
~44K SLoC