Skip to main content

Extensions for Sphinx which allow for substitutions.

Project description

Build Status codecov 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:

# sphinx-prompt must be the first of these two.
extensions += ['sphinx-prompt', 'sphinx_substitution_extensions']
  • Set the following variable in conf.py:

rst_prolog = """
.. |release| replace:: 0.1
.. |author| replace:: Eleanor
"""

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

Directives

code-block

This adds a :substitutions: option to Sphinx’s built-in code-block directive.

.. code-block:: bash
   :substitutions:

   echo "|author| released version |release|"

prompt

This adds a :substitutions: option to sphinx-prompt.

.. prompt:: bash
   :substitutions:

   echo "|author| released version |release|"

Inline :substitution-code:

:substitution-code:`echo "|author| released version |release|"`

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-2020.7.4.1.tar.gz.

File metadata

  • Download URL: Sphinx Substitution Extensions-2020.7.4.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for Sphinx Substitution Extensions-2020.7.4.1.tar.gz
Algorithm Hash digest
SHA256 d70bc3c5ae530588a80537088cb70cfd3cb50c3433143bab440b033d39dfb71d
MD5 5ca5f6ba433f3080239596057a124859
BLAKE2b-256 9956763083cb43c6ea29f6ab265391b1b8aa8df904d2a2391b2cb7f51bbc938d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2020.7.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c9e0615f90d777f0c97cb91a3e9592ec013d172dd04244e2cb2095d1d1a2503
MD5 9ea6ed2e93f281bd79067456c1729dfb
BLAKE2b-256 f29d88c7407896369f1eb1256588318b8d6ae3346b8535c44c10e8e1db85592b

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