我在我的plone项目中使用sphinx文档。我的源代码位于具有以下树结构的文件夹中
src
└── sps.conn
├── CHANGES.txt
├── CONTRIBUTORS.txt
├── docs
│ ├── LICENSE.GPL
│ └── LICENSE.txt
├── __init__.py
├── README.txt
├── setup.py
└── src
├── __init__.py
├── sps
│ ├── conn
│ │ ├── big.py
│ │ ├── big.py~
│ │ ├── connection.py~
│ │ ├── connection.pyc
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── obsolete
│ │ │ └── Startup.tar.gz
│ │ ├── resource.py
│ │ ├── resource.py~
│ │ ├── resource.pyc
│ │ ├── routes.py
│ │ ├── routes.py~
│ │ ├── routes.pyc
│ │ └── tests
│ │ ├── helllo.py
│ │ ├── hello.py~
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── test_connection.cfg
│ │ ├── test_Connection.py
│ │ ├── testconnection.py~
│ │ ├── testConnection.pyc
│ │ ├── testDynamicResources.py
│ │ └── testDynamicResources.pyc
│ ├── __init__.py
│ └── __init__.pyc
从Project文件夹中我执行了命令
myhome@myhome:~/zope/sps$ sphinx-apidoc -F -o docs /home/myhome/zope/sps/src/sps.conn/src/sps/
然后我像这样更改conf.py文件中的sys.path
sys.path.insert(0, os.path.abspath('/home/myhome/zope/sps/src/sps.conn/src/sps/conn'))
我查看了connection.rst文件,它看起来像这样
conn package
==============
Subpackages
-----------
.. toctree::
conn.tests
Submodules
----------
conn.big module
--------------------
.. automodule:: conn.big
:members:
:undoc-members:
:show-inheritance:
conn.connection module
--------------------
.. automodule:: conn.connection
:members:
:undoc-members:
:show-inheritance:
conn.resource module
----------------------
.. automodule:: conn.resource
:members:
:undoc-members:
:show-inheritance:
conn.routes module
--------------------
.. automodule:: conn.routes
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: connection
:members:
:undoc-members:
:show-inheritance:
然后从我执行的docs制作html。它不会从python文件中读取doc字符串。但它的工作原理如果我更改.rst文件就像这样意味着
conn package
==============
Subpackages
-----------
.. toctree::
conn.tests
Submodules
----------
big module
-----------
.. automodule:: big
:members:
:undoc-members:
:show-inheritance:
connection module
-----------------
.. automodule:: connection
:members:
:undoc-members:
:show-inheritance:
resource module
----------------
.. automodule:: resource
:members:
:undoc-members:
:show-inheritance:
routes module
--------------
.. automodule:: routes
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: connection
:members:
:undoc-members:
:show-inheritance:
有人可以告诉我做错了什么吗?提前谢谢。