Oven logo

Oven

zopeext for Sphinx

Test badge PyPI badge gh: tag badge Coverage badge Documentation status badge Python versions badge

This extension provides an autointerface directive for Zope interfaces.

Installation

python3 -m pip install sphinxcontrib-zopeext
python3 -m pip install sphinxcontrib-zopeext[test,doc]

This requires Sphinx and zope.interface. The second form includes the test and doc extras needed to run the tests and/or build the documentation.

Usage

In the build configuration file (the conf.py in your Sphinx documentation directory) add sphinxcontrib.zopeext.autointerface to your extensions list:

# conf.py
...
extensions = [..., 'sphinxcontrib.zopeext.autointerface', ...]

Then, in your documentation, use autointerface as you would use autoclass. You can refer to the interface with the :py:interface: role example.IMyInterface as you would use the :py:class: role to refer to the implementation example.MyImplementation:

.. automodule:: example
   :show-inheritance:
   :inherited-members:

One can also limit which members are displayed, just as you would with .. autoclass:

.. autointerface:: example.IMyInterface
   :members: x, equals
.. autoclass:: example.MyImplementation
   :members: x, equals