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

File metadata

  • Download URL: Sphinx Substitution Extensions-2020.5.30.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for Sphinx Substitution Extensions-2020.5.30.0.tar.gz
Algorithm Hash digest
SHA256 87e7310d3fdd43d87e9c515cdb4496596ce371d1076ad5bec47e754cd04ae53a
MD5 26fe87a4bc0ff1250be9c937ebac87cd
BLAKE2b-256 2cbb8f8e87e22834c1af4aa1383147570db1e94cdeb879ec25b8dc71f8659e47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2020.5.30.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a958b2bafe0738fac5599eea0f4000e4dd57c387492a6401e38da2c83487fdd
MD5 d1ff8379fd011cae25b1f0d4672f25ea
BLAKE2b-256 36adb13621834e5f635cfb2464d0dc8ea4e18635d7f1c4e066043f088322532c

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