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_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-2018.11.12.2.tar.gz.

File metadata

  • Download URL: Sphinx Substitution Extensions-2018.11.12.2.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for Sphinx Substitution Extensions-2018.11.12.2.tar.gz
Algorithm Hash digest
SHA256 6f521665828dfea716d6c367784c801bb025b618a75d8ddbd604af7877885671
MD5 18c61c883108628beda036f7acd28b23
BLAKE2b-256 464208e819b365898b9bb9c8f1746d6270314e04d4926dc3278bdf00da5f6b3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Sphinx_Substitution_Extensions-2018.11.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b67e941b10c59eee5bbbea569bec9dfd83d6276380e557e6319b86e13121d10
MD5 0c16e194444225334c1d9d4c5f1d30f2
BLAKE2b-256 d766646d09158ef152f4f4c7b3512feab51d3e862481d0ceb902fb75543cc77e

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