Skip to content

Commit

Permalink
Add version-warning banner and copybutton
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBand committed Jun 1, 2021
1 parent 4c12ba6 commit 02d51f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# sys.path.insert(0, os.path.abspath('.'))

import sphinx_rtd_theme
import versionwarning

# -- Project information -----------------------------------------------------

Expand All @@ -29,6 +30,12 @@
# The full version, including alpha/beta/rc tags
release = ''

# -- Version Warning Banner configuration ------------------------------------
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>.',
}
versionwarning_banner_title = 'Note'
versionwarning_body_selector = 'div[itemprop="articleBody"]'

# -- General configuration ---------------------------------------------------

Expand All @@ -42,6 +49,9 @@
extensions = [
'sphinx.ext.todo',
'sphinx.ext.ifconfig',
'sphinx_tabs.tabs',
'versionwarning.extension',
'sphinx_copybutton',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
3 changes: 3 additions & 0 deletions source/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx-version-warning==1.1.2
sphinx-tabs==2.1.0
sphinx-copybutton==0.3.1

0 comments on commit 02d51f7

Please sign in to comment.