All Projects → adamtheturtle → sphinx-substitution-extensions

adamtheturtle / sphinx-substitution-extensions

Licence: Apache-2.0 license
Extensions for Sphinx which allow substitutions

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to sphinx-substitution-extensions

sphinx-codeautolink
Automatic links from code examples to reference documentation
Stars: ✭ 41 (+28.13%)
Mutual labels:  sphinx-extension
readthedocs-sphinx-search
Enable search-as-you-type feature for docs hosted by RTD.
Stars: ✭ 24 (-25%)
Mutual labels:  sphinx-extension
sphinxext-opengraph
Sphinx extension to generate unique OpenGraph metadata
Stars: ✭ 29 (-9.37%)
Mutual labels:  sphinx-extension
sphinxcontrib-hdl-diagrams
Sphinx Extension which generates various types of diagrams from Verilog code.
Stars: ✭ 37 (+15.63%)
Mutual labels:  sphinx-extension
sphinxcontrib-jupyter
A Sphinx Extension for Generating Jupyter Notebooks
Stars: ✭ 72 (+125%)
Mutual labels:  sphinx-extension
sphinx rtd dark mode
Adds a toggleable dark mode to the Read the Docs theme for Sphinx.
Stars: ✭ 29 (-9.37%)
Mutual labels:  sphinx-extension
httpdomain
Documenting RESTful HTTP APIs
Stars: ✭ 51 (+59.38%)
Mutual labels:  sphinx-extension
sphinx-revealjs
Presentation builder for Pythonista
Stars: ✭ 56 (+75%)
Mutual labels:  sphinx-extension
autodoc pydantic
Seamlessly integrate pydantic models in your Sphinx documentation.
Stars: ✭ 60 (+87.5%)
Mutual labels:  sphinx-extension
sphinx-wavedrom
A sphinx extension that allows including wavedrom diagrams by using its text-based representation
Stars: ✭ 26 (-18.75%)
Mutual labels:  sphinx-extension
restbuilder
A Sphinx builder/writer to output reStructuredText (rst) files
Stars: ✭ 25 (-21.87%)
Mutual labels:  sphinx-extension
plantuml
No description or website provided.
Stars: ✭ 87 (+171.88%)
Mutual labels:  sphinx-extension
matlabdomain
A Sphinx extension for documenting Matlab code
Stars: ✭ 34 (+6.25%)
Mutual labels:  sphinx-extension
sphinx-toolbox
Box of handy tools for Sphinx 🧰 📔
Stars: ✭ 55 (+71.88%)
Mutual labels:  sphinx-extension
openapi
OpenAPI (fka Swagger) spec renderer for Sphinx.
Stars: ✭ 78 (+143.75%)
Mutual labels:  sphinx-extension
autoprogram
Documenting CLI programs
Stars: ✭ 37 (+15.63%)
Mutual labels:  sphinx-extension
emojicodes
An extension to use emoji codes in your Sphinx documentation! 😍
Stars: ✭ 39 (+21.88%)
Mutual labels:  sphinx-extension
sphinxcontrib-django
This is a sphinx extension which improves the documentation of Django apps.
Stars: ✭ 37 (+15.63%)
Mutual labels:  sphinx-extension
sphinx-traceability-extension
Traceability extension for Sphinx documentation generator
Stars: ✭ 24 (-25%)
Mutual labels:  sphinx-extension
sphinx-prompt
Sphinx directive to add unselectable prompt
Stars: ✭ 39 (+21.88%)
Mutual labels:  sphinx-extension

Build Status codecov PyPI

Sphinx Substitution Extensions

Extensions for Sphinx which allow substitutions within code blocks.

Installation

Sphinx Substitution Extensions is compatible with Sphinx 4.0+ using Python 3.8+.

$ pip install Sphinx-Substitution-Extensions

Setup

  1. Add the following to conf.py:
extensions += ['sphinx_substitution_extensions']
  1. 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.

Optional: sphinx-prompt

Sphinx Substitution Extensions supports the third-party extension sphinx-prompt.

  1. If you don't have sphinx-prompt installed, you can include the extension with the extra dependency prompt:
$ pip install Sphinx-Substitution-Extensions[prompt]

2. Make sure sphinx-prompt dependency is loaded before sphinx_substitution_extensions. For example, your conf.py should look like:

# sphinx-prompt must be the first of these two.
extensions += ['sphinx-prompt', 'sphinx_substitution_extensions']

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.

Note

Requires the extension sphinx-prompt.

.. prompt:: bash
   :substitutions:

   echo "|author| released version |release|"

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].