35

Like the documentation of python or django, how do I have multiple versions of my doc with sphinx ?

I saved my doc on git, and I want my user to be able to see documentation for different version like v2.7,v3.4, etc

Thank you for the help

barryhunter
  • 20,886
  • 3
  • 30
  • 43
Guillaume Vincent
  • 13,355
  • 13
  • 76
  • 103

2 Answers2

31

You could just use Read The Docs to host your documentation for you. They automatically handle multiple versions with a dropdown: https://docs.readthedocs.io/en/latest/index.html

If you'd like to host your own documentation on GitHub Pages or some other web server, I made a Sphinx extension that does what you're looking for: https://github.com/sphinx-contrib/sphinxcontrib-versioning

Jose Luis Blanco
  • 705
  • 6
  • 10
Robpol86
  • 1,594
  • 21
  • 18
  • ReadTheDocs only seems to offer users two versions: `stable` and `latest` (which is a pointer to the most recently tagged version). This doesn't really address the OPs requirement, which is to make an arbitrary number of versions available. – Nexus Jan 13 '20 at 23:07
  • 3
    i believe readthedocs lets you add your own versions in their UI – MoralCode Sep 03 '21 at 01:02
16

There's the sphinx-multiversion extension.

It's similar to sphinxcontrib-versioning, but sphinxcontrib-versioning doesn't seem to be actively maintained. The last release was in 2016, and it doesn't work with more recent versions of Sphinx (issue #77). sphinx-multiversion is a new implementation (see comment by the author).

Note on healthiness of the project: as of December 2020, it seems that SMV is a one-person project and there are a number of open issues and pull requests that haven't been responded to (though see this comment by the author).

jli
  • 333
  • 3
  • 8
  • How do I actually test this extension locally. I have installed the multiversion extension, I wanted to know how I can see the different version of the document in the HTML. – Sushivam Aug 09 '22 at 05:24