Crates.io | bunt |
lib.rs | bunt |
version | 0.2.8 |
source | src |
created_at | 2020-07-30 13:07:56.753372 |
updated_at | 2023-01-29 14:49:37.837862 |
description | Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform. |
homepage | |
repository | https://github.com/LukasKalbertodt/bunt/ |
max_upload_size | |
id | 271268 |
size | 51,827 |
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.
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!
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.