#text #column #separated #fetch #neofetch

no-std columns

A text manipulation library for displaying separate text in columns

1 unstable release

0.1.0 May 4, 2022

#266 in No standard library

Download history 38/week @ 2024-01-01 71/week @ 2024-01-08 37/week @ 2024-01-15 12/week @ 2024-01-22 37/week @ 2024-01-29 25/week @ 2024-02-05 15/week @ 2024-02-12 69/week @ 2024-02-19 61/week @ 2024-02-26 37/week @ 2024-03-04 61/week @ 2024-03-11 48/week @ 2024-03-18 88/week @ 2024-03-25 59/week @ 2024-04-01 26/week @ 2024-04-08 58/week @ 2024-04-15

235 downloads per month
Used in 4 crates

MIT license

7KB
99 lines

Columns

A text manipulation library for displaying separate text in columns

Example

use columns::Columns;

println!(
    "{}",
    Columns::from(vec![
        vec!["line1", "line2", "line3"],
        vec!["should", "be", "displayed", "side by side"],
    ])
    .base_tabsize_in(0) // Sets the tabsize to be based in the first one. This is to prevent unnecessary spacing
);

Result:

line1   should
line2   be
line3   displayed
        side by side

TODO list

  • Post on crates.io
  • Customizable separators

lib.rs:

A text manipulation library for displaying separate text in columns.

Quick Start

The quickest way to get column-separated text is to use the From implementation for Columns.

use columns::Columns;

let column_text = Columns::from(
   vec![
       vec!["text", "should", "be"],
       vec!["in", "different", "columns"],
       vec!["even", "in", "more", "than", "two"]
   ]
);

println!("{}", column_text);

If you're using &format!s, you may want to use make_columns method from columns::Columns.

No runtime deps