1

There is no problem on de index.rst it seems as below:

Sphinx RTD doc home page

However, when I go to another page, in my case it is annotation-module.rst, the sidebar selects and shows both index and annotation-module, as seen below:

Sphinx RTD sidebar shows both menus

However, I want to have only Annotation Module page to be activated and show its subsections.

My conf.py only uses html_theme by looking for the READTHEDOCS environment variable as below:

if not on_rtd:  # only import and set the theme if we're building docs locally
    try:
        import sphinx_rtd_theme

        html_theme = "sphinx_rtd_theme"
        html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
    except Exception:
        pass

My index.rst:

Welcome to exceptive's documentation!
=====================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   index
   annotation-module

Here I have some introductory text.

And annotation-module.rst doesn't even include any toctree,I only have sections under it.

So, how do I only activate current documents sections on sidebar?

Here is the source directory of docs as requested by Steve Piercy.


Environment

  • Python 3.5
  • Sphinx 1.7.6
  • sphinx-rtd-theme 0.4.0
bad_coder
  • 11,289
  • 20
  • 44
  • 72
Eray Erdin
  • 2,633
  • 1
  • 32
  • 66
  • Please post a [MCVE](https://stackoverflow.com/help/mcve), ideally a repo, but at least the directory tree of your docs and complete contents of `conf.py`, `index.rst`, and `annotation-module.rst`. – Steve Piercy Jul 22 '18 at 09:14
  • Added the directory of related branch as requested. – Eray Erdin Jul 22 '18 at 09:29

2 Answers2

0

So, I kinda solved the problem. The problem was with sphinx-autobuild somehow, which I didn't mention in the question.

I simply use make html every time I update my documentations and serve it with node's http-server.

Also referencing index in index.rst creates a warning:

WARNING: self referenced toctree found. Ignored.

So, removing index from toctree solved my problem for now.

Eray Erdin
  • 2,633
  • 1
  • 32
  • 66
0

I tried replacing index with self.

Example (index.rst):

Welcome to exceptive's documentation!
=====================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   self
   annotation-module

Here I have some introductory text.