Skip to main content

Extensions for Sphinx which allow for substitutions.

Project description

Build Status codecov Requirements Status PyPI

Sphinx Substitution Extensions

Extensions for Sphinx which allow substitutions.

Installation

$ pip install Sphinx-Substitution-Extensions

This supports Python 3.8+.

Setup

  • Add the following to conf.py:

extensions += ['sphinx-prompt', 'sphinx_substitution_extensions']
  • Set the following variable in conf.py:

substitutions = [
    ('|release|', '0.1'),
    ('|author|', 'Eleanor'),
]

This will replace |release| in the new directives with 0.1, and |author| with Eleanor.

Directives

substitution-code-block

.. substitution-code-block:: bash

   echo "|author| released version |release|"

This is an extension of Sphinx’s built-in code-block directive, and adds replacement functionality.

substitution-prompt

.. substitution-prompt:: bash

   echo "|author| released version |release|"

This is an extension of sphinx-prompt.

substitution-prompt acts similarly to sphinx-prompt, and adds replacement functionality.

Credits

sphinx-prompt authors

Thanks to @sbrunner and other contributors for sphinx-prompt. substitution-prompt is based on sphinx-prompt.

ClusterHQ Developers

This package is largely inspired by code written for Flocker by ClusterHQ. Developers of the relevant code include, at least, Jon Giddy and Tom Prince.

Contributing

See CONTRIBUTING.rst.

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

Built Distribution

File details

Details for the file Sphinx Substitution Extensions-2019.12.28.0.tar.gz.

File metadata

  • Download URL: Sphinx Substitution Extensions-2019.12.28.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for Sphinx Substitution Extensions-2019.12.28.0.tar.gz
Algorithm Hash digest
SHA256 2b866509118ee75783db4abe58c797916ddfd359e12be0ac90a95f827ee25851
MD5 4cb1b9fc21470207e413206b540dc6f1
BLAKE2b-256 a2a5182930b570f893e4e06ad491121ea78391ca1a6b7c42ca15e212c3c7aea3

See more details on using hashes here.

File details

Details for the file Sphinx_Substitution_Extensions-2019.12.28.0-py3-none-any.whl.

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2019.12.28.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89fe584a308afb6b5cb002d70c383a7245b2ac932e539f641148515be7424ba5
MD5 763a35e108b2e55b704f7bb513afc277
BLAKE2b-256 4eab9ac7ab43033c77e6455ff61562bef86fff0b47ef3f67d33f5848fed82084

See more details on using hashes here.

Supported by

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