Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

autosummary “toctree contains reference to nonexisting document” warnings

I am facing the same problem as in this thread. When I build my Sphinx documentation with make html then I get a lot of warnings like this

None:None: WARNING: toctree contains reference to nonexisting document u'cars.Car.time_elapsed'

I am using html_theme = 'sphinx_rtd_theme'. If I change it to classic, then I don't get the warnings. If I add numpydoc_show_class_members = False to conf.py, then I don't get them either.

BUT; I really like sphinx_rtd_theme and when I use classic or add numpydoc_show_class_members = False, then a 'TOC' of my Python methods are removed, which I prefer staying (see the red box in the image) .

image

The documentation of the cars module is made by

.. automodule:: cars
   :members:

The module contains a single class Car with two methods. The docstrings are written in numpydoc.

like image 391
mr.bjerre Avatar asked Nov 08 '22 09:11

mr.bjerre


1 Answers

It seems to me that you are currently using the numpydoc extension. Please note that Numpy and Google style docstrings are now supported by the builtin sphinx.ext.napoleon extension.

Removing the numpydoc extension and using sphinx.ext.napoleon will likely solve your problem.


Sources

  • Napoleon - Marching toward legible docstrings
  • Sphinx Doc - Support for NumPy and Google style docstrings
like image 200
Kurt Bourbaki Avatar answered Nov 14 '22 21:11

Kurt Bourbaki