如何使用 sphinx 拥有多个版本的文档?

How do I have multiple versions of my doc with sphinx?

就像 python 或 django 的文档一样,我如何使用 sphinx 拥有多个版本的文档?

我在 git 上保存了我的文档,我希望我的用户能够看到不同版本的文档,例如 v2.7v3.4、等等

感谢您的帮助

您可以只使用 Read The Docs 来托管您的文档。他们通过下拉菜单自动处理多个版本: https://docs.readthedocs.io/en/latest/index.html

如果您想在 GitHub 页面或其他一些网络服务器上托管您自己的文档,我制作了一个 Sphinx 扩展来满足您的需求: https://github.com/sphinx-contrib/sphinxcontrib-versioning

sphinx-multiversion 扩展名。

它类似于 sphinxcontrib-versioning,但 sphinxcontrib-versioning 似乎没有得到积极维护。上一次发布是在 2016 年,它不适用于较新版本的 Sphinx (issue #77). sphinx-multiversion is a new implementation (see comment by the author)。

关于项目健康状况的说明:截至 2020 年 12 月,SMV 似乎是一个单人项目,并且有许多未解决的问题和拉取请求尚未得到回应(尽管参见 this comment by the author).