#wrap #output #box #string #terminal

bauxite

Wrap a string in a box for more aesthetic output to a console

1 unstable release

0.1.0 Aug 23, 2019

#435 in Visualization

MIT license

20KB
303 lines

Bauxite Build Status

Wrap a string in a box for more aesthetic output to a console

Usage

To use Bauxite add bauxite as a dependency in your Cargo.toml.

[dependencies]
bauxite = { git = "https://github.com/Doxterpepper/Bauxite" }

Then in your source code

extern crate bauxite;

fn main() {
    let my_message = "Only those who leisurely approach that which the masses are busy about\n\
                      can be busy about that which the masses take leisurely.\n\
                      -- Lao Tsu";
    println!("{}", bauxite::BoxBuilder::from(my_message);
}

alt text


lib.rs:

Wrap terminal output with boxes

Example

let lorem_ipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
id est laborum.";

let boxed_message = bauxite::BoxBuilder::from(lorem_ipsum).padding(3)
    .alignment(bauxite::Alignment::Left);
println!("{}", boxed_message);

No runtime deps