我正在尝试使用sphinx
(与autodoc
和numpydoc
结合使用)来记录我的模块,但是在完成基本设置后,运行make html
只会生成基本的html,而所包含的文档字符串都不包含任何内容。我正在运行Python 3.3,项目结构的概述如下:
Kineticlib
|--docs
| |--build
| |--source
| | |--conf.py
|--src
| |--kineticmulti
| | |--__init__.py
| | |--file1.py
| | |--file2.py
|--setup.py
[__init__.py
为空,并且在conf.py
目录的docs/source
中添加了sys.path.insert(0, os.path.abspath('../..'))
在make html
目录中运行docs
给出以下输出:
sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.2.2
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
Build finished. The HTML pages are in build/html.
所以,我在做什么错?
您是否在docs / source目录中运行了sphinx-apidoc?这将生成用于制作html的.rst文件。从man sphinx-apidoc
,
sphinx-apidoc [options] -o <outputdir> <sourcedir> [pathnames ...]
[您需要(至少)包括outputdir
(。rst文件将进入的位置,。/应该可以工作)和sourcedir
,它应指向您的软件包(看起来像../.。 / src / kineticmulti应该可以))>
正如所说的,您应该做: