使用readthedocs 发布 sphinx doc文档
readthedocs 是由社区驱动的开源sphinx doc 托管服务,我们可以用来方便的构建以及发布文档
这是一个简单的demo 项目,使用了用的比较多的
sphinx_rtd_theme
主题,主要是试用
注册账户
sphinx 文档需要让readthedocs 托管,我们需要一个账户,注册地址
https://readthedocs.org/
,注册很简单,我们同时需要进行邮件验证
简单demo 项目
我们可以使用sphinx-quickstart
帮助我们生成简单的测试doc
sphinx-quickstart 命令执行之后会有提示,按照提示操作即可
简单操作参考:sphinx doc 简单试用
配置readthedocs
我们可以在项目中添加配置,方便readthedocs
进行构建,比如我们需要依赖sphinx_rtd_theme
主题的配置
参考配置:.readthedocs.yml 文件
# .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 依赖
sphinx_rtd_theme
使用readthedocs 托管sphinx doc
readthedocs 基于git 进行项目管理,我们需要将代码给提交github ,或者类似的git 服务中
- 选择手工导入项目
- 配置
- 进行文档构建
- 构建效果
- 访问内容
我自己的地址:https://dalongrong.readthedocs.io/en/latest/
内容:
提供的文档下载服务:
说明
使用readthedocs 进行sphinx doc 的构建版本管理,是一个很不错的方案,方便、灵活
参考资料
https://github.com/rongfengliang/sphinxdemo-docs
https://docs.readthedocs.io/en/stable/config-file/v2.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2018-06-12 nats 学习 集群ha 配置
2017-06-12 Apache Tez 了解
2016-06-12 pouchdb Conflicts
2016-06-12 pouchdb sync
2016-06-12 linux node&& npm 安装方式
2016-06-12 swagger-editor 快速REST-API 测试文档编写