Sphinx documentation文档
Sphinx 和 reStructuredText 简明教程
https://howtomakedocs.readthedocs.io/en/latest/Introduction/intro.html
从github download colmap之后,看见源目录有个doc的文件夹,想着能不能自己尝试着把它编译成文档,在尝试过程中了解一下这块知识。
Sphinx是什么:
Sphinx 是种令人可以轻松撰写出优美文档的工具, 由 Georg Brandl 在BSD 许可证下创造, 它允许开发人员以纯文本格式编写文档, 以便采用满足不同需求的格式轻松生成输出. 这在使用 Version Control System 追踪变更时非常有用. 纯文本文档对不同系统之间的协作者也非常有用. 纯文本是当前可以采用的最便捷的格式之一.
安装 Sphinx
Sphinx的安装很简单, 只需通过 pip 或 easy_install 安装, 且支持Windows, Linux, Mac等系统. 下面详细介绍Windows, Linux系统下Sphinx的安装.
Linux环境下通过pip命令安装
pip install Sphinx
编译colmap中的doc过程
- 切换到
colmap/doc目录下,可以通过运行make查看可以生成的文件。此处本人生成html格式
make html
运行报错:

解决办法:
安装sphinx_rtd_theme主题:
pip install sphinx-rtd-theme
然后接着使用make html就可以了。
关于主题:
可供选的内置主题有: basic, alabaster, sphinx_rtd_theme, classic, sphinxdoc, scrolls, agogo, traditional, nature, haiku, pyramid, bizstyle, epub.
具体可以看
https://howtomakedocs.readthedocs.io/en/latest/Basic/Sphinx.html
的2.2.5.1
修改主题:
修改conf.py文件, 将html_theme修改成你想用的主题名字
html_theme = 'classic'
然后重新编译make html即可.
查看html文档
colmap编译后的文档在_build,打开文件夹后找到index.html进行浏览即可。

浙公网安备 33010602011771号