“意外的章节标题” Sphinx——numpy 是问题吗?
在我的 doc/ 目录中运行时
sphinx-build . html/
,我得到以下输出:
$ sphinx-build . html/
Running Sphinx v0.6.4
No builder selected, using default: html
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index
reST markup error:
HIDDEN/PATH/matplotlib_visualization.py:docstring of simulator.extensions.matplotlib_visualization.beta:20: (SEVERE/4) Unexpected section title.
此文件具有 numpy 导入,经过一番研究,sphinx 使用的 RST 标记似乎具有numpy 的记录方式存在问题。当我取出 numpy 导入时,html 构建得很好。
解决这个问题的最佳方法是什么?
When running
sphinx-build . html/
in my doc/
directory, I get the following output:
$ sphinx-build . html/
Running Sphinx v0.6.4
No builder selected, using default: html
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index
reST markup error:
HIDDEN/PATH/matplotlib_visualization.py:docstring of simulator.extensions.matplotlib_visualization.beta:20: (SEVERE/4) Unexpected section title.
This file has numpy
imports, and after a little research, it seems like the RST markup that sphinx uses has a problem with the way numpy
is documented. When I take out the numpy import, the html builds fine.
What would be the best way to resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该主题在此线程中讨论:
https://groups.google.com/d/msg/sphinx-用户/MAFTlX8pAvk/B9hx7MuBVbIJ
皮埃尔 GM 说:
“弗雷德里克,
看起来您正在使用 numpy 标准作为您的文档。考虑
然后使用 Pauli Virtanen 实现的 numpydoc 扩展:
此处提供:
http://sphinx.googlecode.com/svn/contrib/trunk /"有关 numpydoc 的当前信息:
https://github.com/numpy/numpy /blob/master/doc/HOWTO_DOCUMENT.rst.txt移动了有关 NumpyDoc 的信息:https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
The subject is discussed in this thread:
https://groups.google.com/d/msg/sphinx-users/MAFTlX8pAvk/B9hx7MuBVbIJ
Pierre GM says:
"fredrik,
Looks like you're using thw numpy standard for your documentation. Consider
then using the numpydoc extensions that Pauli Virtanen implemented: it's
available here:
http://sphinx.googlecode.com/svn/contrib/trunk/"Current information abut numpydoc:
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txtMoved information about NumpyDoc: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard