Acme-CPANModules-TextTable
view release on metacpan or search on metacpan
lib/Acme/CPANModules/TextTable.pm view on Meta::CPAN
my ($table) = @_;
Text::Table::HTML::table(rows=>$table, header_row=>1);
},
features => {
wide_char_data => 1,
color_data => {value=>0, summary=>'Not converted to HTML color elements'},
box_char => 0,
multiline_data => 1,
},
},
{
module => 'Text::Table::HTML::DataTables',
bench_code => sub {
my ($table) = @_;
Text::Table::HTML::DataTables::table(rows=>$table, header_row=>1);
},
features => {
wide_char_data => 1,
color_data => {value=>0, summary=>'Not converted to HTML color elements'},
box_char => 0,
multiline_data => 1,
},
},
{
module => 'Text::TabularDisplay',
bench_code => sub {
my ($table) = @_;
my $t = Text::TabularDisplay->new(@{ $table->[0] });
$t->add(@{ $table->[$_] }) for 1..@$table-1;
$t->render; # doesn't add newline
},
features => {
wide_char_data => 1,
color_data => 0,
box_char => {value=>undef, summary=>"Irrelevant"},
multiline_data => 1,
},
},
],
bench_datasets => [
{name=>'tiny (1x1)' , argv => [_make_table( 1, 1)],},
{name=>'small (3x5)' , argv => [_make_table( 3, 5)],},
{name=>'wide (30x5)' , argv => [_make_table(30, 5)],},
{name=>'long (3x300)' , argv => [_make_table( 3, 300)],},
{name=>'large (30x300)' , argv => [_make_table(30, 300)],},
{name=>'multiline data (2x1)', argv => [ [["col1", "col2"], ["foobar\nbaz\nqux\nquux","corge"]] ], include_by_default=>0 },
{name=>'wide char data (1x2)', argv => [ [["col1"], ["no wide character"], ["宽å"]] ], include_by_default=>0 },
{name=>'color data (1x2)' , argv => [ [["col1"], ["no color"], ["\e[31m\e[1mwith\e[0m \e[32m\e[1mcolor\e[0m"]] ], include_by_default=>0 },
],
};
1;
# ABSTRACT: List of modules that generate text tables
__END__
=pod
=encoding UTF-8
=head1 NAME
Acme::CPANModules::TextTable - List of modules that generate text tables
=head1 VERSION
This document describes version 0.016 of Acme::CPANModules::TextTable (from Perl distribution Acme-CPANModules-TextTable), released on 2023-10-31.
=head1 SYNOPSIS
To run benchmark with default option:
% bencher --cpanmodules-module TextTable
To run module startup overhead benchmark:
% bencher --module-startup --cpanmodules-module TextTable
For more options (dump scenario, list/include/exclude/add participants, list/include/exclude/add datasets, etc), see L<bencher> or run C<bencher --help>.
=head1 DESCRIPTION
Currently excluded from this list are:
=over
=item * L<Text::SimpleTable::AutoWidth> (wrapper to L<Text::SimpleTable>);
=item * L<Text::ASCIITable::EasyTable> (wrapper to L<Text::ASCIITable>);
=back
=head1 ACME::CPANMODULES ENTRIES
=over
=item L<Text::Table::Any>
Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>
This is a frontend for many text table modules as backends. The interface is
dead simple, following L<Text::Table::Tiny>. The main drawback is that it
currently does not allow passing (some, any) options to each backend.
=item L<Text::SimpleTable>
Author: L<MRAMBERG|https://metacpan.org/author/MRAMBERG>
As its name implies, a simple table-generating module with minimal documentation
and a few choices or border characters. You have to set the width of all columns
manually.
=item L<Text::UnicodeBox::Table>
Author: L<EWATERS|https://metacpan.org/author/EWATERS>
The main feature of this module is the various border style it provides drawn
( run in 1.784 second using v1.01-cache-2.11-cpan-ceb78f64989 )