diff options
Diffstat (limited to 'docs/source/conf.py')
| -rw-r--r-- | docs/source/conf.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index c37e7e17..e85e5dfb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -69,6 +69,7 @@ copyright = u'1983-{0}'.format(now.year) # |version| and |release|, also used in various other places throughout the # built documents. version = '7.1.0' +data_version = '1.0' # use same |release| as |version| release = version @@ -120,6 +121,22 @@ highlight_language = 'none' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False +# Replacement macros for use in code-blocks etc. With inspiration from +# https://github.com/sphinx-doc/sphinx/issues/4054#issuecomment-329097229 +def replace_words(app, docname, source): + result = source[0] + for key in app.config.replacements: + result = result.replace(key, app.config.replacements[key]) + source[0] = result + +replacements = { + "{PROJVERSION}" : "{version_number}".format(version_number=version), + "{PROJDATAVERSION}" : "{data_version_number}".format(data_version_number=data_version), +} + +def setup(app): + app.add_config_value('replacements', {}, True) + app.connect('source-read', replace_words) # -- Options for HTML output ---------------------------------------------- |
