'Unexpected Section Title' with Sphinx — is numpy the issue?

坚强是说给别人听的谎言 提交于 2019-12-07 10:15:35

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/3101281/unexpected-section-title-with-sphinx-is-numpy-the-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!