i know i can document (module) constants in sphinx with either
#: a tuple of primes
primes = (2, 3, 5, 7, 11, 13, 17)
or
primes = (2, 3, 5, 7, 11, 13, 17)
"""a tuple of primes"""
which will then appear in the sphinx generated documentation; i.e. it will look something like this:
somemodule.primes
= (2, 3, 5, 7, 11, 13, 17)
a tuple of primes
but what if the data is a very long list? then i would like to be able to have a docstring in the documentation but not have the actual data itself in the doc.
this is what i would like to have in the doc:
somemodule.primes
a tuple of primes
is there a way i can achieve this?
for completeness:
i ran sphinx-quickstart
and enabled autodoc:
autodoc: automatically insert docstrings from modules (y/n) [n]: y
the only thing i have added to index.rst
is:
``somemodule``
**************
.. automodule:: somemodule
:members:
and somemodule.py
contains this:
#: a tuple of primes
primes = (2, 3, 5, 7, 11, 13, 17)
then i adapted sys.path
in conf.py
such that somemodule.py
is in that path.