Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vendethiel/formatter-align

Perl6 "Aligned Table"-style Formatter
https://github.com/vendethiel/formatter-align

formatter perl6 raku

Last synced: 17 days ago
JSON representation

Perl6 "Aligned Table"-style Formatter

Awesome Lists containing this project

README

        

Formatter::Align
===============

Easily format an array in an aligned table.

Usage:

```perl6
use Formatter::Align;

my @headers = <>;
my @data =
(1, "George", "CEO", "Reagen"),
(2, "Tami", "Employee", "?"),
(3, "Kaaris", "CXO", "Rap");

# The headers are optional.
say format(@data, @headers);
```

Output:

```
ID Name Type Family Name
== ==== ==== ===========
1 George CEO Reagen
2 Tami Employee ?
3 Kaaris CXO Rap
```

Options:

- `padding-from`: The space at the beginning of a column.
- `padding-to`: The space at the end of a column.