【发布时间】:2021-12-20 18:20:02
【问题描述】:
我正在为一个包开发文档,当我构建 sphinx 文档时,我得到了双冒号
每个函数定义的所有字段。
我对我的文档字符串使用 numpydoc 样式,并且这些文档中没有冒号来指示它们可能来自哪里:
"""
Function description
Parameters
-----------
param1: str or list
A description for the parameter
Returns
-----------
Dictionary
Some info about what is returned
Examples
-----------
>>> output = somefunction(param1)
"""
以前有人遇到过这种情况吗?值得注意的是,Examples 字段不会发生这种情况。只需 Parameters、Returns 和 Return Type。
【问题讨论】:
-
我认为您需要提供minimal reproducible example。
-
这里也一样,不知道为什么会这样。
标签: python python-sphinx docstring numpydoc