我怎样才能获得autodoc'工作?

时间:2014-03-28 17:13:25

标签: python python-sphinx

当我make html我得到this little project的Sphinx文档时:

$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.1.3
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index                                                                                                                      
/home/moose/Downloads/lumix_map_tool/doc/index.rst:16: WARNING: don't know which module to import for autodocumenting u'maptool' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                                       
writing additional files... genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded, 1 warning.

我的指甲结构是

.
├── doc (automaticall generated by sphinx-quickstart)
├── LICENSE
├── maptool.log
├── maptool.py
└── README.md

我已将sys.path.insert(0, os.path.abspath('/home/moose/Downloads/lumix_map_tool/'))添加到doc/conf.py

为什么Sphinx找不到maptool.py

1 个答案:

答案 0 :(得分:2)

你有一个名为maptool的模块,但是在GitHub项目的index.rst中它说:

.. autoclass:: maptool
   :members:
   :undoc-members:

如果您将autoclass更改为automodule,则应该有效。