Sphinx Autodoc和NumpyDoc
尽管阅读了大量的文档,但我无法让sphinx autodoc很好地使用numpy DocString 在mySphinx Autodoc和NumpyDoc,numpy,python-sphinx,autodoc,numpydoc,Numpy,Python Sphinx,Autodoc,Numpydoc,尽管阅读了大量的文档,但我无法让sphinx autodoc很好地使用numpy DocString 在myconf.py中,我有: extensions = ['sphinx.ext.autodoc', 'numpydoc'] 在我的文档文件中,我有: .. automodule:: python_file .. autoclass:: PythonClass :members: 其中python_file.py具有: class PythonClass(object):
conf.py
中,我有:
extensions = ['sphinx.ext.autodoc', 'numpydoc']
在我的文档文件中,我有:
.. automodule:: python_file
.. autoclass:: PythonClass
:members:
其中python_file.py
具有:
class PythonClass(object):
def do_stuff(x):
"""
This does good stuff.
Here are the details about the good stuff it does.
Parameters
----------
x : int
An integer which has amazing things done to it
Returns
-------
y : int
Some other thing
"""
return x + 1
当我运行makehtml
时,我得到错误:未知指令类型“autosummary”
。当我将autosummary
添加到我的扩展中时,因此:
extensions = ['sphinx.ext.autodoc', 'numpydoc', 'sphinx.ext.autosummary']
我得到:
WARNING: toctree references unknown document u'docs/python_file.PythonClass.do_stuff'
根据的建议,我将numpydoc\u show\u class\u members=False
添加到我的conf.py
现在我可以运行makehtml
而不会出错,但是参数
和返回
部分不会被解释为numpydoc部分
有办法摆脱这种混乱吗?尝试删除以前的整个html
输出。然后重新生成文档。这对我不起作用。删除并重新运行后存在相同问题。还有其他想法吗?