File: README.rst

package info (click to toggle)
python-repoze.sphinx.autointerface 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: python: 312; makefile: 4
file content (68 lines) | stat: -rw-r--r-- 1,935 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
repoze.sphinx.autointerface README
==================================

.. image:: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml/badge.svg
    :target: https://github.com/repoze/repoze.sphinx.autointerface/actions/workflows/ci-tests.yml

.. image:: https://img.shields.io/pypi/v/repoze.sphinx.autointerface.svg
    :target: https://pypi.python.org/pypi/repoze.sphinx.autointerface

.. image:: https://img.shields.io/pypi/pyversions/repoze.sphinx.autointerface.svg
    :target: https://pypi.python.org/pypi/repoze.sphinx.autointerface


Overview
--------

Thie package defines an extension for the
`Sphinx <https://www.sphinx-doc.org/en/master/>`_ documentation system.
The extension allows generation of API documentation by introspection of
`zope.interface <https://pypi.org/project/zope.interface/>`_ instances in
code.


Installation
------------

Install via ``pip``:

.. code-block:: bash

    pip install repoze.sphinx.autointerface


Registering the Extension
-------------------------

Add ``repoze.sphinx.autointerface`` to the ``extensions`` list in the
``conf.py`` of the Sphinx documentation for your product.

.. code-block:: python

    extensions = [
        "sphinx.ext.autodoc",
        "sphinx.ext.doctest",
        "repoze.sphinx.autointerface",
    ]


Using the Extension
-------------------

At appropriate points in your document, call out the autodoc interface.

.. code-block:: rst

    .. autointerface:: yourpackage.interfaces.IFoo

Output from the directive includes

- the fully-qualified interface name
- any base interfaces
- the docstring from the interface, rendered as reStructuredText
- the members of the interface (methods and attributes)

  * For each attribute, the output includes the attribute name
    and its description.
  * For each method, the output includes the method name, its signature,
    and its docstring (also rendered as reStructuredText).