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.0.tar.gz (4.7 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.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx_variations-1.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinx_variations-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bcba84be0d52c77ef02c4cfc0d637c29c087ef117f09dc11a1740d69913b87bd
MD5 80f3d88506931c10a35c96e1dee77dda
BLAKE2b-256 eaac6cd113802bce5b0e5540d3fafc99034cdd9f4103e276e3e39cfc5f801c8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinx_variations-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b97bd37b7e9fa41181688596ed9ecd8092aa2ca6961add8806dce39cd5781016
MD5 9efa02fb2915700e6301492b743c43e4
BLAKE2b-256 93b1fd9695057e3981d605e69d055e6b898eea9be343ffccc481110f5274f45b

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