#color #term #terminal #format #style

bunt

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

7 releases

0.2.4 Nov 19, 2020
0.2.3 Oct 3, 2020
0.2.2 Sep 26, 2020
0.1.1 Sep 5, 2020
0.1.0 Jul 30, 2020

#166 in Command-line interface

Download history 4/week @ 2020-08-07 8/week @ 2020-08-14 5/week @ 2020-08-21 6/week @ 2020-08-28 22/week @ 2020-09-04 25/week @ 2020-09-11 48/week @ 2020-09-18 69/week @ 2020-09-25 119/week @ 2020-10-02 44/week @ 2020-10-09 58/week @ 2020-10-16 47/week @ 2020-10-23 89/week @ 2020-10-30 41/week @ 2020-11-06 36/week @ 2020-11-13 24/week @ 2020-11-20

200 downloads per month
Used in 5 crates

MIT/Apache

21KB
207 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 its compilation is fairly quick (≈1.5s on my machine, including all dependencies).

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

~220KB