【发布时间】:2013-06-09 07:57:56
【问题描述】:
就狮身人面像而言,我是新手。我的项目结构如下:
- argparse_actions/
- argparse_actions/
- __init__.py
- folder_actions.py
- ip_actions.py
- 文档/
- _build/
- index.rst ==> 这是起点、主页或根文档。
- 还有更多...
- argparse_actions/
__init__.py 看起来像这样:
from folder_actions import *
from ip_actions import *
folder_actions.py 看起来像这样:
'''
Folder Actions
==============
This module implements some reusable custom actions.
.. autoclass:: FolderExistsAction
.. autoclass:: FolderCreateAction
:members:
'''
# The rest of the code
生成的 HTML 文档看起来不错,除了这部分:
class folder_actions.FolderCreateAction( ... )
我知道folder_actions 模块前缀是正确的,但我想将其更改为使用包名,如下所示:
class argparse_actions.FolderCreateAction( ... )
我有办法做到这一点吗?
更新
- 根文档在
doc/index.rst -
如果我将文档字符串从
folder_actions.py移动到__init__.py,那么文档将如下所示:class __init__.FolderCreateAction( ... ) 仅供参考,我的项目现在在BitBucket
更新 2
我不知道为什么我的更改没有推送到 BitBucket,但这无关紧要。请看一下同一个项目,推送到GitHub。感谢您的帮助,mzjn。
【问题讨论】:
标签: python python-sphinx