【发布时间】:2017-09-19 15:28:55
【问题描述】:
我想知道如何实现以下目标。我将 numpy docstring 样式与 sphinx autodoc 结合使用来生成自动文档。但是,我很难在输出中有一个嵌套列表:
Attributes
----------
attribute 1: pandas data frame
* `index:` Array-like, integer valued representing
days. Has to be sorted and increasing.
* `dtype:` float64. Value of temperature.
* `columns:` location description, e.g. 'San Diego'
attribute 2: `int`
nice and sunny days in California
此文档字符串的输出已完成。它无法识别属性 1 的列表。
另一方面,功能描述跨越多行:
def generate_temp(self, n, freq, very_long_variable_name,
type_temp=None, method=None):
这里的 sphinx 也不能识别完整的函数,并独立于第一行处理第二行。
我的格式有什么问题?
【问题讨论】:
-
你在使用
sphinx.ext.napoleon(sphinx-doc.org/en/stable/ext/napoleon.html)吗? -
@mzjn 是的,没错,我正在使用拿破仑。
标签: python python-sphinx autodoc sphinx-napoleon