Como documentar pacotes Python usando o Sphinx
Estou tentando documentar um pacote em Python. No momento, tenho a seguinte estrutura de diretórios:
.
└── project
├── _build
│ ├── doctrees
│ └── html
│ ├── _sources
│ └── _static
├── conf.py
├── index.rst
├── __init__.py
├── make.bat
├── Makefile
├── mod1
│ ├── foo.py
│ └── __init__.py
├── mod2
│ ├── bar.py
│ └── __init__.py
├── _static
└── _templates
Esta árvore é o resultado do disparo desphinx-quickstart
. Noconf.py
Eu descomenteisys.path.insert(0, os.path.abspath('.'))
e eu tenhoextensions = ['sphinx.ext.autodoc']
.
Minhasindex.rst
é:
.. FooBar documentation master file, created by
sphinx-quickstart on Thu Aug 28 14:22:57 2014.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to FooBar's documentation!
==================================
Contents:
.. toctree::
:maxdepth: 2
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Em todas as__init__.py
tenho um docstring e o mesmo vale para os módulosfoo.py
ebar.py
. No entanto, ao executarmake html
no projeto, não vejo nenhum dos docstings.