diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2020-03-17 10:21:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-17 10:21:56 +0100 |
| commit | 781dedec1fc3b8452d12f67f3c8ddd9d45f724f4 (patch) | |
| tree | c6f0277b713a00df57c02648c1b3a4779d2f90ad /docs/source/conf.py | |
| parent | 1707090212c4a784e15b67f3e396640da840ad18 (diff) | |
| download | PROJ-781dedec1fc3b8452d12f67f3c8ddd9d45f724f4.tar.gz PROJ-781dedec1fc3b8452d12f67f3c8ddd9d45f724f4.zip | |
Align install.rst with current version (#2075)
Using {PROJVERSION} and {PROJDATAVERSION} substitutes the macro for the current
version numbers of PROJ and PROJ-data.
Rephrased a few sections regarding grid packages.
Closes #2072
Co-authored-by: Mike Taves <mwtoews@gmail.com>
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 ---------------------------------------------- |
