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:

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.

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

File metadata

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

File hashes

Hashes for Sphinx Substitution Extensions-2020.4.5.0.tar.gz
Algorithm Hash digest
SHA256 8a5199d699ddfbb6f57846ba3ac358a9366c99905d6deb17baef66a887008698
MD5 e9570557e38f255c3269e9f79f9928f8
BLAKE2b-256 aad2ce71da288e7a61c07b3b58603688b0c015d1e524526fe9562fc62a40850e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2020.4.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1fd3c682b2eb22a4a1dd4c5a2ad4c083b37bd2f12827a1c77c7c30e77e4e9c0
MD5 9530971681f0c46d19ab54cb9fe962e6
BLAKE2b-256 61cf0b897fb1a0b13739d830480759833b0818528db6f3c4b6b4822a3f63fd15

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