From 683d3abe24a31c0c9835bb7d896de3bd8ee0a45b Mon Sep 17 00:00:00 2001 From: JulioV Date: Thu, 3 Dec 2020 18:11:29 -0500 Subject: [PATCH] Add sphinx version warning package --- docs/.readthedocs.yml | 10 ++++++++++ docs/conf.py | 11 +++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 docs/.readthedocs.yml diff --git a/docs/.readthedocs.yml b/docs/.readthedocs.yml new file mode 100644 index 00000000..a39bf7be --- /dev/null +++ b/docs/.readthedocs.yml @@ -0,0 +1,10 @@ +version: 2 + +python: + version: 3.7 + install: + - method: pip + path: . + extra_requirements: + - sphinx-version-warning + diff --git a/docs/conf.py b/docs/conf.py index e5047625..40604e3a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,14 @@ import sys # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] +import versionwarning +version = release = versionwarning.version +versionwarning_messages = { + 'latest': 'These are the old docs for RAPIDS beta. Got to https://www.rapids.science for the latest', +} +versionwarning_banner_title = 'Deprecated Version' +versionwarning_body_selector = 'div[itemprop="articleBody"]' +extensions = ['versionwarning.extension'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -120,7 +127,7 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format.