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:

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.

Note

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