BorderStyles-Standard

 view release on metacpan or  search on metacpan

lib/BorderStyle/UTF8/SingleLineBoldHeader.pm  view on Meta::CPAN

package BorderStyle::UTF8::SingleLineBoldHeader;

use strict;
use warnings;
use utf8;

use Role::Tiny::With;
with 'BorderStyleRole::Source::ASCIIArt';

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-02-20'; # DATE
our $DIST = 'BorderStyles-Standard'; # DIST
our $VERSION = '0.014'; # VERSION

our @PICTURES = (
    {
        for_header_data_separator => 1,
        picture => <<'_',
┍━━━━━━━┯━━━┯━━━┑'
â•¿ ..... â•¿ . â•¿ . â•¿'
╿ ..... ┡━━━╇━━━┩'
â•¿ ..... â•¿ . â•¿ . â•¿'
╿ ..... ┡━━━┻━━━┩'
â•¿ ..... â•¿ ..... â•¿'
┡━━━┯━━━┩ ..... ╿'
â•¿ . â•¿ . â•¿ ..... â•¿'
┗━━━┻━━━┻━━━━━━━┛'
_
    },
    {
        for_header_row => 1,
        picture => <<'_',
┏━━━━━━━┳━━━┳━━━┓'
┃ ..... ┃ . ┃ . ┃'
┃ ..... ┣━━━╋━━━┫'
┃ ..... ┃ . ┃ . ┃'
┃ ..... ┣━━━┻━━━┫'
┃ ..... ┃ ..... ┃'
┣━━━┳━━━┫ ..... ┃'
┃ . ┃ . ┃ ..... ┃'
┗━━━┻━━━┻━━━━━━━┛'
_
    },
    {
        picture => <<'_',
┌───────┬───┬───┐'
│ ..... │ . │ . │'
│ ..... ├───┼───┤'
│ ..... │ . │ . │'
│ ..... ├───┴───┤'
│ ..... │ ..... │'
├───┬───┤ ..... │'
│ . │ . │ ..... │'
└───┴───┴───────┘'
_
    },
);

our %BORDER = (
    v => 3,
    summary => 'Single-line border (header box bold) with UTF8 characters',
    utf8 => 1,
);

1;
# ABSTRACT: Single-line border (header box bold) with UTF8 characters

__END__

=pod

=encoding UTF-8

=head1 NAME

BorderStyle::UTF8::SingleLineBoldHeader - Single-line border (header box bold) with UTF8 characters

=head1 VERSION

This document describes version 0.014 of BorderStyle::UTF8::SingleLineBoldHeader (from Perl distribution BorderStyles-Standard), released on 2022-02-20.

=head1 SYNOPSIS

To use with L<Text::ANSITable>:

 use Text::ANSITable;
 my $rows =
   [
     ["ColumName1", "ColumnNameB", "ColumnNameC"],
     ["row1A", "row1B", "row1C"],
     ["row2A", "row2B", "row2C"],
     ["row3A", "row3B", "row3C"],
   ];
 my $t = Text::ANSITable->new;
 $t->border_style("UTF8::SingleLineBoldHeader");
 $t->columns($rows->[0]);
 $t->add_row($rows->[$_]) for 1 .. $#{ $rows };
 print $t->draw;


Sample output:

 ┌────────────┬─────────────┬─────────────┐
 │ ColumName1 │ ColumnNameB │ ColumnNameC │
 ├────────────┼─────────────┼─────────────┤
 │ row1A      │ row1B       │ row1C       │
 │ row2A      │ row2B       │ row2C       │
 │ row3A      │ row3B       │ row3C       │
 └────────────┴─────────────┴─────────────┘

To use with L<Text::Table::More>:

 use Text::Table::More qw/generate_table/;
 my $rows =
   [
     ["ColumName1", "ColumnNameB", "ColumnNameC"],
     ["row1A", "row1B", "row1C"],
     ["row2A", "row2B", "row2C"],
     ["row3A", "row3B", "row3C"],
   ];
 generate_table(rows=>$rows, header_row=>1, separate_rows=>1, border_style=>"UTF8::SingleLineBoldHeader");


Sample output:

 ┏━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
 ┃ ColumName1 ┃ ColumnNameB ┃ ColumnNameC ┃
 ┡━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
 │ row1A      │ row1B       │ row1C       │
 ├────────────┼─────────────┼─────────────┤
 │ row2A      │ row2B       │ row2C       │
 ├────────────┼─────────────┼─────────────┤
 │ row3A      │ row3B       │ row3C       │
 └────────────┴─────────────┴─────────────┘
 



( run in 0.829 second using v1.01-cache-2.11-cpan-39bf76dae61 )