0

I have a small repository of the following structure:

|- doc/
    |- conf.py
    |- index.rst
    |- ...
|- src/dashtutorial/
    |- __init__.py
    |- data/
    |   |- __init__.py
    |   |- types.py
    |- gui/
        |- __init__.py
        |- components/
        |   |- __init__.py
        |   |- ...
        |- ...
    |- ...

I'm using sphinx's sphinx-apidoc and napoleon and I can successfully build the documentation and view the html output.

However, for some reason, I see no TOC/package paths in the side bar (I'm using the rtd theme). All contents are there, I can use the index or search page to maneuver to every content of the documentation. Once I moved to a content, only the current package is displayed in the side bar.

The resulting modules.rst file only lists the root/main package dashtutorial.

src
===

.. toctree::
   :maxdepth: 4

   dashtutorial

This is the index.rst file:

.. Dash Tutorial documentation master file, created by
   sphinx-quickstart on Fri Jul  8 10:54:39 2022.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to Dash Tutorial's documentation!
=========================================

.. toctree::
   :maxdepth: 4
   :caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

I inserted all paths in the conf.py:

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../src/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/data/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/gui/'))
sys.path.insert(0, os.path.abspath('../src/dashtutorial/gui/components/'))

EDIT: After running make clean and make html, I receive ...\modules.rst: WARNING: document isn't included in any toctree

EDIT2: Is there anything essential to subpackages building the basic TOC structure, that I'm missing?

LCsa
  • 607
  • 9
  • 30
  • For any .rst file that is not referenced in a toctree, you get that warning. – mzjn Jul 08 '22 at 17:06
  • Problem is: How do I get autodoc to a) put all subpackages as such into the `modules.rst` and b) to reference `modules.rst`? – LCsa Jul 08 '22 at 19:01
  • Please add the content of `index.rst` to your question. – Steve Piercy Jul 09 '22 at 07:51
  • @StevePiercy Thank you, I added the contents of the file! – LCsa Jul 12 '22 at 10:32
  • The toctree in index.rst is empty. – mzjn Jul 12 '22 at 15:01
  • @mzjin exactly. Why does `autodoc` / `sphinx-apidoc` not populate it? – LCsa Jul 12 '22 at 21:31
  • sphinx-apidoc does not edit existing .rst files. – mzjn Jul 13 '22 at 05:34
  • Also deleting all rst files and rerunning does not change anything. Could you provide a minimal working example of a `conf.py` and `index.rst` and the sphinx commands to yield a functioning/linked documentation with respect to the repository structure above? That would be most appreciated. – LCsa Jul 13 '22 at 11:50
  • Who are you asking for an example? I think it is you who needs to provide a [mcve]. Btw, your problem seems similar to these (no answers unfortunately): https://stackoverflow.com/q/36145998/407651, https://stackoverflow.com/q/22049797/407651 – mzjn Jul 13 '22 at 11:56

0 Answers0