内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用
当使用sphinx的automodule(http://sphinx.pocoo.org/ext/autodoc.html#directive-automodule)时,
我在一个.rst文件中:
.. automodule:: my_module
:members:
它很好地记录了my_module,但没有找到像my_module.inner_module0和my_module.inner_module1这样的内部模块。除了__all__变量之外,还有什么需要在__init__.py文件中指定?
你必须指定automodule
每个模块的命令:.. automodule:: sound.formats.waveread
, .. automodule:: sound.formats.wavewrite
,等。
sound/ Top-level package
__init__.py Initialize the sound package
formats/ Subpackage for file format conversions
__init__.py
wavread.py
wavwrite.py
aiffread.py
aiffwrite.py
auread.py
auwrite.py
...
effects/ Subpackage for sound effects
__init__.py
echo.py
surround.py
reverse.py
...