Extending¶
Hawkmoth is a Sphinx extension that can be further extended with other Sphinx extensions.
Events¶
See sphinx.application.Sphinx.connect()
on how to
connect events.
- hawkmoth-process-docstring¶
- func(app, lines, transform, options)
- Parameters:
app (
sphinx.application.Sphinx
) – The Sphinx application objecttransform (str) – Transformation
options (dict) – The directive options
This is similar to the
autodoc-process-docstring
event in thesphinx.ext.autodoc
extension.The lines argument is the documentation comment, with the comment markers removed, as a list of strings that the event handler may modify in-place.
The transform argument is the
transform
option of the directive being processed, defaulting tohawkmoth_transform_default
, which defaults toNone
. The event handler may use this to decide what, if anything, should be done to lines.The options argument is a dictionary with all the options given to the directive being processed.
Note
Please note that this API is still somewhat experimental and in development. In particular, new arguments may be added in the future.