【问题标题】:Sphinx documentation showing double-colon in fieldsSphinx 文档在字段中显示双冒号
【发布时间】: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 字段不会发生这种情况。只需 ParametersReturnsReturn Type

【问题讨论】:

标签: python python-sphinx docstring numpydoc


【解决方案1】:

似乎是某些版本的错误。我从 Sphinx 3.5.2 移动到 4.4.0 并且双冒号消失了。

【讨论】:

  • 使用4.4.0向我显示双冒号。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-10-11
  • 1970-01-01
  • 2020-12-08
  • 2015-03-15
  • 2012-03-01
  • 2019-09-14
  • 2011-08-11
相关资源
最近更新 更多