“意外的章节标题” Sphinx——numpy 是问题吗?

发布于 2024-09-06 21:06:55 字数 683 浏览 9 评论 0原文

在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云仙小弟 2024-09-13 21:06:55

该主题在此线程中讨论:
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.txt

Moved information about NumpyDoc: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文