Undocumented
Class |
|
This class helps with formatting text-based help pages. It's usually just needed for very special internal cases, but it's also exposed so that developers can write their own fancy outputs. |
Function | iter |
Undocumented |
Function | join |
Given a list of option strings this joins them in the most appropriate way and returns them in the form ``(formatted_string, any_prefix_is_slash)`` where the second item in the tuple is a flag that indicates if any of the option prefixes was a slash. |
Function | measure |
Undocumented |
Function | wrap |
A helper function that intelligently wraps text. By default, it assumes that it operates on a single paragraph of text but if the `preserve_paragraphs` parameter is provided it will intelligently handle paragraphs (defined by two empty lines). |
Constant | FORCED |
Undocumented |
Undocumented
Parameters | |
rows:t.Iterable[ | Undocumented |
colint | Undocumented |
Returns | |
t.Iterator[ | Undocumented |
Given a list of option strings this joins them in the most appropriate way and returns them in the form ``(formatted_string, any_prefix_is_slash)`` where the second item in the tuple is a flag that indicates if any of the option prefixes was a slash.
Parameters | |
options:t.Sequence[ | Undocumented |
Returns | |
t.Tuple[ | Undocumented |
A helper function that intelligently wraps text. By default, it assumes that it operates on a single paragraph of text but if the `preserve_paragraphs` parameter is provided it will intelligently handle paragraphs (defined by two empty lines). If paragraphs are handled, a paragraph can be prefixed with an empty line containing the ``\b`` character (``\x08``) to indicate that no rewrapping should happen in that block. :param text: the text that should be rewrapped. :param width: the maximum width for the text. :param initial_indent: the initial indent that should be placed on the first line as a string. :param subsequent_indent: the indent string that should be placed on each consecutive line. :param preserve_paragraphs: if this flag is set then the wrapping will intelligently handle paragraphs.
Parameters | |
text:str | Undocumented |
width:int | Undocumented |
initialstr | Undocumented |
subsequentstr | Undocumented |
preservebool | Undocumented |
Returns | |
str | Undocumented |