In conf.py add relative system paths 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 first files in the same directory. Therefore, in my index.rst in my local Sphinx folder:
Contents: .. toctree:: :maxdepth: 4 Package1 <package1.rst> Package2 <package2.rst> Package3 <package3.rst>
Then in package 1.rst you should be able to just refer to relative packages as usual.
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:
A Kingscote Aug 30 '17 at 6:10 2017-08-30 06:10
source share