Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/src/_static/theme_override.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
31 changes: 31 additions & 0 deletions docs/src/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
{% extends "!layout.html" %}

{# This uses blocks. See:
https://www.sphinx-doc.org/en/master/templating.html
#}

/*---------------------------------------------------------------------------*/

{%- block document %}
{% if READTHEDOCS and rtd_version == 'latest' %}
<div id="slim-red-box-message">
You a viewing the <b>latest</b> unreleased documentation
<b>v{{ version }}</b>. You may prefer a
<a href="https://scitools-iris.readthedocs.io/en/stable/">stable</a>
version.
</div>
<p></p>

<div class="admonition warning">
<p class="admonition-title">Warning</p>
You a viewing the <b>latest</b> unreleased documentation
<b>v{{ version }}</b>. You may prefer a
<a href="https://scitools-iris.readthedocs.io/en/stable/">stable</a>
version.
</div>
<p></p>
{%- endif %}

{{ super() }}
{%- endblock %}

/*-----------------------------------------------------z----------------------*/

{% block menu %}
{{ super() }}

Expand Down
10 changes: 6 additions & 4 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def autolog(message):
for item, value in os.environ.items():
autolog("[READTHEDOCS] {} = {}".format(item, value))

# This is the rtd reference to the version, such as: latest, stable, v3.0.1 etc
# For local testing purposes this could be explicitly set latest or stable.
rtd_version = os.environ.get("READTHEDOCS_VERSION")

# -- Path setup --------------------------------------------------------------

Expand Down Expand Up @@ -131,7 +134,6 @@ def autolog(message):
"custom_data_autodoc",
"generate_package_rst",
]

# -- panels extension ---------------------------------------------------------
# See https://sphinx-panels.readthedocs.io/en/latest/

Expand Down Expand Up @@ -165,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

Expand Down Expand Up @@ -228,6 +230,8 @@ def autolog(message):
}

html_context = {
"rtd_version": rtd_version,
"version": version,
"copyright_years": copyright_years,
"python_version": build_python_version,
# menu_links and menu_links_name are used in _templates/layout.html
Expand Down Expand Up @@ -296,7 +300,6 @@ def autolog(message):
"ignore_pattern": r"__init__\.py",
}


# -----------------------------------------------------------------------------
# Remove matplotlib agg warnings from generated doc when using plt.show
warnings.filterwarnings(
Expand All @@ -306,7 +309,6 @@ def autolog(message):
" non-GUI backend, so cannot show the figure.",
)


# -- numfig options (built-in) ------------------------------------------------
# Enable numfig.
numfig = True
Expand Down
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkknight could you add clarification to the reader that this only applies to rtd... that's how I understand it, right?

Copy link
Member

@rcomer rcomer Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo "documentatiion"


💼 Internal
===========
Expand Down