class ParsedDocstring(abc.ABC): (source)
Known subclasses: pydoctor.epydoc.markup._types.ParsedTypeDocstring, pydoctor.epydoc.markup.epytext.ParsedEpytextDocstring, pydoctor.epydoc.markup.plaintext.ParsedPlaintextDocstring, pydoctor.epydoc.markup.restructuredtext.ParsedRstDocstring
Constructor: ParsedDocstring(fields)
A standard intermediate representation for parsed docstrings that can be used to generate output. Parsed docstrings are produced by markup parsers such as pydoctor.epydoc.markup.epytext.parse_docstring() or pydoctor.epydoc.markup.restructuredtext.parse_docstring().
Subclasses must at least implement has_body() and to_node().
A default implementation for to_stan() method, relying on to_node() is provided. But some subclasses override this behaviour.
| Method | __init__ |
Undocumented |
| Method | get |
Returns the summary of this docstring. |
| Method | get |
The table of contents of the docstring if titles are defined or None. |
| Method | to |
Translate this docstring to a nodes.document. |
| Method | to |
Translate this docstring to a Stan tree. |
| Method | to |
Translate this docstring to a string. The default implementation depends on to_node. |
| Instance Variable | fields |
A list of Fields, each of which encodes a single field. The field's bodies are encoded as ParsedDocstrings. |
| Property | has |
Does this docstring have a non-empty body? |
| Instance Variable | _stan |
Undocumented |
pydoctor.epydoc.markup._types.ParsedTypeDocstring, pydoctor.epydoc.markup.epytext.ParsedEpytextDocstring, pydoctor.epydoc.markup.plaintext.ParsedPlaintextDocstring, pydoctor.epydoc.markup.restructuredtext.ParsedRstDocstringTranslate this docstring to a nodes.document.
| Returns | |
nodes.document | The docstring presented as a nodes.document. |
| Note | |
Some ParsedDocstring subclasses do not support docutils nodes. This method might raise NotImplementedError in such cases. (i.e. pydoctor.epydoc.markup._types.ParsedTypeDocstring) |
pydoctor.epydoc.markup._pyval_repr.ColorizedPyvalRepr, pydoctor.epydoc.markup.plaintext.ParsedPlaintextDocstringTranslate this docstring to a Stan tree.
| Parameters | |
docstringDocstringLinker | An HTML translator for crossreference links into and out of the docstring. |
| Returns | |
Tag | The docstring presented as a stan tree. |
| Raises | |
Exception | If something went wrong. Callers should generally catch Exception when calling to_stan(). |
| Note | |
The default implementation relies on functionalities provided by node2stan.node2stan and ParsedDocstring.to_node(). |
A list of Fields, each of which encodes a single field. The field's bodies are encoded as ParsedDocstrings.
pydoctor.epydoc.markup._types.ParsedTypeDocstring, pydoctor.epydoc.markup.epytext.ParsedEpytextDocstring, pydoctor.epydoc.markup.plaintext.ParsedPlaintextDocstring, pydoctor.epydoc.markup.restructuredtext.ParsedRstDocstringDoes this docstring have a non-empty body?
The body is the part of the docstring that remains after the fields have been split off.