Dear sphinx-team and sphinx-users,
I am currently working on documenting some code, and keep on getting the following warning/error (this is one example of multiple):
I think it has to do with "-" in the sub-directory names, without being sure. Since multiple people are working on - and using the code I can't change the directory names. Do you know if there is a way to work around this error and still get the scripts documented? Or if there are some settings in sphinx that can be changed to accommodate this?
Below I have sketched out a simplified representation of the project and how I have built the sphinx documentation:
.
|-- README.rst
|-- components
| |-- component-1
| | |-- README.rst
| | |-- orc_component_1
| | | |-- app.py
| | | |-- services.py
| | | `-- utils.py
| |-- component-2
| | |-- README.rst
| | |-- orc_component_2
| | | |-- app.py
| | | |-- services.py
| | | `-- utils.py
|-- docs
| |-- Makefile
| |-- build
| | |-- doctrees
| | `-- html
| |-- make.bat
| `-- source
| |-- _static
| |-- _templates
| |-- components.rst
| |-- conf.py
| |-- index.rst
| |-- readme_components.rst
.... and so on..
in conf.py, the sys.path is set to:
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
the index.rst
Welcome!
========
.. toctree::
:maxdepth: 2
:caption: Modules:
components
readme-components
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
the readme_components:
.. include:: ../../README.rst
.. include:: ../../component-1/README.rst
.. include:: ../../component-2/README.rst
The components (only the ones we want to document)
component-1
===========
.. automodule:: components.component-1.orc_component_1.app
:members:
.. automodule:: components.component-1.orc_component_1.services
:members:
.. automodule:: components.component-1.orc_component_1.utils
:members:
component-2
===========
.. and so on
Thanks!
Best wishes, Birgitte