Skip to content

Commit

Permalink
Added text to state the Python version used to build the docs. (SciTo…
Browse files Browse the repository at this point in the history
…ols#3989)

* Added text to state the Python version used to build the docs.

* Added footer template that includes the Python version used to build.

* added new line

* Review actions

* added whatsnew
  • Loading branch information
tkknight authored Feb 9, 2021
1 parent 7d73cf2 commit c51dab2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/src/_templates/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "!footer.html" %}
{% block extrafooter %}
Built using Python {{ python_version }}.
{{ super() }}
{% endblock %}
14 changes: 9 additions & 5 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def autolog(message):

# define the copyright information for latex builds. Note, for html builds,
# the copyright exists directly inside "_templates/layout.html"
upper_copy_year = datetime.datetime.now().year
copyright = "Iris Contributors"
copyright_years = f"2010 - {datetime.datetime.now().year}"
copyright = f"{copyright_years}, Iris Contributors"
author = "Iris Developers"

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -95,9 +95,12 @@ def autolog(message):

# Create a variable that can be inserted in the rst "|copyright_years|".
# You can add more variables here if needed.

build_python_version = ".".join([str(i) for i in sys.version_info[:3]])

rst_epilog = f"""
.. |copyright_years| replace:: 2010 - {upper_copy_year}
.. |python_version| replace:: {'.'.join([str(i) for i in sys.version_info[:3]])}
.. |copyright_years| replace:: {copyright_years}
.. |python_version| replace:: {build_python_version}
.. |iris_version| replace:: v{version}
.. |build_date| replace:: ({datetime.datetime.now().strftime('%d %b %Y')})
"""
Expand Down Expand Up @@ -225,7 +228,8 @@ def autolog(message):
}

html_context = {
"copyright_years": "2010 - {}".format(upper_copy_year),
"copyright_years": copyright_years,
"python_version": build_python_version,
# menu_links and menu_links_name are used in _templates/layout.html
# to include some nice icons. See http://fontawesome.io for a list of
# icons (used in the sphinx_rtd_theme)
Expand Down
3 changes: 3 additions & 0 deletions docs/src/developers_guide/contributing_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ The documentation uses specific packages that need to be present. Please see
Building
~~~~~~~~

This documentation was built using the latest Python version that Iris
supports. For more information see :ref:`installing_iris`.

The build can be run from the documentation directory ``docs/src``.

The build output for the html is found in the ``_build/html`` sub directory.
Expand Down
4 changes: 3 additions & 1 deletion docs/src/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ any WSL_ distributions.
.. _WSL: https://docs.microsoft.com/en-us/windows/wsl/install-win10

.. note:: Iris currently supports and is tested against **Python 3.6** and
**Python 3.7**.
**Python 3.7**.

.. note:: This documentation was built using Python |python_version|.


.. _installing_using_conda:
Expand Down
4 changes: 4 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ This document explains the changes made to Iris for this release
#. `@bjlittle`_ added automated Iris version discovery for the ``latest.rst``
in the ``whatsnew`` documentation. (:pull:`3981`)

#. `@tkknight`_ stated the Python version used to build the documentation
on :ref:`installing_iris` and to the footer of all pages. Also added the
copyright years to the footer. (:pull:`3989`)


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

0 comments on commit c51dab2

Please sign in to comment.