readthedocs 是由社区驱动的开源sphinx doc 托管服务,咱们能够用来方便的构建以及发布文档html
这是一个简单的demo 项目,使用了用的比较多的
sphinx_rtd_theme
主题,主要是试用python
sphinx 文档须要让readthedocs 托管,咱们须要一个帐户,注册地址
https://readthedocs.org/
,注册很简单,咱们同时须要进行邮件验证git
咱们能够使用sphinx-quickstart
帮助咱们生成简单的测试docgithub
sphinx-quickstart 命令执行以后会有提示,按照提示操做便可
简单操做参考:sphinx doc 简单试用测试
咱们能够在项目中添加配置,方便readthedocs
进行构建,好比咱们须要依赖sphinx_rtd_theme
主题的配置
参考配置:.readthedocs.yml 文件ui
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: source/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: requirements.txt
requirements.txt 文件内容: 这个主要是添加了 sphinx_rtd_theme
主题的pip 依赖spa
sphinx_rtd_theme
readthedocs 基于git 进行项目管理,咱们须要将代码给提交github ,或者相似的git 服务中3d
https://dalongrong.readthedocs.io/en/latest/
提供的文档下载服务:code
使用readthedocs 进行sphinx doc 的构建版本管理,是一个很不错的方案,方便、灵活orm
https://github.com/rongfengliang/sphinxdemo-docs
https://docs.readthedocs.io/en/stable/config-file/v2.html