bread

Crates.iobread
lib.rsbread
version0.1.0
sourcesrc
created_at2014-12-17 19:30:45.942805
updated_at2015-12-11 23:57:49.028558
descriptionAn embedded text formatting markup library for terminal output
homepagehttps://github.com/mkpankov/bread/
repositoryhttps://github.com/mkpankov/bread.git
max_upload_size
id590
size112,708
Michael Pankov (mkpankov)

documentation

https://github.com/mkpankov/bread/blob/master/README.md

README

bread Build Status

Text formatting library for terminal output, with embedded formatting tokens.

We're going to use formatting syntax of Dzen (https://github.com/robm/dzen). Some examples:

  • ^fg(red)I'm red text ^fg(blue)I am blue
  • ^bg(red)The ^fg(bright-black)text to ^bg(blue)^fg(cyan)colorize

For full example of working program, see src/main.rs. You can run it by cloning the repo and doing cargo run.

To use in your project, add

[dependencies.bread]

git = "https://github.com/mkpankov/bread.git"

to Cargo.toml and you should be good to go.

List of currently supported colors

  • black
  • blue
  • bright-black
  • bright-blue
  • bright-cyan
  • bright-green
  • bright-magenta
  • bright-red
  • bright-white
  • bright-yellow
  • cyan
  • green
  • magenta
  • red
  • white
  • yellow

Demo

Demo

Feedback

I'm a newbie with Rust, so please don't hesitate to suggest any improvement to the library, be it a code review, bug report, or feature request.

I'd really appreciate code review by a mature Rustacean. In case you're willing to do it (it's just 200+ lines!), please send your comments to work at michaelpankov dot com.

Commit count: 61

cargo fmt