Extensions for Sphinx which allow for substitutions.
Project description
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
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
Release history Release notifications | RSS feed
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.9.30.0.tar.gz
.
File metadata
- Download URL: Sphinx Substitution Extensions-2020.9.30.0.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 578afc04eb4f701d9a922f8b75f678d3a1a897fa7a172a9226b92f17553f177a |
|
MD5 | 6c513f88fa04554ed649aae4727c65a8 |
|
BLAKE2b-256 | 63c2f1546e6bf39048fea60ccc8445d8935809e871534897b020e43a360df53b |
File details
Details for the file Sphinx_Substitution_Extensions-2020.9.30.0-py3-none-any.whl
.
File metadata
- Download URL: Sphinx_Substitution_Extensions-2020.9.30.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02e543fb64c82a168031d6f64af5d11bdf91d3f06480ffe399c11be87453729f |
|
MD5 | 3a274352a11e6500f068676026e44acf |
|
BLAKE2b-256 | 143f23d308fbfe22fc454110d7b32022ed1f7ad60e5ea961ec02849165723af3 |