Sphinx 意外的部分标题 - numpydoc

Rom*_*rde 5 python numpy python-sphinx numpydoc

我无法使 Sphinx 使用 numpy 格式正常工作。我正在使用此示例进行测试,执行“make html”,但我收到一些警告以识别参数、注释、返回等。例如:

SEVERE: Unexpected section title.
ERROR: Unexpected indentation.
also
WARNING: Inline emphasis start-string without end-string.
WARNING: Literal block expected; none found
Run Code Online (Sandbox Code Playgroud)

这个问题已经被问过,但经过几个小时的搜索和尝试后我没有成功。

到目前为止我所做的:

  • 安装Sphinx v1.3.5
  • 更新numpydoc至0.5版本
  • 将扩展名numpydocsphinxcontrib.napoleon和添加sphinx.ext.napoleon到文件中conf.py
  • 尝试过 rst2html docum.txt docum.html
  • 因为我认为它没有使用 numydoc,所以我写了一个不正确的名称作为扩展名,并且它给出了一个错误(应该是这样,所以我认为它正在识别 numpydoc)。
  • 添加numpydoc_show_class_members = Falseconf.py
  • 删除之前的整个 html 输出

有什么问题的建议或提示吗?我可以尝试什么?

谢谢

Rom*_*rde 3

问题是我使用 numpydoc 直接使用 来记录模块.. toctree:: filename,但它必须与 一起使用.. automodule:: filename。有关如何使用它的更多信息,请访问:http://www.sphinx-doc.org/en/stable/tutorial.html#setting-up-the-documentation-sources。感谢您的帮助。