• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/Text/Table/H26-Apr-2021-506243

t/H26-Apr-2021-11773

ChangesH A D26-Apr-20213.1 KiB14266

LICENSEH A D26-Apr-202118 KiB380292

MANIFESTH A D26-Apr-2021265 1615

META.jsonH A D26-Apr-202122.1 KiB639637

META.ymlH A D26-Apr-202114.7 KiB484483

Makefile.PLH A D26-Apr-20211.3 KiB5847

READMEH A D26-Apr-20215.6 KiB222151

dist.iniH A D26-Apr-2021920 5243

weaver.iniH A D26-Apr-202121 21

README

1NAME
2    Text::Table::Any - Generate text table using one of several backends
3
4VERSION
5    This document describes version 0.104 of Text::Table::Any (from Perl
6    distribution Text-Table-Any), released on 2021-04-26.
7
8SYNOPSIS
9     use Text::Table::Any;
10
11     my $rows = [
12         # header row
13         ['Name', 'Rank', 'Serial'],
14         # rows
15         ['alice', 'pvt', '123456'],
16         ['bob',   'cpl', '98765321'],
17         ['carol', 'brig gen', '8745'],
18     ];
19     print Text::Table::Any::table(rows => $rows, header_row => 1,
20                                   backend => 'Text::Table::More');
21
22DESCRIPTION
23    This module provides a single function, "table", which formats a
24    two-dimensional array of data as text table, using one of several
25    available backends. The interface is modelled after Text::Table::Tiny
26    (0.03). Text::Table::Sprintf is the default backend.
27
28    The example shown in the SYNOPSIS generates the following table:
29
30     +-------+----------+----------+
31     | Name  | Rank     | Serial   |
32     +-------+----------+----------+
33     | alice | pvt      | 123456   |
34     | bob   | cpl      | 98765321 |
35     | carol | brig gen | 8745     |
36     +-------+----------+----------+
37
38    When using "Text::Table::Org" backend, the result is something like:
39
40     | Name  | Rank     | Serial   |
41     |-------+----------+----------|
42     | alice | pvt      | 123456   |
43     | bob   | cpl      | 98765321 |
44     | carol | brig gen | 8745     |
45
46    When using "Text::Table::CSV" backend:
47
48     "Name","Rank","Serial"
49     "alice","pvt","123456"
50     "bob","cpl","98765321"
51     "carol","brig gen","8745"
52
53    When using "Text::ANSITable" backend:
54
55     .-------+----------+----------.
56     | Name  | Rank     |   Serial |
57     +-------+----------+----------+
58     | alice | pvt      |   123456 |
59     | bob   | cpl      | 98765321 |
60     | carol | brig gen |     8745 |
61     `-------+----------+----------'
62
63    When using "Text::ASCIITable" backend:
64
65     .-----------------------------.
66     | Name  | Rank     | Serial   |
67     +-------+----------+----------+
68     | alice | pvt      |   123456 |
69     | bob   | cpl      | 98765321 |
70     | carol | brig gen |     8745 |
71     '-------+----------+----------'
72
73    When using "Text::FormatTable" backend:
74
75     Name |Rank    |Serial
76     alice|pvt     |123456
77     bob  |cpl     |98765321
78     carol|brig gen|8745
79
80    When using "Text::MarkdownTable" backend:
81
82     | Name  | Rank     | Serial   |
83     |-------|----------|----------|
84     | alice | pvt      | 123456   |
85     | bob   | cpl      | 98765321 |
86     | carol | brig gen | 8745     |
87
88    When using "Text::Table" backend:
89
90     Name  Rank     Serial
91     alice pvt        123456
92     bob   cpl      98765321
93     carol brig gen     8745
94
95    When using "Text::TabularDisplay" backend:
96
97     +-------+----------+----------+
98     | Name  | Rank     | Serial   |
99     +-------+----------+----------+
100     | alice | pvt      | 123456   |
101     | bob   | cpl      | 98765321 |
102     | carol | brig gen | 8745     |
103     +-------+----------+----------+
104
105VARIABLES
106  @BACKENDS
107    List of supported backends.
108
109FUNCTIONS
110  table
111    Usage:
112
113     table(%params) => str
114
115    Known arguments:
116
117    *   rows (aoaos)
118
119        Required. Takes an array reference which should contain one or more
120        rows of data, where each row is an array reference.
121
122    *   backend (str, default "Text::Table::Sprintf")
123
124        Optional. Pick a backend module. Supported backends:
125
126        *   Term::TablePrint
127
128        *   Text::ANSITable
129
130        *   Text::ASCIITable
131
132        *   Text::FormatTable
133
134        *   Text::MarkdownTable
135
136        *   Text::Table
137
138        *   Text::Table::ASV
139
140        *   Text::Table::CSV
141
142        *   Text::Table::HTML
143
144        *   Text::Table::HTML::DataTables
145
146        *   Text::Table::LTSV
147
148        *   Text::Table::Manifold
149
150        *   Text::Table::More
151
152        *   Text::Table::Org
153
154        *   Text::Table::Paragraph
155
156        *   Text::Table::Sprintf
157
158        *   Text::Table::TickitWidget
159
160        *   Text::Table::Tiny
161
162        *   Text::Table::TinyBorderStyle
163
164        *   Text::Table::TinyColor
165
166        *   Text::Table::TinyColorWide
167
168        *   Text::Table::TinyWide
169
170        *   Text::Table::TSV
171
172        *   Text::Table::XLSX
173
174        *   Text::TabularDisplay
175
176        *   Text::UnicodeBox::Table
177
178    *   header_row (bool, default 0)
179
180        Optional. If given a true value, the first row in the data will be
181        interpreted as a header row, and separated visually from the rest of
182        the table (e.g. with a ruled line). But some backends won't display
183        differently.
184
185    *   separate_rows
186
187        Boolean. Optional. Default false. If set to true, will draw a
188        separator line after each data row.
189
190  backends
191    Return list of supported backends. You can also get the list from the
192    "@BACKENDS" package variable.
193
194HOMEPAGE
195    Please visit the project's homepage at
196    <https://metacpan.org/release/Text-Table-Any>.
197
198SOURCE
199    Source repository is at
200    <https://github.com/perlancar/perl-Text-Table-Any>.
201
202BUGS
203    Please report any bugs or feature requests on the bugtracker website
204    <https://github.com/perlancar/perl-Text-Table-Any/issues>
205
206    When submitting a bug or request, please include a test-file or a patch
207    to an existing test-file that illustrates the bug or desired feature.
208
209SEE ALSO
210    Acme::CPANModules::TextTable
211
212AUTHOR
213    perlancar <perlancar@cpan.org>
214
215COPYRIGHT AND LICENSE
216    This software is copyright (c) 2021, 2020, 2019, 2018, 2017, 2016, 2015
217    by perlancar@cpan.org.
218
219    This is free software; you can redistribute it and/or modify it under
220    the same terms as the Perl 5 programming language system itself.
221
222