textflow/
lib.rs

1#![deny(missing_docs)]
2
3//! A library built upon [`textwrap`](https://crates.io/crates/textwrap)
4//! that lets you print text in columns, aligned to the right, centered
5//! or justified.
6
7extern crate lazy_static;
8extern crate regex;
9extern crate textwrap;
10extern crate unicode_width;
11
12/// (re-exported from `textwrap`) Holds settings for wrapping and filling text.
13pub use textwrap::Options;
14
15mod utils;
16
17mod align;
18mod columns;
19mod layout;
20
21pub use align::align;
22pub use columns::columns;
23pub use layout::Layout;
24
25/// Text alignment. See [align()] for details.
26#[derive(Copy, Clone, Debug)]
27pub enum Alignment {
28    /// Left-aligned
29    LEFT,
30    /// Centered
31    CENTER,
32    /// Right-aligned
33    RIGHT,
34    /// Justified
35    JUSTIFY,
36}
37
38/// Column spacing. See [columns()] for details.
39#[derive(Copy, Clone, Debug)]
40pub enum Spacing {
41    /// No spacing
42    NONE,
43    /// Space between columns
44    BETWEEN,
45    /// Space between and around columns
46    AROUND,
47}