Skip to main content

A Sphinx extension/tool to manage multi-version and multi-language documentation builds without relying on ReadTheDocs.

Project description

Easy Versioning (Sphinx documentation build tool)

This tool was created to address the need to add versioning to a Sphinx project without relying on Read the Docs (RTD).

This Python script automates the full workflow of preparing, versioning, building, and organizing documentation from Markdown files using the Sphinx tool.

Itโ€™s designed for teams and organizations who want to self-host their documentation sites and prefer full control over the hosting environment and theme customization.
Easy Versioning works as an alternative approach for managing versioned and multilingual docs, complementing existing Sphinx workflows in a simple way with only one tool.

By organizing your source files in the expected structure, this tool actively builds your documentation with Sphinx and outputs a fully ready-to-deploy static site.
With minimal setup, it streamlines the process of managing multiple versions and languages, adding consistent footers, and arranging build artifacts for deployment.


Features

Easy Versioning offers the following key features:

  • Manage multiple documentation versions
  • Support multiple languages for each version
  • Add custom footers showing version and language info
  • Security by ensuring a safe fallback to an existing page so users are always redirected properly
  • Build documentation automatically using Sphinx for every version and language
  • Organize generated HTML files into a clean, ready-to-deploy structure
  • Support for both ".md" and ".rst" files

Prerequisites

Make sure you have the following installed on your system:

  • Python version >= 3.8
  • Install the tool using pip install easy-versioning

Directory Setup

๐Ÿ“ฆ Easy_versioning_Sphinx/
โ”œโ”€โ”€ ๐Ÿ“‚ data/
โ”‚ โ””โ”€โ”€ ๐Ÿ“„ Footer.md
โ”‚ โ””โ”€โ”€ ๐Ÿ“„ Footer.rst
โ”œโ”€โ”€ ๐Ÿ“‚ src/
โ”‚ โ”œโ”€โ”€ ๐Ÿ“ V. X.XX/
โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŒ Language 1/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“˜ Language 1 Sphinx Project/
โ”‚ โ”‚ โ””โ”€โ”€ ๐ŸŒ Language 2/
โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“˜ Language 2 Sphinx Project/
โ”‚ โ”œโ”€โ”€ ๐Ÿ“ V. Y.YY/
โ”‚ โ”œโ”€โ”€ ๐Ÿ“ V. Z.ZZ/

You can find a fully working example of a Footer.html file in the Example/data folder of this project.
You can start by copying the default file in your data/ folder and then customize it as you wish by modifying the CSS.
If you want to create your own Footer.html file, please follow the placeholder tags as shown in the example in the folder.


Inside the src/ folder, place all your documentation projects you want to build organized according to the directory structure shown above.


You can find a complete example project in the Example/ folder, which you can download, build, and use as a setup for your own project!


How to use it

By downloading the Example/ folder in this repository, you can access the official Easy_versioning documentation.
It includes detailed guides in Italian, English, and German, additionally, you can test the final output, as the documentation itself was built using this tool.

You can find a simple and easy documentation below:

The tool requires the directory structure shown above.
You can use the easy-versioning-setup command to set up the folders with the correct layout for an easy-versioning project. This function takes two parameters as input: the project name and the author name, which are used to set up the Sphinx project, if no arguments are provided the default name is gonna be "Documentation" and the author "Author".
After opening a terminal in the projectโ€™s source directory (which contains the data/ and src/ folders), run the command easy-versioning-build to build your project.

This command can be run without any arguments, or with up to two arguments:

  1. Default language: The fallback language and the main language of the project (default is "English"). If no arguments are provided, make sure there is an "English" folder in every version of the documentation. Choose a language that exists in all versions of your documentation.
  2. Cleanup flag: A boolean flag (default is True) that controls whether the _source directory is removed from the final build to reduce the project size.
    • Set this flag to 0 to disable cleanup and keep the _source directory.

Examples:

  • easy-versioning-build โ€” Uses English as the default language and removes the _source directory.
  • easy-versioning-build Italiano 0 โ€” Sets Italian as the default language and keeps the _source directory intact.

Why Choose Easy Versioning Over Other Solutions?

Feature Easy Versioning Sphinx sphinx-multiversion sphinx-versioning Read The Docs
Multi-version โœ… โœ… โœ… โœ…
Multi-language โœ… โŒ โŒ โœ…
Simplified setup โœ… โš ๏ธ Complex โš ๏ธ Complex โš ๏ธ Complex
External dependencies ๐Ÿšซ Only Sphinx โœ… โœ… โŒ
No account required โœ… โœ… โœ… โŒ (Free for OSS)
Usage cost โœ… โœ… โœ… Free for OSS, paid plans for private projects
Performance consistency hardware-dependent hardware-dependent hardware-dependent Can vary, higher performance require payment

Example of the versioning footer using sphinx_book_theme


Versioning Example



This tool is not a replacement for ReadTheDocs but rather a complementary free solution for teams who prefer to host their own documentation or require a different setup.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_versioning-1.0.7.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_versioning-1.0.7-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file easy_versioning-1.0.7.tar.gz.

File metadata

  • Download URL: easy_versioning-1.0.7.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for easy_versioning-1.0.7.tar.gz
Algorithm Hash digest
SHA256 8c1516a21620d8489f13f7a4f70c5287f45b8e0632d4d2446b9358cb836e6657
MD5 a485d5f7f8db8332792fb89e40fe1f2e
BLAKE2b-256 9fec3fc1ed6346d1d2639e08481770704b88b1ffb4b7b36e75233c186826c9d0

See more details on using hashes here.

File details

Details for the file easy_versioning-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_versioning-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3372a6b4e4092c7aee92feda1c3454b85bece3360bc0687e238fd28cc4b72ed9
MD5 981b9094a98d328ec65c6aafa50129f7
BLAKE2b-256 7a8e2aaa8a9c75a2be4b01250fd7dfbcbcdb562d051a7a8176f3b61e37c3e194

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page