I am using Sphinx to document a non-Python project. I want to distribute ./doc
folders in each submodule, containing submodule_name.rst
files to d
In conf.py, add the relative paths to system using sys.path and os.path
For example:
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../../Directory1'))
sys.path.insert(0, os.path.abspath('../../Directory2'))
Then use your index.rst as usual, referencing the rst files in the same directory. So in my index.rst in my local Sphinx folder:
Contents:
.. toctree::
:maxdepth: 4
Package1
Package2
Package3
Then in package1.rst, you should be able to just reference the relative packages normally.
Package1 package
=====================
Submodules
----------
Submodule1 module
----------------------------------
.. automodule:: file_within_directory_1
:members:
:undoc-members:
:show-inheritance:
Submodule1 module
----------------------------------
.. automodule:: file_within_directory_2
:members:
:undoc-members:
:show-inheritance: