1、安装:
http://gisellezeno.com/tutorials/sphinx-for-python-documentation.html
pip install sphinx
2、使用命令:sphinx-quickstart
试参考示例:
https://pythonhosted.org/an_example_pypi_project/sphinx.html
3、docs/source/conf.py文件中将下面一句注释消去写上相对目录:
sys.path.insert(0, os.path.abspath('../..'))
4、生成.rst文件:
sphinx-apidoc-f-o source/ ../mypackage/
将生成的.rst 文件添加到index.rst中:
生成html文件:
make html
python代码格式参考:
https://pythonhosted.org/an_example_pypi_project/sphinx.html#full-code-example