【发布时间】:2016-12-17 12:40:48
【问题描述】:
我一直在为 PyQt5 开发一个项目(在此处找到:https://github.com/MaVCArt/StyledPyQt5),它使用包结构使导入更符合逻辑。到目前为止,我在使用 Sphinx 记录代码方面相对成功,至少在我介绍包结构之前是这样。 (以前,所有东西都在一个文件夹中)
以下是问题:当我运行 sphinx-apidoc 时,一切运行正常,没有错误。更重要的是,autodoc 可以很好地提取我所有的子模块。这是我的一个 .rst 文件的内容:
styledpyqt package
==================
Subpackages
-----------
.. toctree::
:maxdepth: 8
styledpyqt.core
Submodules
----------
styledpyqt.StyleOptions module
------------------------------
.. automodule:: styledpyqt.StyleOptions
:members:
:undoc-members:
:show-inheritance:
styledpyqt.StyleSheet module
----------------------------
.. automodule:: styledpyqt.StyleSheet
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: styledpyqt
:members:
:undoc-members:
:show-inheritance:
如您所知,所有子模块都被拾取。
但是,当我对此运行 make html 时,这些模块都没有被记录(意味着标题在那里,但没有显示任何方法、类或成员)。在生成的 HTML 中,它们只是标题,下面没有任何内容。我知道它们在代码 cmets 中已正确设置,因为从现在到设置包结构(也就是文档确实起作用时),代码没有改变。
有人知道这可能是什么原因吗?
注意:为了帮助解决这个问题,以下是我的文件夹结构的简短细分:
styledpyqt
+ core
+ + base
+ + + __init__.py ( containing a class definition )
+ + + AnimationGroups.py
+ + + Animations.py
+ + __init__.py
+ + Color.py
+ + Float.py
+ + Gradient.py
+ + Int.py
+ + String.py
+ __init__.py
+ StyleOptions.py
+ StyleSheet.py
【问题讨论】:
标签: python git pyqt5 python-sphinx autodoc