|
|
@ -394,11 +394,18 @@ class PythonSphinxMapper(SphinxMapperBase):
|
|
|
|
# or type annotations (eg classes with inheritance),
|
|
|
|
# or type annotations (eg classes with inheritance),
|
|
|
|
# so do this after all children have been created.
|
|
|
|
# so do this after all children have been created.
|
|
|
|
lines = obj.docstring.splitlines()
|
|
|
|
lines = obj.docstring.splitlines()
|
|
|
|
lines.append("") # Add back the trailing newline that .splitlines removes
|
|
|
|
if lines:
|
|
|
|
if lines and "autodoc-process-docstring" in self.app.events.events:
|
|
|
|
# Add back the trailing newline that .splitlines removes
|
|
|
|
self.app.emit(
|
|
|
|
lines.append("")
|
|
|
|
"autodoc-process-docstring", cls.type, obj.name, None, None, lines
|
|
|
|
if "autodoc-process-docstring" in self.app.events.events:
|
|
|
|
)
|
|
|
|
self.app.emit(
|
|
|
|
|
|
|
|
"autodoc-process-docstring",
|
|
|
|
|
|
|
|
cls.type,
|
|
|
|
|
|
|
|
obj.name,
|
|
|
|
|
|
|
|
None,
|
|
|
|
|
|
|
|
None,
|
|
|
|
|
|
|
|
lines,
|
|
|
|
|
|
|
|
)
|
|
|
|
obj.docstring = "\n".join(lines)
|
|
|
|
obj.docstring = "\n".join(lines)
|
|
|
|
self._record_typehints(obj)
|
|
|
|
self._record_typehints(obj)
|
|
|
|
|
|
|
|
|
|
|
|