Sphinx 自动摘要不显示属性摘要

Sphinx autosummary not showing attributes summary

我使用 Sphinx==1.6.3 使用 sphinx-build -a docs/source docs/build 构建我的文档,并在 conf.py 中列出的扩展中包含 sphinx.ext.autosummary。我想要一个类似于pandas.DataFrame

的方法和属性的总结

我有一个使用@属性装饰器定义的数字属性:

class Model(object):
    def __init__(self):
        self._X = None

    @property
    def X(self):
        '''
        :Getter: Returns X
        '''
        return self._X

Sphinx 将构建文档,构建方法摘要,将列出其他方法的属性,但不会制作属性摘要。

我是否需要明确指示 Sphinx 将属性包含在自动摘要中?

包括使用类似于 Pandas you need to take advantage of the numpydoc 包的 @property 装饰器记录的属性,并在 conf.py

的扩展列表中包括 numpydoc