literal_sub_include

A literal include block that supports hardcoded substitutions.

Note

Hopefully we can move a feature like this into Sphinx in the long run.

Directives

.. literalsubinclude::

Directive for practical exercise.

With substitutions turned off:

.. literalsubinclude:: ../cylc/sphinx_ext/literal_sub_include/test.txt

With substitutions turned on:

.. literalsubinclude:: ../cylc/sphinx_ext/literal_sub_include/test.txt
  :substitutions:

With substitutions turned off:

cylc-sphinx-extensions version |version|

With substitutions turned on:

cylc-sphinx-extensions version 1.4.2

Configurations

literal_sub_include_subs

Dictionary containing key value pairs of substitutions e.g:

literal_sub_include_subs = {
    'version': '123',
}

Note

Patching into the Sphinx substitutions appears to be tricky due to the stage at which they are applied.