Skip to main content

Create multiple variations of your Sphinx HTML documentation.

Project description

sphinx-variations

A Sphinx extension that allows project maintainers to create multiple variations of their documentation, based on its usage of the .. only directive. Each variation contains a Sphinx tag and a friendly name.

How to Use

Installing

sphinx-variations is available on PyPi:

python3 -m pip install sphinx-variations

After installing the package, list the extension in your Sphinx project's conf.py.

extensions = [..., 'variations']

Configuration

To create multiple variations for your docs, a list of tags to use as variations can be inserted into your conf.py file:

variations = [( [tagname], [friendly name] )]

For example:

variations = [('python', 'Python'),
              ('cpp', 'C++')]

The above will cause two copies of the documentation text to be made, each in a directory with the tag name. Static files are not copied between the two variations, but are shared between them.

Template Variables

This extension also provides two template variables, variations and currentvariation.

variations contains the complete list of variations in the same format specified above, and currentvariation contains the tuple for the current variation.

These variables can be used to create links between the different variations of your documentation, for example.

License

MIT, see LICENSE.

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

sphinx_variations-1.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

sphinx_variations-1.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_variations-1.1.1.tar.gz.

File metadata

  • Download URL: sphinx_variations-1.1.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for sphinx_variations-1.1.1.tar.gz
Algorithm Hash digest
SHA256 21d5929cb3bfc89555df81c65d782b88fd87b7ce02858d280b3bdf8ee5877653
MD5 9a1aa5711a60141c3bf86d2a1f41bb10
BLAKE2b-256 8bf3b4689cc6e133c6d3527a3e555374e7a294b44331144b8b72d12ad533f6f2

See more details on using hashes here.

File details

Details for the file sphinx_variations-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_variations-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26b9a7604d70c5adb70e5e1670d303a128cd83c239bb5bc37b79168911212abf
MD5 621bfebfe71335381451206a0106f0b1
BLAKE2b-256 fd035c39361257e49da9adcb84839c77b1ef2c37d73f1a8a9f02a0db3c1075d6

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