From 96131f57096e7d40b45a65517e305820e2c785d7 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Wed, 10 Feb 2021 17:05:44 +0000 Subject: [PATCH 01/21] baseline --- docs/src/_static/theme_override.css | 14 +++++++++++ docs/src/_templates/layout.html | 36 +++++++++++++++++++++++++++++ docs/src/conf.py | 6 ++++- 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/src/_static/theme_override.css b/docs/src/_static/theme_override.css index 5edc286630..d98c8354d6 100644 --- a/docs/src/_static/theme_override.css +++ b/docs/src/_static/theme_override.css @@ -26,3 +26,17 @@ table.docutils td { word-wrap: break-word; } +/* Used for very strong warning */ +#slim-red-box-message { + background: #ff0000; + box-sizing: border-box; + color: #ffffff; + font-weight: normal; + padding: 0.5em; + width: 100%; +} + +#slim-red-box-message a { + color: #ffffff; + text-decoration:underline; +} diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 9b4983697e..d191bebce6 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -1,5 +1,41 @@ {% extends "!layout.html" %} +{# This uses blocks. See: + https://www.sphinx-doc.org/en/master/templating.html +#} + +/*---------------------------------------------------------------------------*/ + +{%- block document %} + + DEBUG: version is {{ version }}. Below are two different presentations + on showing a warning message. + + {%- if (("dev" in version) or ("rc" in version)) %} +
+ You a viewing the latest unreleased documentation. + Please see the + stable + version. +
+

+ +
+

Warning

+ You a viewing the latest unreleased documentation. + Please see the + stable + version. +

+

+ {%- endif %} + + {{ super() }} + +{%- endblock %} + +/*---------------------------------------------------------------------------*/ + {% block menu %} {{ super() }} diff --git a/docs/src/conf.py b/docs/src/conf.py index 843af17944..f39975e852 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -80,12 +80,15 @@ def autolog(message): import iris # The short X.Y version. +# TREMTEST: This seems pointless now? Is it ever true? if iris.__version__ == "dev": version = "dev" else: # major.minor.patch-dev -> major.minor.patch version = ".".join(iris.__version__.split("-")[0].split(".")[:3]) # The full version, including alpha/beta/rc tags. + +# TREMTEST: lets try to not define release? release = iris.__version__ autolog("Iris Version = {}".format(version)) @@ -222,12 +225,13 @@ def autolog(message): html_theme = "sphinx_rtd_theme" html_theme_options = { - "display_version": True, + "display_version": False, "style_external_links": True, "logo_only": "True", } html_context = { + "version": version, "copyright_years": copyright_years, "python_version": build_python_version, # menu_links and menu_links_name are used in _templates/layout.html From d2bc328a62fd71546d6fa6f6d6052dfbb89ae8e3 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Wed, 10 Feb 2021 17:08:12 +0000 Subject: [PATCH 02/21] removed debug comments --- docs/src/conf.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/src/conf.py b/docs/src/conf.py index f39975e852..6c65d6db6b 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -80,7 +80,6 @@ def autolog(message): import iris # The short X.Y version. -# TREMTEST: This seems pointless now? Is it ever true? if iris.__version__ == "dev": version = "dev" else: @@ -88,7 +87,6 @@ def autolog(message): version = ".".join(iris.__version__.split("-")[0].split(".")[:3]) # The full version, including alpha/beta/rc tags. -# TREMTEST: lets try to not define release? release = iris.__version__ autolog("Iris Version = {}".format(version)) From 72ffba2002fac266882d890776cfc21cdf3c3a1c Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Wed, 10 Feb 2021 17:11:15 +0000 Subject: [PATCH 03/21] reverted --- docs/src/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/conf.py b/docs/src/conf.py index 6c65d6db6b..42c91c8579 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -223,7 +223,7 @@ def autolog(message): html_theme = "sphinx_rtd_theme" html_theme_options = { - "display_version": False, + "display_version": True, "style_external_links": True, "logo_only": "True", } From 1313014c1f7448021c95875eb2db42c654b61772 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Wed, 10 Feb 2021 17:11:58 +0000 Subject: [PATCH 04/21] remove line --- docs/src/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/conf.py b/docs/src/conf.py index 42c91c8579..106504886a 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -86,7 +86,6 @@ def autolog(message): # major.minor.patch-dev -> major.minor.patch version = ".".join(iris.__version__.split("-")[0].split(".")[:3]) # The full version, including alpha/beta/rc tags. - release = iris.__version__ autolog("Iris Version = {}".format(version)) From d70d85644cf6cc7236fe482e8272b5366ce1a3ba Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 16:54:10 +0000 Subject: [PATCH 05/21] Testing --- docs/src/_static/theme_override.css | 2 +- docs/src/_templates/layout.html | 42 ++++++++++++++++++++--------- docs/src/conf.py | 3 ++- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/docs/src/_static/theme_override.css b/docs/src/_static/theme_override.css index d98c8354d6..c56b720f69 100644 --- a/docs/src/_static/theme_override.css +++ b/docs/src/_static/theme_override.css @@ -33,10 +33,10 @@ table.docutils td { color: #ffffff; font-weight: normal; padding: 0.5em; - width: 100%; } #slim-red-box-message a { color: #ffffff; + font-weight: normal; text-decoration:underline; } diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index d191bebce6..853d7087d8 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -7,27 +7,45 @@ /*---------------------------------------------------------------------------*/ {%- block document %} +{% if theme_display_version %} +{%- set nav_version = version %} +{% if READTHEDOCS and current_version %} + {%- set nav_version = current_version %} +{% endif %} +{% if nav_version %} +
+ {{ nav_version }} +
+{% endif %} +{% endif %} - DEBUG: version is {{ version }}. Below are two different presentations - on showing a warning message. - {%- if (("dev" in version) or ("rc" in version)) %} -
- You a viewing the latest unreleased documentation. - Please see the - stable - version. -
-

+DEBUG: theme_display_version = {{ theme_display_version }}
+ DEBUG: current_version = {{ current_version }}
+ DEBUG: nav_version = {{ nav_version }}
+ DEBUG: version = {{ version }}
+ + {%- if "dev" in version %} +
+ You a viewing the latest unreleased documentation + v{{ version }}. You may prefer a + stable + version. +
+

+ {%- endif %} + {%- if "dev" in version %}

Warning

- You a viewing the latest unreleased documentation. - Please see the + You a viewing the latest unreleased documentation + v{{ version }}. You may prefer a stable version.

+ +

{%- endif %} {{ super() }} diff --git a/docs/src/conf.py b/docs/src/conf.py index 106504886a..1fb38213f1 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -129,7 +129,8 @@ def autolog(message): # better api documentation (custom) "custom_class_autodoc", "custom_data_autodoc", - "generate_package_rst", + # TREMTEST + # "generate_package_rst", ] # -- panels extension --------------------------------------------------------- From bbe03464e191bf6e1cb81bd416379df0ddc890d4 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 17:17:30 +0000 Subject: [PATCH 06/21] testing extensions --- docs/src/conf.py | 24 ++++++++++++++++++++++++ requirements/ci/py37.yml | 2 ++ 2 files changed, 26 insertions(+) diff --git a/docs/src/conf.py b/docs/src/conf.py index 1fb38213f1..8ebd5f120a 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -126,6 +126,7 @@ def autolog(message): "sphinx_gallery.gen_gallery", "matplotlib.sphinxext.mathmpl", "matplotlib.sphinxext.plot_directive", + "versionwarning.extension", # better api documentation (custom) "custom_class_autodoc", "custom_data_autodoc", @@ -133,6 +134,29 @@ def autolog(message): # "generate_package_rst", ] +# -- sphinx-version-warning extension------------------------------------------ +# See https://sphinx-version-warning.readthedocs.io/en/latest/index.html + +versionwarning_messages = { + "latest": ( + "(exntesion) You a viewing the latest unreleased documentation " + "v{{ version }}. You may prefer a " + "stable" + "version." + ), +} + +versionwarning_admonition_type = "tip" +versionwarning_banner_title = "Tip" +versionwarning_body_selector = 'div[itemprop="articleBody"]' + +# === +# Show warning at top of page +# versionwarning_body_selector = "div.document" +# versionwarning_banner_title = "" +# For debugging locally +# versionwarning_project_version = "latest" + # -- panels extension --------------------------------------------------------- # See https://sphinx-panels.readthedocs.io/en/latest/ diff --git a/requirements/ci/py37.yml b/requirements/ci/py37.yml index bdb097796a..62f0a2c3f3 100644 --- a/requirements/ci/py37.yml +++ b/requirements/ci/py37.yml @@ -49,3 +49,5 @@ dependencies: - sphinx-gallery - sphinx-panels - sphinx_rtd_theme + - pip: + - sphinx-version-warning \ No newline at end of file From 82d976c7ac0467b2112945f1ad082b0873a364be Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 17:37:18 +0000 Subject: [PATCH 07/21] testing rtd_version --- docs/src/_static/theme_override.css | 14 -------------- docs/src/_templates/layout.html | 8 ++++---- docs/src/conf.py | 9 ++++++--- requirements/ci/py37.yml | 2 -- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/docs/src/_static/theme_override.css b/docs/src/_static/theme_override.css index c56b720f69..5edc286630 100644 --- a/docs/src/_static/theme_override.css +++ b/docs/src/_static/theme_override.css @@ -26,17 +26,3 @@ table.docutils td { word-wrap: break-word; } -/* Used for very strong warning */ -#slim-red-box-message { - background: #ff0000; - box-sizing: border-box; - color: #ffffff; - font-weight: normal; - padding: 0.5em; -} - -#slim-red-box-message a { - color: #ffffff; - font-weight: normal; - text-decoration:underline; -} diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 853d7087d8..ee9aef6ec5 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -25,9 +25,9 @@ DEBUG: nav_version = {{ nav_version }}
DEBUG: version = {{ version }}
- {%- if "dev" in version %} + {% if rtd_version = "latest" %}
- You a viewing the latest unreleased documentation + (rtd_version1) You a viewing the latest unreleased documentation v{{ version }}. You may prefer a stable version. @@ -35,10 +35,10 @@

{%- endif %} - {%- if "dev" in version %} + {% if rtd_version = "latest" %}

Warning

- You a viewing the latest unreleased documentation + (rtd_version2) You a viewing the latest unreleased documentation v{{ version }}. You may prefer a stable version. diff --git a/docs/src/conf.py b/docs/src/conf.py index 8ebd5f120a..fddbf17459 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -43,6 +43,8 @@ def autolog(message): for item, value in os.environ.items(): autolog("[READTHEDOCS] {} = {}".format(item, value)) +# This is the version "name" rtd uses, such as: latest, stable, v3.0.1 etc +rtd_version = os.environ.get("READTHEDOCS_VERSION") # -- Path setup -------------------------------------------------------------- @@ -147,15 +149,15 @@ def autolog(message): } versionwarning_admonition_type = "tip" -versionwarning_banner_title = "Tip" -versionwarning_body_selector = 'div[itemprop="articleBody"]' +# versionwarning_banner_title = "Tip" +# versionwarning_body_selector = 'div[itemprop="articleBody"]' # === # Show warning at top of page # versionwarning_body_selector = "div.document" # versionwarning_banner_title = "" # For debugging locally -# versionwarning_project_version = "latest" +versionwarning_project_version = "latest" # -- panels extension --------------------------------------------------------- # See https://sphinx-panels.readthedocs.io/en/latest/ @@ -253,6 +255,7 @@ def autolog(message): } html_context = { + "rtd_version": rtd_version, "version": version, "copyright_years": copyright_years, "python_version": build_python_version, diff --git a/requirements/ci/py37.yml b/requirements/ci/py37.yml index 62f0a2c3f3..bdb097796a 100644 --- a/requirements/ci/py37.yml +++ b/requirements/ci/py37.yml @@ -49,5 +49,3 @@ dependencies: - sphinx-gallery - sphinx-panels - sphinx_rtd_theme - - pip: - - sphinx-version-warning \ No newline at end of file From 706a8fdcb00cf62e924b723f0c5b9f0454a5b9a9 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 17:42:41 +0000 Subject: [PATCH 08/21] fixed if --- docs/src/_templates/layout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index ee9aef6ec5..b69d01d330 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -25,7 +25,7 @@ DEBUG: nav_version = {{ nav_version }}
DEBUG: version = {{ version }}
- {% if rtd_version = "latest" %} + {% if rtd_version == 'latest' %}
(rtd_version1) You a viewing the latest unreleased documentation v{{ version }}. You may prefer a @@ -35,7 +35,7 @@

{%- endif %} - {% if rtd_version = "latest" %} + {% if rtd_version == 'latest' %}

Warning

(rtd_version2) You a viewing the latest unreleased documentation From 0d54f020f0cb74c949c8c79a0d132ecda4914ed5 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 17:55:19 +0000 Subject: [PATCH 09/21] removed line --- docs/src/_templates/layout.html | 20 -------------------- docs/src/conf.py | 1 - 2 files changed, 21 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index b69d01d330..d49e013eb1 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -7,24 +7,6 @@ /*---------------------------------------------------------------------------*/ {%- block document %} -{% if theme_display_version %} -{%- set nav_version = version %} -{% if READTHEDOCS and current_version %} - {%- set nav_version = current_version %} -{% endif %} -{% if nav_version %} -
- {{ nav_version }} -
-{% endif %} -{% endif %} - - -DEBUG: theme_display_version = {{ theme_display_version }}
- DEBUG: current_version = {{ current_version }}
- DEBUG: nav_version = {{ nav_version }}
- DEBUG: version = {{ version }}
- {% if rtd_version == 'latest' %}
(rtd_version1) You a viewing the latest unreleased documentation @@ -44,12 +26,10 @@ version.

-

{%- endif %} {{ super() }} - {%- endblock %} /*---------------------------------------------------------------------------*/ diff --git a/docs/src/conf.py b/docs/src/conf.py index fddbf17459..ca13bc8687 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -128,7 +128,6 @@ def autolog(message): "sphinx_gallery.gen_gallery", "matplotlib.sphinxext.mathmpl", "matplotlib.sphinxext.plot_directive", - "versionwarning.extension", # better api documentation (custom) "custom_class_autodoc", "custom_data_autodoc", From 1c3efaa0dd74ccb56b291a32f8e3ea52b909a3f1 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 18:16:09 +0000 Subject: [PATCH 10/21] tidy up --- docs/src/_templates/layout.html | 12 +----------- docs/src/conf.py | 26 +------------------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index d49e013eb1..c67f4f8836 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -7,20 +7,10 @@ /*---------------------------------------------------------------------------*/ {%- block document %} - {% if rtd_version == 'latest' %} -
- (rtd_version1) You a viewing the latest unreleased documentation - v{{ version }}. You may prefer a - stable - version. -
-

- {%- endif %} - {% if rtd_version == 'latest' %}

Warning

- (rtd_version2) You a viewing the latest unreleased documentation + You a viewing the latest unreleased documentation v{{ version }}. You may prefer a stable version. diff --git a/docs/src/conf.py b/docs/src/conf.py index ca13bc8687..b91dc2b764 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -134,30 +134,6 @@ def autolog(message): # TREMTEST # "generate_package_rst", ] - -# -- sphinx-version-warning extension------------------------------------------ -# See https://sphinx-version-warning.readthedocs.io/en/latest/index.html - -versionwarning_messages = { - "latest": ( - "(exntesion) You a viewing the latest unreleased documentation " - "v{{ version }}. You may prefer a " - "stable" - "version." - ), -} - -versionwarning_admonition_type = "tip" -# versionwarning_banner_title = "Tip" -# versionwarning_body_selector = 'div[itemprop="articleBody"]' - -# === -# Show warning at top of page -# versionwarning_body_selector = "div.document" -# versionwarning_banner_title = "" -# For debugging locally -versionwarning_project_version = "latest" - # -- panels extension --------------------------------------------------------- # See https://sphinx-panels.readthedocs.io/en/latest/ @@ -191,7 +167,7 @@ def autolog(message): # See https://sphinx-copybutton.readthedocs.io/en/latest/ copybutton_prompt_text = ">>> " -# sphinx.ext.todo configuration +# sphinx.ext.todo configuration ----------------------------------------------- # See https://www.sphinx-doc.org/en/master/usage/extensions/todo.html todo_include_todos = True From da2510f745b670451a36edf98b1c315a93e0fc0e Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 18:19:05 +0000 Subject: [PATCH 11/21] tidy comments --- docs/src/_templates/layout.html | 1 - docs/src/conf.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index c67f4f8836..99ec1ad20e 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -14,7 +14,6 @@ v{{ version }}. You may prefer a stable version. -

