我无法使 Sphinx 以 numpy 格式正常工作。 我正在用这个example进行测试,执行“make html”,但我收到一些警告以识别参数、注释、返回等。例如:
SEVERE: Unexpected section title.
ERROR: Unexpected indentation.
also
WARNING: Inline emphasis start-string without end-string.
WARNING: Literal block expected; none found
这个问题已经被问过,但我在搜索和尝试几个小时后没有成功。
到目前为止我所做的事情:
- 已安装 Sphinx v1.3.5
- 将
numpydoc
更新至版本 0.5 - 向
conf.py
添加了扩展numpydoc
、sphinxcontrib.napoleon
和sphinx.ext.napoleon
> 文件。 - 尝试过 rst2html docum.txt docum.html
- 因为我认为它没有使用 numydoc,所以我写了一个不正确的名称作为扩展名,并且它给出了一个错误(应该是这样,所以我认为它正在识别 numpydoc)。
- 将
numpydoc_show_class_members = False
添加到conf.py
- 删除之前的整个 html 输出
有什么错误的建议或提示吗?我可以尝试什么?
谢谢
最佳答案
问题是我使用 numpydoc 直接使用 .. toctree::filename
来记录模块,但它必须与 .. automodule::filename
一起使用>。有关如何使用它的更多信息,请参见此处:http://www.sphinx-doc.org/en/stable/tutorial.html#setting-up-the-documentation-sources 。感谢您的帮助。
关于python - Sphinx 意外的部分标题 - numpydoc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35365827/