我正在尝试用 Python 记录一个包。目前我有以下目录结构:
.
└── project
├── _build
│ ├── doctrees
│ └── html
│ ├── _sources
│ └── _static
├── conf.py
├── index.rst
├── __init__.py
├── make.bat
├── Makefile
├── mod1
│ ├── foo.py
│ └── __init__.py
├── mod2
│ ├── bar.py
│ └── __init__.py
├── _static
└── _templates
这棵树是发射的结果sphinx-quickstart
。在conf.py
我未注释的情况下sys.path.insert(0, os.path.abspath('.'))
,我有extensions = ['sphinx.ext.autodoc']
.
我index.rst
的是:
.. FooBar documentation master file, created by
sphinx-quickstart on Thu Aug 28 14:22:57 2014.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to FooBar's documentation!
==================================
Contents:
.. toctree::
:maxdepth: 2
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
在所有的文件中__init__.py
,我都有一个文档字符串,模块foo.py
和bar.py
. 但是,在make html
项目中运行时,我看不到任何文档。