Hawkmoth is a Sphinx extension that can be further extended with other Sphinx extensions.


See sphinx.application.Sphinx.connect() on how to connect events.

func(app, lines, transform, options)

This is similar to the autodoc-process-docstring event in the sphinx.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 to hawkmoth_transform_default, which defaults to None. 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.


Please note that this API is still somewhat experimental and in development. In particular, new arguments may be added in the future.