marsh.doc
¶
Tools for producing documentation.
marsh.doc.terminal
¶
- format_terminal_value(value, width=None, description=None, indent=2, description_indent=24, description_margin=4)[source]¶
Create a help message in the same style as
argparse.ArgumentParser
for a value and its description- Parameters:
value (
str
) – The string value.description (
Optional
[str
]) – A text description for the value.indent (
int
) – The indentation of the value in number of blank spaces.description_indent (
int
) – The indentation of the description in number of blank spaces.description_margin (
int
) – The minimum number of blank spaces between the description and the value. The description will be started on the next line if the resulting margin would be smaller than this on the line containing the argument.
- Return type:
- Returns:
The help message.
marsh.doc.markdown
¶
marsh.doc.restructuredtext
¶
- format_table(headers, rows, title=None, widths=None)[source]¶
Create a RST list-table.
Any newlines in the headers or rows are replaced with whitespace.
- Parameters:
- Return type:
- Returns:
The table in RST format.
- format_types(source, section='^')[source]¶
Return a RST-formatted string containing registered schema types that have static documention.
A description below each type is included when available.