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.5+.

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

File metadata

  • Download URL: Sphinx Substitution Extensions-2019.6.15.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for Sphinx Substitution Extensions-2019.6.15.0.tar.gz
Algorithm Hash digest
SHA256 ab07b78b68a4c4bca94e0a97f893a8b1f29ea85b9250629131f7cfc8c532b932
MD5 05e118498cba88416209a106ca990212
BLAKE2b-256 c7a332624f47833b99457c945d2cd203f0389da30710aeb23046283f974b62d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2019.6.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 910f92d73f5d6981ff20a38c60dbb2d248f84d61592fa61657701a38aaae4796
MD5 d2c454760c6a7672007d21d254b66a02
BLAKE2b-256 9a1decc8c408fdfbe8369836b8e6618f4be46243a2ab0671da074bb872b6145e

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