class documentation
class GoogleDocstring: (source)
Known subclasses: pydoctor.napoleon.docstring.NumpyDocstring
Convert Google style docstrings to reStructuredText.
Example
>>> from pydoctor.napoleon import GoogleDocstring >>> docstring = '''One line summary. ... ... Extended description. ... ... Args: ... arg1(int): Description of `arg1` ... arg2(str): Description of `arg2` ... Returns: ... str: Description of return value. ... ''' >>> print(GoogleDocstring(docstring)) One line summary. Extended description. :param arg1: Description of `arg1` :type arg1: int :param arg2: Description of `arg2` :type arg2: str :returns: Description of return value. :returntype: str >>> print(GoogleDocstring(docstring, process_type_fields=True)) One line summary. Extended description. :param arg1: Description of `arg1` :type arg1: `int` :param arg2: Description of `arg2` :type arg2: `str` :returns: Description of return value. :returntype: `str`
Method | __init__ |
No summary |
Method | __str__ |
Return the parsed docstring in reStructuredText format. |
Method | lines |
Return the parsed lines of the docstring in reStructuredText format. |
Instance Variable | warnings |
Warning messages triggered during the conversion. |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _convert |
Tokenize the string type and convert it with additional markup and auto linking, with L{TypeDocstring}. |
Method | _dedent |
Undocumented |
Method | _escape |
Undocumented |
Method | _fix |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _indent |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _partition |
Undocumented |
Method | _partition |
Partition multiple lines on colon. If the type or name span multiple lines, they will be automatically joined. |
Method | _strip |
Undocumented |
Class Variable | _name |
Undocumented |
Instance Variable | _is |
Undocumented |
Instance Variable | _is |
Undocumented |
Instance Variable | _line |
Undocumented |
Instance Variable | _parsed |
Undocumented |
Instance Variable | _process |
Undocumented |
Instance Variable | _section |
Undocumented |
Instance Variable | _sections |
Undocumented |
Parameters | |
docstring:str or list of str | The docstring to parse, given either as a string or split into individual lines. |
isbool | If the documented object is an attribute,
it will use the _parse_attribute_docstring method. |
processbool | Whether to process the type fields or to leave them untouched (default) in order to be processed later. Value process_type_fields=False is currently only used in the tests. |
Tokenize the string type and convert it with additional markup and auto linking, with L{TypeDocstring}.
Parameters | |
_type:bool | the string type to convert. |
isbool | Whether the string is the content of a :type: or rtype field.
If this is True and GoogleDocstring 's process_type_fields is False (defaults),
the type will NOT be converted (instead, it's returned as is) because it will be converted by the code provided by
ParsedTypeDocstring class in a later stage of docstring parsing. |
lineno:int | Undocumented |
Returns | |
str | Undocumented |
Partition multiple lines on colon. If the type or name span multiple lines, they will be automatically joined.
Parameters | |
lines:List[ | Lines to split |
formatCallable[ | Validator returning Note The validator will be called with a one line string as the argument. Note Only used for multiline fields. |
Returns | |
Tuple[ |