def ultimate_replace(app, docname, source):
    'Replaces variables in docs, including code blocks.\n\n    From: https://github.com/sphinx-doc/sphinx/issues/4054#issuecomment-329097229\n    '
    result = source[0]
    for key in app.config.ultimate_replacements:
        result = result.replace(key, app.config.ultimate_replacements[key])
    source[0] = result
Replaces variables in docs, including code blocks.

From: https://github.com/sphinx-doc/sphinx/issues/4054#issuecomment-329097229
def ultimate_replace(app, docname, source):
    'Replaces variables in docs, including code blocks.\n\n    From: https://github.com/sphinx-doc/sphinx/issues/4054#issuecomment-329097229\n    '
    result = source[0]
    for key in app.config.ultimate_replacements:
        result = result.replace(key, app.config.ultimate_replacements[key])
    source[0] = result