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

File metadata

  • Download URL: Sphinx Substitution Extensions-2020.7.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 190aff5b3c777a7c962b44ef0cb0c54afdd0aa48f9bea12285c6631d4ead95ef
MD5 e72400357a8a88ba3c4ce9306b9b1fc4
BLAKE2b-256 b3bb72fd9adcdfffd0a36248c30b55696a146f12d4202df192d3feadadd86939

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2020.7.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d56aaa11243f3c33630a9ac09c9e6a37975b379ba9ac32ce466e6801ab1d0864
MD5 379e720ef307e180f3f9a9c304438298
BLAKE2b-256 d8c777f7f045d13f92dc660fafe73c55aa8039237d849df5548720fe0b2df1b6

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