我用python和plone开发项目。现在我想记录我的python文件。我的项目树结构如下所示。
user @ myuser:〜/ zope / sps $ tree src
├── spsConnect.storage
│ ├── CHANGES.txt
│ ── CONTRIBUTORS.txt
│ ├── docs
│ │ ├── LICENSE.GPL
│ │ └── LICENSE.txt
│ ├── README.txt
│ ├── setup.py
│ └── src
│ ├── spsConnect
│ │ ├── __init__.py
│ │ └── storage
│ │ ├── createCsv.py
│ │ ├── handler.py
│ │ ├── __init__.py
│ │ ├── storagecsv.py
│ │ ├── storagegae.py
│ │ ├── storage.py
│ │ ├── storagetext.py
│ │ └── tests
│ │ ├── data.csv
│ │ ├── __init__.py
│ │ ├── testStorageCSV.py
│ │ ├── testStorageGAE.py
│ │ └── testStorage.py
│ └── spsConnect.storage.egg-info
│ ├── dependency_links.txt
│ ├── entry_points.txt
│ ├── namespace_packages.txt
│ ├── not-zip-safe
│ ├── PKG-INFO
│ ├── requires.txt
│ ├── SOURCES.txt
│ └── top_level.txt
└── spsConnect.transmitter
├── CHANGES.txt
├── CONTRIBUTORS.txt
├── docs
│ ├── LICENSE.GPL
│ └── LICENSE.txt
├── README.txt
├── setup.py
└── src
├── spsConnect
│ ├── __init__.py
│ └── transmitter
│ ├── dummytransmitter.py
│ ├── filetransmitter.py
│ ├── handler.py
│ ├── htmltransmitter.py
│ ├── __init__.py
│ ├── tests
│ │ ├── __init__.py
│ │ ├── testHTMLTransmitter.py
│ │ └── testTransmitter.py
│ └── transmitter.py
└── spsConnect.transmitter.egg-info
├── dependency_links.txt
├── entry_points.txt
├── namespace_packages.txt
├── not-zip-safe
├── PKG-INFO
├── requires.txt
├── SOURCES.txt
└── top_level.txt
我想为zope / sps / src / docs中的spsConnect.storage,spsConnect.transmitter文件夹创建文档 - > docs是包含项目文档的文件夹。
我使用sphinx混淆了文档。我确实喜欢这个
user@myuser:/zope/sps/src: sphinx-apidoc -F -o /home/user/myuser/zope/sps/src/docs
spsConnect.storage/src/spsConnect
Creating file /home/user/myuser/zope/sps/src/docsdocs/spsConnect.rst.
Creating file /home/user/myuser/zope/sps/src/docs/spsConnect.storage.rst.
Creating file /home/user/myuser/zope/sps/src/docs/spsConnect.storage.tests.rst.
Creating file /home/user/myuser/zope/sps/src/docs/conf.py.
Creating file /home/user/myuser/zope/sps/src/docs/index.rst.
Creating file /home/user/myuser/zope/sps/src/docs/Makefile.
Creating file /home/user/myuser/zope/sps/src/docs/make.bat.
然后我改变了confg.py的路径
user@myuser:/zope/sps/src/docs:make html
当我运行索引文件时,我得到了这些
内容:
spsConnect package
Subpackages
spsConnect.storage package
Subpackages
Submodules
spsConnect.storage.createCsv module
spsConnect.storage.handler module
spsConnect.storage.storage module
spsConnect.storage.storagecsv module
spsConnect.storage.storagegae module
spsConnect.storage.storagetext module
Module contents
Module contents
但是我无法读取python文件中的文档字符串。我不知道什么是错的。请使用sphinx从python文件中读取docstrings,以获得正确的结构帮助。