Ignore versionwarning if it is missing.
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
+try:
import versionwarning
+ versionbanner = True
+except ModuleNotFoundError:
+ versionbanner = False
+
# -- Project information -----------------------------------------------------
@@ -31,6 +36,7 @@ version = '0.10.3'
release = '0.10.3-dev'
# -- Version Warning Banner configuration ------------------------------------
+if versionbanner:
versionwarning_messages = {
'latest': 'You are reading the <code class="docutils literal notranslate"><span class="pre">latest</span></code> (unstable) version of this documentation, which may describe features which are not available in the <a href="/en/stable/">stable version</a>.',
}
@@ -50,9 +56,10 @@ extensions = [
'sphinx.ext.todo',
'sphinx.ext.ifconfig',
'sphinx_tabs.tabs',
- 'versionwarning.extension',
'sphinx_copybutton',
]
+if versionbanner:
+ extensions.append('versionwarning.extension')
# Add any paths that contain templates here, relative to this directory.
