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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sphinx_variations-1.0.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx_variations-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for sphinx_variations-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 44e05a6b5c01239d7937f0e626f24702b5d33bdcc9d7dfadd20469999dee531c
MD5 a72127c54c2d8d8aced4c61792d420da
BLAKE2b-256 0959ef24b6ee4ba7f5061e28ade14986b1b218006f9bdc91d4c316550f6d6457

See more details on using hashes here.

Supported by

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