I started working on a python module and wanted to document the code "in place". So i set up sphinx in a subdirectory with sphinx-quickstart resulting in this directory structure (only the files i edited are shown):
- myproject/
- __init__.py
- main.py
- docs/ (sphinx directory)
- build/
- source/
- conf.py
- index.rst
- setup.py
My index.rst contains:
Welcome to My Module's documentation!
=====================================
.. toctree::
:maxdepth: 2
:caption: Contents:
.. automodule:: myproject
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
When i run
make html
i get a documentation that is missing the automodule part allthough i documented every class and every method in main.py like this:
class Thing:
"""This class represents Things
:param color: how the thing should look like
"""
def __init__(self, color):
pass
def color(self):
"""Tells you the color of the thing.
:returns: Color string
:rtype: str or unicode
"""
pass
Sys.path is also setup correctly, as it throws now error when making
sys.path.insert(0, os.path.abspath('../../'))
If it is relevant i also include the setup.py:
from setuptools import setup
setup(name='My Module',
version='0.1',
description='Internet of Things',
url='https://example.com',
author='Master Yoda',
author_email='yoda@example.com',
license='GPLv3',
packages=['mymodule'],
zip_safe=False)
What can i change to make autodoc work?