Sphinx Multiversion

0.2.4 · active · verified Thu Apr 16

sphinx-multiversion is a Sphinx extension that enables the creation of multiple versions of your project's documentation. It supports building documentation from different branches or tags in a Git repository, allowing users to easily switch between versions. The current version is 0.2.4. Releases are infrequent but stable, often coinciding with new Sphinx releases or major feature additions.

Common errors

Warnings

Install

Imports

Quickstart

To set up `sphinx-multiversion`, first add it to your `extensions` list in `conf.py`. Then, configure `smv_tag_whitelist` and `smv_branch_whitelist` with regular expressions to specify which Git tags and branches should have their documentation built. Finally, run the `sphinx-multiversion` command with your source and output directories.

# conf.py
import os

project = 'My Multi-version Project'
copyright = '2024, Your Name'
version = '0.1'
release = '0.1.0'

extensions = [
    'sphinx_multiversion',
    'sphinx.ext.autodoc',
]

# Multiversion configuration (adjust regex as needed)
# Builds documentation for tags matching vX.Y.Z
smv_tag_whitelist = r'^v\d+\.\d+\.\d+$'
# Builds documentation for 'main' and 'develop' branches
smv_branch_whitelist = r'^(main|develop)$'
# Default remote to fetch from
smv_remote_whitelist = 'origin'

# To build:
# Run this command from your documentation root (where conf.py is located):
# sphinx-multiversion . _build/html

view raw JSON →