Cannot force sphinx to link toctree to another document

I am trying to learn the sphinx and stick to only basic examples. I get the following error in make html in the source directory.

 Running Sphinx v1.1.3 loading pickled environment... not yet created building [html]: targets for 2 source files that are out of date updating environment: 2 added, 0 changed, 0 removed reading sources... [100%] intro /home/owner/Desktop/doc/index.rst:11: ERROR: Error in "toctree" directive: invalid option block. .. toctree:: :maxdepth: 2 intro.rst looking for now-outdated files... none found pickling environment... done checking consistency... /home/owner/Desktop/doc/intro.rst:: WARNING: document isn't included in any toctree done preparing documents... done writing output... [100%] intro writing additional files... genindex search copying static files... done dumping search index... done dumping object inventory... done build succeeded, 2 warnings. Build finished. The HTML pages are in _build/html. 

I also tried to reference intro instead of intro.rst , it does not seem to work. index.rst and intro.rst are in the same directory. I made a project with sphinx-quickstart and all the default options.

+4
source share
1 answer

You need an empty line between the parameters of the directive and its contents. You also do not need a file extension. Change it like this:

 .. toctree:: :maxdepth: 2 intro 
+7
source

Source: https://habr.com/ru/post/1434218/


All Articles