#column #text #fetch #neofetch #separated

no-std columns

A text manipulation library for displaying separate text in columns

1 unstable release

0.1.0 May 4, 2022

#263 in No standard library

Download history 207/week @ 2023-10-28 81/week @ 2023-11-04 74/week @ 2023-11-11 186/week @ 2023-11-18 201/week @ 2023-11-25 71/week @ 2023-12-02 150/week @ 2023-12-09 148/week @ 2023-12-16 135/week @ 2023-12-23 54/week @ 2023-12-30 99/week @ 2024-01-06 68/week @ 2024-01-13 49/week @ 2024-01-20 56/week @ 2024-01-27 51/week @ 2024-02-03 44/week @ 2024-02-10

211 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