使用readthedocs 发布 sphinx doc文档
2024-10-21 18:58:23
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
最新文章
- MVB帧
- 泛函编程(27)-泛函编程模式-Monad Transformer
- 带进度条的 jQuery 文件拖放上传插件
- Eclipse启动tomcat 报“ A child container failed during start”
- psp系统需求分析
- java_IO读写模版
- 关于Eclipse Modeling Framework进行建模,第二部分
- UNIX网络进程间通信漫谈(1)
- uva 1335 - Beijing Guards(二分)
- oracle_表分区
- PAT (Advanced Level) 1073. Scientific Notation (20)
- SVN参考命令
- h5页面避免两个页面反复跳转死循环
- python爬虫学习之使用BeautifulSoup库爬取开奖网站信息-模块化
- ActiveMQ消息的发送原理
- 通过JDOM实现XML与String的相互转换
- _spellmod_leech_spell
- MIT 6.824 lab1:mapreduce
- git push origin master:master
- tabindex 属性
热门文章
- 4. Spark Streaming解析
- Ideaui和WebStrom2019最新版自动生成破解码
- Ambari调整日志级别:How to enable debug logging in Ambari Server and Ambari Agent ?
- Sqlserver 总结(2) 存储过程
- 3. ABP .NETCore 添加企业微信第三方登录
- jdk命令行工具系列
- restframework中根据请求的类型修改序列化类
- php与mysql交互 面向过程
- Redis中如何发现并优化big key?
- 两种方式测试 GNS3 环境