Python Equivalent to Text::Autoformat
BartlebyScrivener
rpdooling at gmail.com
Sun Dec 4 08:58:08 EST 2005
>>try searching on text wrapping<<
I tried that before I posted. Text::Autoformat does a lot more than
textwrap.
"The fundamental task of the autoformat subroutine is to identify and
rearrange independent paragraphs in a text. Paragraphs typically
consist of a series of lines containing at least one non-whitespace
character, followed by one or more lines containing only optional
whitespace. This is a more liberal definition than many other
formatters use: most require an empty line to terminate a paragraph.
Paragraphs may also be denoted by bulleting, numbering, or quoting . .
."
Once a paragraph has been isolated, autoformat fills and re-wraps its
lines according to the margins that are specified in its argument list.
These are placed after the text to be formatted, in a hash reference:"
It's also sensitive to comment characters in code and so on.
But I'll keep looking. Thank you.
bs
More information about the Python-list
mailing list