【问题标题】:autosummary “toctree contains reference to nonexisting document” warnings自动摘要“目录树包含对不存在文档的引用”警告
【发布时间】:2016-09-02 06:38:25
【问题描述】:

我面临与thread 相同的问题。当我使用 make html 构建我的 Sphinx 文档时,我会收到很多这样的警告

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

我正在使用html_theme = 'sphinx_rtd_theme'。如果我将其更改为classic,则不会收到警告。如果我将numpydoc_show_class_members = False 添加到conf.py,那么我也不会得到它们。

但是;我真的很喜欢 sphinx_rtd_theme,当我使用 classic 或添加 numpydoc_show_class_members = False 时,我的 Python 方法的一个“TOC”被删除,我更喜欢保留它(参见图片中的红色框) .

cars 模块的文档由

.. automodule:: cars
   :members:

该模块包含一个带有两个方法的类Car。文档字符串写在numpydoc

【问题讨论】:

    标签: python python-sphinx numpydoc


    【解决方案1】:

    在我看来,您目前正在使用numpydoc 扩展名。请注意,Numpy 和 Google 样式的文档字符串现在被内置的 sphinx.ext.napoleon 扩展支持。

    删除numpydoc 扩展并使用sphinx.ext.napoleon 可能会解决您的问题。


    来源

    【讨论】:

      猜你喜欢
      • 2012-08-25
      • 2013-02-21
      • 1970-01-01
      • 2020-10-30
      • 2021-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      相关资源
      最近更新 更多