Python:Sphinx:如何在sphinx文档中自动包含所有类,方法和函数?

时间:2013-01-02 10:17:04

标签: python python-sphinx

  

可能重复:
  Sphinx — combining automodule and autoclass

我尝试使用sphinx及其autodoc插件为包含数千个类的项目创建html文档。 sphinx-apidoc 创建了精彩的rst文件,但缺少自动创建 autoclasses automethods

sphinx中有一个方法/命令/实用程序可以自动包含文档中的所有变量,函数,类和装饰器吗?

一个rst文件的示例代码:

tagger Package
=================

:mod:`tagger` Package
------------------------
.. automodule:: project.tagger
    :members:


:mod:`client` Module
--------------------
.. automodule:: project.analyzers.tagger.client
    :members:

1 个答案:

答案 0 :(得分:1)

有sphinx扩展可以帮助你。

扩展名为autodoc

如果你想要包括该课程,那么你必须写

.. autoclass:: <ClassName>

Slly for method。