1

I have just created my documentation using Sphinx and this is my problem: Initially in the Toc tree directive is empty and then I add "tutorial" below and it looks like this:

.. toctree::
   :maxdepth: 2
    tutorial

and when I "make html", I do not get "tutorial" on the index page. Then I created a tutorial.rst in the same dircetory as index.rst. I do "make html"again and I get this error message:

toctree contains reference to nonexisting document

How do I fix this ?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Simon
  • 29
  • 3

2 Answers2

5

Maybe try this :

.. toctree::
   :maxdepth: 2

   tutorial <tutorial>

..

Assuming your tutorial.rst file is in the "source" directory at the same level of your index.rst file

NOTE: newline is important between toctree options and page list.

tshepang
  • 12,111
  • 21
  • 91
  • 136
lpa
  • 191
  • 3
  • This works. Is the official documentation (http://www.sphinx-doc.org/en/stable/markup/toctree.html#toctree-directive) wrong? – xtian Feb 11 '18 at 11:55
-2

You have to have an empty line between the maxdepth definition and the filename.