{%- endif %} diff --git a/docs/src/conf.py b/docs/src/conf.py index b91dc2b764..1129ecb0e7 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -43,7 +43,7 @@ def autolog(message): for item, value in os.environ.items(): autolog("[READTHEDOCS] {} = {}".format(item, value)) -# This is the version "name" rtd uses, such as: latest, stable, v3.0.1 etc +# This is the rtd reference to the version, such as: latest, stable, v3.0.1 etc rtd_version = os.environ.get("READTHEDOCS_VERSION") # -- Path setup -------------------------------------------------------------- @@ -131,8 +131,7 @@ def autolog(message): # better api documentation (custom) "custom_class_autodoc", "custom_data_autodoc", - # TREMTEST - # "generate_package_rst", + "generate_package_rst", ] # -- panels extension --------------------------------------------------------- # See https://sphinx-panels.readthedocs.io/en/latest/ From b131337fa2fa304f30af05eaca58696a339216a1 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 18:25:03 +0000 Subject: [PATCH 12/21] debug of pre-existing rtd variables --- docs/src/_templates/layout.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 99ec1ad20e..51b976f3f8 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -7,6 +7,10 @@ /*---------------------------------------------------------------------------*/ {%- block document %} + DEBUG: + readthedocs.v1.vcs.type = {{ readthedocs.v1.vcs.type }} + readthedocs.v1 = {{ readthedocs.v1 }} + {% if rtd_version == 'latest' %}

Warning

From 153fa2c13a54064a417bf5d8fa9fc4cfea9861a0 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sun, 14 Feb 2021 18:42:51 +0000 Subject: [PATCH 13/21] added reminder --- docs/src/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/conf.py b/docs/src/conf.py index 1129ecb0e7..8fb54ea16e 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -44,6 +44,7 @@ def autolog(message): autolog("[READTHEDOCS] {} = {}".format(item, value)) # This is the rtd reference to the version, such as: latest, stable, v3.0.1 etc +# TREMTEST: I may not need to create a variable, see https://docs.readthedocs.io/en/stable/development/design/theme-context.html?highlight=html_ rtd_version = os.environ.get("READTHEDOCS_VERSION") # -- Path setup -------------------------------------------------------------- From adad28c8f3cc3ff60681219d7007bba2984b11ec Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Mon, 15 Feb 2021 10:18:30 +0000 Subject: [PATCH 14/21] testing --- docs/src/_templates/layout.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 51b976f3f8..59a8356b4f 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -6,10 +6,20 @@ /*---------------------------------------------------------------------------*/ +{%- block sidebartitle %} + {{ super() }} + + FOO! +{%- endblock %} + +/*---------------------------------------------------------------------------*/ + {%- block document %} DEBUG: - readthedocs.v1.vcs.type = {{ readthedocs.v1.vcs.type }} - readthedocs.v1 = {{ readthedocs.v1 }} + {% if readthedocs %} + readthedocs.v1.vcs.type = {{ readthedocs.v1.vcs.type }} + readthedocs.v1 = {{ readthedocs.v1 }} + {%- endif %} {% if rtd_version == 'latest' %}
@@ -25,7 +35,7 @@ {{ super() }} {%- endblock %} -/*---------------------------------------------------------------------------*/ +/*-----------------------------------------------------z----------------------*/ {% block menu %} {{ super() }} From 271314a5059c35af95313da3bab6e89df91dc2e8 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Mon, 15 Feb 2021 11:07:12 +0000 Subject: [PATCH 15/21] testing still --- docs/src/_static/theme_override.css | 14 ++++++++++++++ docs/src/_templates/layout.html | 29 ++++++++++++----------------- docs/src/conf.py | 4 +--- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/docs/src/_static/theme_override.css b/docs/src/_static/theme_override.css index 5edc286630..c56b720f69 100644 --- a/docs/src/_static/theme_override.css +++ b/docs/src/_static/theme_override.css @@ -26,3 +26,17 @@ table.docutils td { word-wrap: break-word; } +/* Used for very strong warning */ +#slim-red-box-message { + background: #ff0000; + box-sizing: border-box; + color: #ffffff; + font-weight: normal; + padding: 0.5em; +} + +#slim-red-box-message a { + color: #ffffff; + font-weight: normal; + text-decoration:underline; +} diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 59a8356b4f..352370375f 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -6,30 +6,25 @@ /*---------------------------------------------------------------------------*/ -{%- block sidebartitle %} - {{ super() }} - - FOO! -{%- endblock %} - -/*---------------------------------------------------------------------------*/ - {%- block document %} - DEBUG: - {% if readthedocs %} - readthedocs.v1.vcs.type = {{ readthedocs.v1.vcs.type }} - readthedocs.v1 = {{ readthedocs.v1 }} - {%- endif %} {% if rtd_version == 'latest' %} -
-

Warning

+
You a viewing the latest unreleased documentation v{{ version }}. You may prefer a stable version. -
-

+
+

+ +
+

Warning

+ You a viewing the latest unreleased documentation + v{{ version }}. You may prefer a + stable + version. +
+

{%- endif %} {{ super() }} diff --git a/docs/src/conf.py b/docs/src/conf.py index 08869beb18..b8cfb9f700 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -44,7 +44,7 @@ def autolog(message): autolog("[READTHEDOCS] {} = {}".format(item, value)) # This is the rtd reference to the version, such as: latest, stable, v3.0.1 etc -# TREMTEST: I may not need to create a variable, see https://docs.readthedocs.io/en/stable/development/design/theme-context.html?highlight=html_ +# For testing purposes this could be explicitly set to one of the above. rtd_version = os.environ.get("READTHEDOCS_VERSION") # -- Path setup -------------------------------------------------------------- @@ -300,7 +300,6 @@ def autolog(message): "ignore_pattern": r"__init__\.py", } - # ----------------------------------------------------------------------------- # Remove matplotlib agg warnings from generated doc when using plt.show warnings.filterwarnings( @@ -310,7 +309,6 @@ def autolog(message): " non-GUI backend, so cannot show the figure.", ) - # -- numfig options (built-in) ------------------------------------------------ # Enable numfig. numfig = True From ea7459cbb79910191f0a936f88c0d6617528dc43 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Mon, 15 Feb 2021 11:20:43 +0000 Subject: [PATCH 16/21] updated comments --- docs/src/_templates/layout.html | 1 - docs/src/conf.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 352370375f..1a663383d0 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -7,7 +7,6 @@ /*---------------------------------------------------------------------------*/ {%- block document %} - {% if rtd_version == 'latest' %}
You a viewing the latest unreleased documentation diff --git a/docs/src/conf.py b/docs/src/conf.py index b8cfb9f700..ab05312fca 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -44,7 +44,7 @@ def autolog(message): autolog("[READTHEDOCS] {} = {}".format(item, value)) # This is the rtd reference to the version, such as: latest, stable, v3.0.1 etc -# For testing purposes this could be explicitly set to one of the above. +# For local testing purposes this could be explicitly set latest or stable. rtd_version = os.environ.get("READTHEDOCS_VERSION") # -- Path setup -------------------------------------------------------------- From 3bba3dc74fd4212235cf64749588e756adc3fcee Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Tue, 16 Feb 2021 16:28:00 +0000 Subject: [PATCH 17/21] added whatsnew --- docs/src/whatsnew/latest.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index a70385a7ed..c1d0ec58f7 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -91,6 +91,9 @@ This document explains the changes made to Iris for this release #. `@bjlittle`_ added the |PyPI|_ badge to the `README.md`_. (:pull:`4004`) +#. `@tkknight`_ added a banner at the top of every page if the unreleased + development documentatiion is being viewed. (:pull:`3999`) + 💼 Internal =========== From bef1febc5da0cc1a3fe048f869a381fddedfdab0 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Wed, 17 Feb 2021 09:43:49 +0000 Subject: [PATCH 18/21] expanded the if conditiion --- docs/src/_templates/layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index 1a663383d0..f9ce740753 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -7,7 +7,7 @@ /*---------------------------------------------------------------------------*/ {%- block document %} - {% if rtd_version == 'latest' %} + {% if READTHEDOCS and rtd_version == 'latest' %}
You a viewing the latest unreleased documentation v{{ version }}. You may prefer a From 9943d449f782384b134cdebce6c953cbadacbfeb Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Wed, 17 Feb 2021 11:51:22 +0000 Subject: [PATCH 19/21] review actions --- docs/src/_templates/layout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index f9ce740753..c60146b6d3 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -9,7 +9,7 @@ {%- block document %} {% if READTHEDOCS and rtd_version == 'latest' %}
- You a viewing the latest unreleased documentation + You are viewing the latest unreleased documentation v{{ version }}. You may prefer a stable version. @@ -18,7 +18,7 @@

Warning

- You a viewing the latest unreleased documentation + You are viewing the latest unreleased documentation v{{ version }}. You may prefer a stable version. From 14d9b128da238b3837f0e112515fade849db5cb6 Mon Sep 17 00:00:00 2001 From: tkknight <2108488+tkknight@users.noreply.github.com> Date: Fri, 19 Feb 2021 12:34:12 +0000 Subject: [PATCH 20/21] Update layout.html Remove alternative banner that used the RestructuredText notation. --- docs/src/_templates/layout.html | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/src/_templates/layout.html b/docs/src/_templates/layout.html index c60146b6d3..96a2e0913e 100644 --- a/docs/src/_templates/layout.html +++ b/docs/src/_templates/layout.html @@ -15,15 +15,6 @@ version.

- -
-

Warning

- You are viewing the latest unreleased documentation - v{{ version }}. You may prefer a - stable - version. -
-

{%- endif %} {{ super() }} From be4a5863f5326a72da07188b29747e59bb4547f3 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Sat, 20 Feb 2021 10:49:24 +0000 Subject: [PATCH 21/21] review actions --- docs/src/common_links.inc | 1 + docs/src/whatsnew/latest.rst | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/common_links.inc b/docs/src/common_links.inc index 3c465b67dc..23a933367e 100644 --- a/docs/src/common_links.inc +++ b/docs/src/common_links.inc @@ -24,6 +24,7 @@ .. _New Issue: https://github.com/scitools/iris/issues/new/choose .. _pull request: https://github.com/SciTools/iris/pulls .. _pull requests: https://github.com/SciTools/iris/pulls +.. _Read the Docs: https://scitools-iris.readthedocs.io/en/latest/ .. _readthedocs.yml: https://github.com/SciTools/iris/blob/master/requirements/ci/readthedocs.yml .. _SciTools: https://github.com/SciTools .. _sphinx: https://www.sphinx-doc.org/en/master/ diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index c1d0ec58f7..538a38da9b 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -91,8 +91,9 @@ This document explains the changes made to Iris for this release #. `@bjlittle`_ added the |PyPI|_ badge to the `README.md`_. (:pull:`4004`) -#. `@tkknight`_ added a banner at the top of every page if the unreleased - development documentatiion is being viewed. (:pull:`3999`) +#. `@tkknight`_ added a banner at the top of every page of the unreleased + development documentation if being viewed on `Read the Docs`_. + (:pull:`3999`) 💼 Internal