74 const c_whitespace =
"\t\n\013\014\r ";
78 any sum (
list la, *any start);
81 string translate (
string text,
hash table);
84 string xsprintf (
string fmt,
hash args);
113 string expandtabs (
string text,
int tabsize = 8);
170 string initial_indent =
"";
171 string subsequent_indent =
"";
172 bool expand_tabs =
True;
173 bool replace_whitespace =
True;
174 bool fix_sentence_endings =
False;
175 bool break_long_words =
True;
176 bool drop_whitespace =
True;
177 bool break_on_hyphens =
True;
180 string placeholder =
' [...]';
185 hash whitespace_trans;
187 string wordsep_simple_re;
188 string sentence_end_re;
192 constructor (*
hash opts);
262 _handle_long_word (reference reversed_chunks, reference cur_line,
int cur_len,
int width);
287 list _split_chunks (
string text);
313 string fill (
string text);
338 string fill (
string text,
int width=70, *
hash opts);
354 string shorten (
string text,
int width, *
hash opts);
359 const c_whitespace_only_re =
'^[ \t]+$';
360 const c_leading_whitespace_re =
'(^[ \t]*)(?:[^ \t\n])';
372 string dedent (
string text);
382 string indent (
string text,
string prefix, *code predicate);
string fill(string text, int width=70, *hash opts)
Fill a single paragraph of text, returning a new string.
list wrap(string text)
Wrap a single paragraph of text, returning a list of wrapped lines.
_handle_long_word(reference reversed_chunks, reference cur_line, int cur_len, int width)
list wrap(string text, int width=70, *hash opts)
Wrap a single paragraph of text, returning a list of wrapped lines.
Definition: TextWrap.qm.dox.h:165
string fill(string text)
Fill a single paragraph of text, returning a new string.
list _wrap_chunks(list chunks)
string expandtabs(string text, int tabsize=8)
Return a copy of the string where all tab characters are expanded using spaces.
string _munge_whitespace(string text)
Definition: TextWrap.qm.dox.h:63
string dedent(string text)
Remove any common leading whitespace from every line in 'text'.
_fix_sentence_endings(reference chunks)
string indent(string text, string prefix, *code predicate)
Adds 'prefix' to the beginning of selected lines in 'text'.
Main namespace for all public symbols in the TextWrap module.
Definition: TextWrap.qm.dox.h:69
string shorten(string text, int width, *hash opts)
Collapse and truncate the given text to fit in the given width.