NAME
BorderStyleRole::Source::ASCIIArt - Get border characters from ASCII art
VERSION
This document describes version 3.0.3 of BorderStyleRole::Source::ASCIIArt (from Perl distribution BorderStyle), released on 2023-07-14.
SYNOPSIS
package BorderStyle::YourStyle;
use strict;
use warnings;
use utf8;
use Role::Tiny::With;
with 'BorderStyleRole::Source::ASCIIArt';
our $PICTURE = <<'_';
┌───────┬───┬───┐'
│ ..... │ . │ . │'
│ ..... ├───┼───┤'
│ ..... │ . │ . │'
│ ..... ├───┴───┤'
│ ..... │ ..... │'
├───┬───┤ ..... │'
│ . │ . │ ..... │'
└───┴───┴───────┘'
_
our %BORDER = (
v => 3,
summary => 'Summary of your style',
utf8 => 1,
);
1;
DESCRIPTION
To define border characters, you declare $PICTURE
package variable in your border style class, using a specific ASCII art as shown in the Synopsis. You then modify the border characters (the lines, not the spaces and the dots) according to your actual style. This is a convenient way to define border styles instead of declaring the characters specifically using a hash. Note that empty border characters are not supported by this role.
For more complex border styles, you define @PICTURES
instead, with each element being a hash:
# this style is single bold line for header rows, single line for data rows.
our @PICTURES = (
{
# imagine every line is a header-row separator line (theoretically, the
# top and bottom lines won't ever be used as separator though)
for_header_data_separator => 1,
picture => <<'_',
┍━━━━━━━┯━━━┯━━━┑'
╿ ..... ╿ , ╿ . ╿'
╿ ..... ┡━━━╇━━━┫'
╿ ..... ╿ . ╿ . ╿'
╿ ..... ┡━━━┻━━━┫'
╿ ..... ╿ ..... ╿'
┡━━━┯━━━┩ ..... ╿'
╿ . ╿ . ╿ ..... ╿'
┗━━━┻━━━┻━━━━━━━┛'
_
},
{
for_header_row => 1,
picture => <<'_',
┏━━━━━━━┳━━━┳━━━┓'
┃ ..... ┃ , ┃ . ┃'
┃ ..... ┣━━━╋━━━┫'
┃ ..... ┃ . ┃ . ┃'
┃ ..... ┣━━━┻━━━┫'
┃ ..... ┃ ..... ┃'
┣━━━┳━━━┫ ..... ┃'
┃ . ┃ . ┃ ..... ┃'
┗━━━┻━━━┻━━━━━━━┛'
_
},
{
picture => <<'_',
┌───────┬───┬───┐'
│ ..... │ . │ . │'
│ ..... ├───┼───┤'
│ ..... │ . │ . │'
│ ..... ├───┴───┤'
│ ..... │ ..... │'
├───┬───┤ ..... │'
│ . │ . │ ..... │'
└───┴───┴───────┘'
_
},
);
Internally, some characters from the ASCII art will be taken and put into %CHARS
or @MULTI_CHARS
and this role's get_border_char()
will pass to BorderStyleRole::Source::Hash's.
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/BorderStyle.
SOURCE
Source repository is at https://github.com/perlancar/perl-BorderStyle.
SEE ALSO
AUTHOR
perlancar <perlancar@cpan.org>
CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.
COPYRIGHT AND LICENSE
This software is copyright (c) 2023, 2022, 2021, 2020 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=BorderStyle
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.