You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
597 B
15 lines
597 B
1 year ago
|
# This tiny sphinx extension will simply copy the current_version (generated by sphinx_multiversion) to the 'version' entry in html_context, so that it is correctly displayed by the ReadTheDocs template
|
||
|
# You need to have the sphinx_multiversion extension as well
|
||
|
|
||
|
def setup(app):
|
||
|
app.connect('config-inited', config_inited)
|
||
|
|
||
|
def config_inited(app, config):
|
||
|
app.connect('html-page-context', html_page_context)
|
||
|
|
||
|
def html_page_context(app, pagename, templatename, context, doctree):
|
||
|
try:
|
||
|
context['version'] = context['current_version'].name
|
||
|
except:
|
||
|
context['version'] = 'no_version_found'
|