App-ansifold
view release on metacpan or search on metacpan
appropiate prefix if necessary. Originally made for
[App::Greple::frame](https://metacpan.org/pod/App%3A%3AGreple%3A%3Aframe) module.
# LINE BREAKING
Line break adjustment is supported for ASCII word boundaries. As for
Japanese, more complicated prohibition processing is performed. Use
option **-s** to enable everything.
## **--boundary**=_word_|_space_
This option prohibit breaking line in the middle of ASCII/Latin word.
Context of word is defined by option value; _word_ means
alpha-numeric sequence, while _space_ means simply non-space
printables.
## **--linebreak**=_all_|_runin_|_runout_|_none_
Option **--linebreak** takes a value of _all_, _runin_, _runout_ or
_none_. Default value is _none_.
When **--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.
## **--runin**=_width_, **--runout**=_width_
Maximum width of run-in/run-out characters are defined by **--runin**
and **--runout** option. Default values are 4.
## **--smart**, **-s**
Option **--smart** (or simply **-s**) set both **--boundary=word** and
**--linebreak=all**, and enables all smart text formatting capability.
Use option **--boundary=space** if you want the command to behave more
like **-s** option of [fold(1)](http://man.he.net/man1/fold) command.
# TAB EXPANSION
## **--expand**
Option **--expand** (or **-x**) enables tab character expansion.
$ ansifold --expand
Takes optional number for tabstop and it precedes to **--tabstop**
option.
$ ansifold -x4w-1
## **--tabhead**, **--tabspace**
Each tab character is converted to **tabhead** and following
**tabspace** characters (both are space by default). They can be
specified by **--tabhead** and **--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"
## **--tabstyle**
Option **--tabstyle** allow to set **--tabhead** and **--tabspace**
characters at once according to the given style name. Select from
`dot`, `symbol` or `shade`. Styles are defined in
[Text::ANSI::Fold](https://metacpan.org/pod/Text%3A%3AANSI%3A%3AFold) library.
$ ansifold --expand --tabstyle=shade
# COLRM
## **--colrm** \[ start \[ end \] \]
Option **--colrm** takes [colrm(1)](http://man.he.net/man1/colrm) command compatible arguments and
implicitly set **--separate** empty. Next command behave exactly like
`colrm start end` and takes care of ANSI terminal sequences.
$ ansifold --colrm start end
# FILES
- `~/.ansifoldrc`
Start-up file.
See [Getopt::EX::Module](https://metacpan.org/pod/Getopt%3A%3AEX%3A%3AModule) for format.
# INSTALL
## CPANMINUS
$ cpanm App::ansifold
# SEE ALSO
[ansifold](https://github.com/kaz-utashiro/App-ansifold)
[ansiexpand](https://github.com/kaz-utashiro/App-ansiexpand)
[Text::ANSI::Fold](https://github.com/kaz-utashiro/Text-ANSI-Fold)
[Text::ANSI::Fold::Util](https://github.com/kaz-utashiro/Text-ANSI-Fold-Util)
[Getopt::EX::Numbers](https://metacpan.org/pod/Getopt%3A%3AEX%3A%3ANumbers)
[https://www.w3.org/TR/jlreq/](https://www.w3.org/TR/jlreq/)
Requirements for Japanese Text Layout,
W3C Working Group Note 11 August 2020
# AUTHOR
Kazumasa Utashiro
# LICENSE
Copyright 2018-2022 Kazumasa Utashiro
( run in 0.568 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )