diff --git a/docs/source/_templates/sections/header.html b/docs/source/_templates/sections/header.html new file mode 100644 index 0000000..fc655ee --- /dev/null +++ b/docs/source/_templates/sections/header.html @@ -0,0 +1,58 @@ + + + +
+

You are viewing the latest developer preview docs. Click here to view docs for the latest stable release(v0.7.3).

+
\ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 09abc2d..3c626c3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,8 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os +import os + # import sys # sys.path.insert(0, os.path.abspath('.')) @@ -119,6 +120,16 @@ html_theme_options = { # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] +READTHEDOCS_VERSION_TYPE = os.environ.get('READTHEDOCS_VERSION_TYPE') +if READTHEDOCS_VERSION_TYPE == "tag": + # remove the warning banner if the version is a tagged release + header_file = os.path.join(os.path.dirname(__file__), + "_templates/sections/header.html") + # The file might be removed already if the build is triggered multiple times + # (readthedocs build both HTML and PDF versions separately) + if os.path.exists(header_file): + os.remove(header_file) + def setup(app): pass