python - Sphinx 意外的部分标题 - numpydoc

标签 python numpy python-sphinx numpydoc

我无法使 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 添加了扩展 numpydocsphinxcontrib.napoleonsphinx.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/

相关文章:

用于保存和恢复 UI 小部件值的 Python PyQt4 函数?

python - 使用预提交 Hook 运行 Django 测试

python - 如何将 mnist 数据转换为 RGB 格式?

python - Numpy/Pytorch 数据类型转换/兼容性

python - 在 python 中倾斜或剪切图像

python - Django 访问表单错误,不包括模板中的 non_field_errors

python - 分解()时间序列 : ValueError: You must specify a period or x must be a pandas object with a DatetimeIndex with a freq not set to None

python - Sphinx autodoc show-inheritance : How to skip undocumented, 中间基础?

python - readthedocs 和 autodoc - 我如何 "enable virtualenv"?

python - 自动 Ansible 文档如何工作?