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

File metadata

  • Download URL: Sphinx Substitution Extensions-2019.4.4.1.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.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for Sphinx Substitution Extensions-2019.4.4.1.tar.gz
Algorithm Hash digest
SHA256 ef2191135674951799c79d347906bb69697d8de75c0a12bae158ef6b6c3b30cb
MD5 61ec464dddca79aae73a948beb019b29
BLAKE2b-256 2c4f270f786cc19586641b2b276935a7d53fcbcfa2873be78896d5da5e24313d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2019.4.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 095da5f158dabc1c8565d6b7115aa269b1e5aee47c6ed232b9332e66bfd677a3
MD5 96d54922407d34a4b1d87837001d806d
BLAKE2b-256 d446cfb13e7817b4e005d95275aa9d301797b9f0b2d16967b9d4a5a8a4b689a8

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