I want the left menu of Sphinx documentation to have the modules of my project, and I want to define this content from the __init__.py
file of the main module. This is what I am trying:
__init__.py
'''
Components platform:
--------------------
* language: python
* rest framework: flask-restful
* testing: pytest
* documentation: sphinx
.. toctree::
:maxdepth: 1
:caption: Contents:
.. automodule:: sacbeh.main
.. automodule:: sacbeh.api
.. automodule:: sacbeh.controllers
'''
The problem is that when I run make html
, I get these errors:
/Users/hugovillalobos/Documents/Code/sacbeh-project/sacbeh-backend/sacbeh/__init__.py:docstring of sacbeh:9: WARNING: toctree contains reference to nonexisting document '.. automodule:: sacbeh.main'
/Users/hugovillalobos/Documents/Code/sacbeh-project/sacbeh-backend/sacbeh/__init__.py:docstring of sacbeh:9: WARNING: toctree contains reference to nonexisting document '.. automodule:: sacbeh.api'
/Users/hugovillalobos/Documents/Code/sacbeh-project/sacbeh-backend/sacbeh/__init__.py:docstring of sacbeh:9: WARNING: toctree contains reference to nonexisting document '.. automodule:: sacbeh.controllers'
I haven't found a way to achieve this.
EDIT
I know it doesn't work the way it is. I have made it work using rest files, but I am trying to find a way of documenting my project with the least amount of extra files possible, so I want to use docstrings the most possible.
I believe my question is valid, but not necessarily feasible.