#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

#282 in No standard library

Download history 85/week @ 2024-03-24 62/week @ 2024-03-31 26/week @ 2024-04-07 35/week @ 2024-04-14 70/week @ 2024-04-21 32/week @ 2024-04-28 25/week @ 2024-05-05 25/week @ 2024-05-12 29/week @ 2024-05-19 20/week @ 2024-05-26 27/week @ 2024-06-02 41/week @ 2024-06-09 125/week @ 2024-06-16 27/week @ 2024-06-23 2/week @ 2024-06-30 15/week @ 2024-07-07

171 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