App-ansifold
view release on metacpan or search on metacpan
script/ansifold view on Meta::CPAN
appropiate prefix if necessary. Originally made for
L<App::Greple::frame> module.
=head1 LINE BREAKING
Line break adjustment is supported for ASCII word boundaries. As for
Japanese, more complicated prohibition processing is performed. Use
option B<-s> to enable everything.
=head2 B<--boundary>=I<word>|I<space>
This option prohibit breaking line in the middle of ASCII/Latin word.
Context of word is defined by option value; I<word> means
alpha-numeric sequence, while I<space> means simply non-space
printables.
=head2 B<--linebreak>=I<all>|I<runin>|I<runout>|I<none>
Option B<--linebreak> takes a value of I<all>, I<runin>, I<runout> or
I<none>. Default value is I<none>.
When B<--linebreak> option is enabled, if the cut-off text start with
space or prohibited characters (e.g. closing parenthesis), they are
ran-in at the end of current line as much as possible.
If the trimmed text end with prohibited characters (e.g. opening
parenthesis), they are ran-out to the head of next line, provided it
fits to maximum width.
=head2 B<--runin>=I<width>, B<--runout>=I<width>
Maximum width of run-in/run-out characters are defined by B<--runin>
and B<--runout> option. Default values are 4.
=head2 B<--smart>, B<-s>
Option B<--smart> (or simply B<-s>) set both B<--boundary=word> and
B<--linebreak=all>, and enables all smart text formatting capability.
Use option B<--boundary=space> if you want the command to behave more
like B<-s> option of L<fold(1)> command.
=head1 TAB EXPANSION
=head2 B<--expand>
Option B<--expand> (or B<-x>) enables tab character expansion.
$ ansifold --expand
Takes optional number for tabstop and it precedes to B<--tabstop>
option.
$ ansifold -x4w-1
=head2 B<--tabhead>, B<--tabspace>
Each tab character is converted to B<tabhead> and following
B<tabspace> characters (both are space by default). They can be
specified by B<--tabhead> and B<--tabspace> option. If the option
value is longer than single characger, it is evaluated as unicode
name. Next example makes tab character visible keeping text layout.
$ ansifold --expand --tabhead="MEDIUM SHADE" --tabspace="LIGHT SHADE"
=head2 B<--tabstyle>
Option B<--tabstyle> allow to set B<--tabhead> and B<--tabspace>
characters at once according to the given style name. Select from
C<dot>, C<symbol> or C<shade>. Styles are defined in
L<Text::ANSI::Fold> library.
$ ansifold --expand --tabstyle=shade
=head1 COLRM
=head2 B<--colrm> [ start [ end ] ]
Option B<--colrm> takes L<colrm(1)> command compatible arguments and
implicitly set B<--separate> empty. Next command behave exactly like
C<colrm start end> and takes care of ANSI terminal sequences.
$ ansifold --colrm start end
=head1 FILES
=over 4
=item F<~/.ansifoldrc>
Start-up file.
See L<Getopt::EX::Module> for format.
=back
=head1 INSTALL
=head2 CPANMINUS
$ cpanm App::ansifold
=head1 SEE ALSO
L<ansifold|https://github.com/kaz-utashiro/App-ansifold>
L<ansiexpand|https://github.com/kaz-utashiro/App-ansiexpand>
L<Text::ANSI::Fold|https://github.com/kaz-utashiro/Text-ANSI-Fold>
L<Text::ANSI::Fold::Util|https://github.com/kaz-utashiro/Text-ANSI-Fold-Util>
L<Getopt::EX::Numbers>
L<https://www.w3.org/TR/jlreq/>
Requirements for Japanese Text Layout,
W3C Working Group Note 11 August 2020
=head1 AUTHOR
Kazumasa Utashiro
=head1 LICENSE
Copyright 2018-2022 Kazumasa Utashiro
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
# LocalWords: unicode ansifold LANG colrm KINSOKU ansiexpand
# LocalWords: ansicolrm
( run in 2.644 seconds using v1.01-cache-2.11-cpan-437f7b0c052 )