Published
Provides sphinxcontrib.zopeext.autointerface for documenting Zope interfaces.
pip install sphinxcontrib-zopeext
Package Downloads
Authors
Project URLs
Requires Python
>=3.7
Dependencies
- zope.interface
>=5.5.2
- Sphinx
>=4.5.0
- importlib-metadata
>=4.8.3; python_version < "3.8" and extra == "test"
- pip
>=22.2.1; extra == "test"
- pytest-cov
>=4.0.0; extra == "test"
- sphinx-testing
>=1.0.1; extra == "test"
- pytest
>=7.2.2; extra == "test"
- sphinx-book-theme
>=0.0.39; extra == "doc"
- sphinx-autobuild
>=2021.3.14; extra == "doc"
zopeext for Sphinx
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