#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

#343 in No standard library

Download history 45/week @ 2024-07-20 28/week @ 2024-07-27 30/week @ 2024-08-03 17/week @ 2024-08-10 16/week @ 2024-08-17 14/week @ 2024-08-24 30/week @ 2024-08-31 20/week @ 2024-09-07 17/week @ 2024-09-14 20/week @ 2024-09-21 18/week @ 2024-09-28 10/week @ 2024-10-05 22/week @ 2024-10-12 11/week @ 2024-10-19 1/week @ 2024-10-26 20/week @ 2024-11-02

55 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