.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::LineFold 3pm" .TH Text::LineFold 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Text::LineFold \- Line Folding for Plain Text .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Text::LineFold; \& $lf = Text::LineFold\->new(); \& \& # Fold lines \& $folded = $lf\->fold($string, \*(AqPLAIN\*(Aq); \& $indented = $lf\->fold(\*(Aq \*(Aq x 8, \*(Aq \*(Aq x 4, $string); \& \& # Unfold lines \& $unfolded = $lf\->unfold($string, \*(AqFIXED\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Text::LineFold folds or unfolds lines of plain text. As it mainly focuses on plain text e\-mail messages, \&\s-1RFC 3676\s0 flowed format is also supported. .SS "Public Interface" .IX Subsection "Public Interface" .IP "new ([\s-1KEY\s0 => \s-1VALUE, ...\s0])" 4 .IX Item "new ([KEY => VALUE, ...])" \&\fIConstructor\fR. About \s-1KEY\s0 => \s-1VALUE\s0 pairs see config method. .ie n .IP "$self\->config (\s-1KEY\s0)" 4 .el .IP "\f(CW$self\fR\->config (\s-1KEY\s0)" 4 .IX Item "$self->config (KEY)" .PD 0 .ie n .IP "$self\->config ([\s-1KEY\s0 => \s-1VAL, ...\s0])" 4 .el .IP "\f(CW$self\fR\->config ([\s-1KEY\s0 => \s-1VAL, ...\s0])" 4 .IX Item "$self->config ([KEY => VAL, ...])" .PD \&\fIInstance method\fR. Get or update configuration. Following \s-1KEY\s0 => \s-1VALUE\s0 pairs may be specified. .RS 4 .IP "Charset => \s-1CHARSET\s0" 4 .IX Item "Charset => CHARSET" Character set that is used to encode string. It may be string or MIME::Charset object. Default is \f(CW"UTF\-8"\fR. .IP "Language => \s-1LANGUAGE\s0" 4 .IX Item "Language => LANGUAGE" Along with Charset option, this may be used to define language/region context. Default is \f(CW"XX"\fR. See also \*(L"Context\*(R" in Unicode::LineBreak option. .IP "Newline => \s-1STRING\s0" 4 .IX Item "Newline => STRING" String to be used for newline sequence. Default is \f(CW"\en"\fR. .IP "OutputCharset => \s-1CHARSET\s0" 4 .IX Item "OutputCharset => CHARSET" Character set that is used to encode result of \fBfold()\fR/\fBunfold()\fR. It may be string or MIME::Charset object. If a special value \f(CW"_UNICODE_"\fR is specified, result will be Unicode string. Default is the value of Charset option. .IP "TabSize => \s-1NUMBER\s0" 4 .IX Item "TabSize => NUMBER" Column width of tab stops. When 0 is specified, tab stops are ignored. Default is 8. .IP "BreakIndent" 4 .IX Item "BreakIndent" .PD 0 .IP "CharMax" 4 .IX Item "CharMax" .IP "ColMax" 4 .IX Item "ColMax" .IP "ColMin" 4 .IX Item "ColMin" .IP "ComplexBreaking" 4 .IX Item "ComplexBreaking" .IP "EAWidth" 4 .IX Item "EAWidth" .IP "HangulAsAL" 4 .IX Item "HangulAsAL" .IP "LBClass" 4 .IX Item "LBClass" .IP "LegacyCM" 4 .IX Item "LegacyCM" .IP "Prep" 4 .IX Item "Prep" .IP "Urgent" 4 .IX Item "Urgent" .PD See \*(L"Options\*(R" in Unicode::LineBreak. .RE .RS 4 .RE .ie n .IP "$self\->fold (\s-1STRING,\s0 [\s-1METHOD\s0])" 4 .el .IP "\f(CW$self\fR\->fold (\s-1STRING,\s0 [\s-1METHOD\s0])" 4 .IX Item "$self->fold (STRING, [METHOD])" .PD 0 .ie n .IP "$self\->fold (\s-1INITIAL_TAB, SUBSEQUENT_TAB, STRING, ...\s0)" 4 .el .IP "\f(CW$self\fR\->fold (\s-1INITIAL_TAB, SUBSEQUENT_TAB, STRING, ...\s0)" 4 .IX Item "$self->fold (INITIAL_TAB, SUBSEQUENT_TAB, STRING, ...)" .PD \&\fIInstance method\fR. \&\fBfold()\fR folds lines of string \s-1STRING\s0 and returns it. Surplus SPACEs and horizontal tabs at end of line are removed, newline sequences are replaced by that specified by Newline option and newline is appended at end of text if it does not exist. Horizontal tabs are treated as tab stops according to TabSize option. .Sp By the first style, following options may be specified for \s-1METHOD\s0 argument. .RS 4 .ie n .IP """FIXED""" 4 .el .IP "\f(CW``FIXED''\fR" 4 .IX Item """FIXED""" Lines preceded by \f(CW">"\fR won't be folded. Paragraphs are separated by empty line. .ie n .IP """FLOWED""" 4 .el .IP "\f(CW``FLOWED''\fR" 4 .IX Item """FLOWED""" \&\f(CW"Format=Flowed; DelSp=Yes"\fR formatting defined by \s-1RFC 3676.\s0 .ie n .IP """PLAIN""" 4 .el .IP "\f(CW``PLAIN''\fR" 4 .IX Item """PLAIN""" Default method. All lines are folded. .RE .RS 4 .Sp Second style is similar to \*(L"\fBwrap()\fR\*(R" in Text::Wrap. All lines are folded. \&\s-1INITIAL_TAB\s0 is inserted at beginning of paragraphs and \s-1SUBSEQUENT_TAB\s0 at beginning of other broken lines. .RE .ie n .IP "$self\->unfold (\s-1STRING, METHOD\s0)" 4 .el .IP "\f(CW$self\fR\->unfold (\s-1STRING, METHOD\s0)" 4 .IX Item "$self->unfold (STRING, METHOD)" Conjunct folded paragraphs of string \s-1STRING\s0 and returns it. .Sp Following options may be specified for \s-1METHOD\s0 argument. .RS 4 .ie n .IP """FIXED""" 4 .el .IP "\f(CW``FIXED''\fR" 4 .IX Item """FIXED""" Default method. Lines preceded by \f(CW">"\fR won't be conjuncted. Treat empty line as paragraph separator. .ie n .IP """FLOWED""" 4 .el .IP "\f(CW``FLOWED''\fR" 4 .IX Item """FLOWED""" Unfold \f(CW"Format=Flowed; DelSp=Yes"\fR formatting defined by \s-1RFC 3676.\s0 .ie n .IP """FLOWEDSP""" 4 .el .IP "\f(CW``FLOWEDSP''\fR" 4 .IX Item """FLOWEDSP""" Unfold \f(CW"Format=Flowed; DelSp=No"\fR formatting defined by \s-1RFC 3676.\s0 .RE .RS 4 .RE .SH "BUGS" .IX Header "BUGS" Please report bugs or buggy behaviors to developer. .PP \&\s-1CPAN\s0 Request Tracker: . .SH "VERSION" .IX Header "VERSION" Consult \f(CW$VERSION\fR variable. .SH "SEE ALSO" .IX Header "SEE ALSO" Unicode::LineBreak, Text::Wrap. .SH "AUTHOR" .IX Header "AUTHOR" Copyright (C) 2009\-2012 Hatuka*nezumi \- \s-1IKEDA\s0 Soji . .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.