From 85d8d05fcffa57bb02140945263cad728d68b988 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Mon, 27 Jan 2020 12:05:29 -0800 Subject: [PATCH] Backport PR #16255: Move version info to sidebar --- doc/_static/mpl.css | 7 +++-- doc/_templates/sidebar_versions.html | 38 ++++++++++++++++++++++++ doc/conf.py | 3 +- doc/index.rst | 43 ---------------------------- 4 files changed, 44 insertions(+), 47 deletions(-) create mode 100644 doc/_templates/sidebar_versions.html diff --git a/doc/_static/mpl.css b/doc/_static/mpl.css index d2b46174f798..dd5d15fac594 100644 --- a/doc/_static/mpl.css +++ b/doc/_static/mpl.css @@ -1133,15 +1133,16 @@ div.viewcode-block:target { } -.sidebar-announcement { +.sidebar-announcement, +.sidebar-versions { border: 1px solid #11557C; background: #eff9ff; - padding: 2px; + padding: 0.2em 0.5em; margin-top: 1em; } .sidebar-announcement p { - margin: 0.4em 0.4em 0.6em 0.4em; + margin: 0.4em 0 0.6em 0; } /* new main nav */ diff --git a/doc/_templates/sidebar_versions.html b/doc/_templates/sidebar_versions.html new file mode 100644 index 000000000000..35a965661d90 --- /dev/null +++ b/doc/_templates/sidebar_versions.html @@ -0,0 +1,38 @@ + diff --git a/doc/conf.py b/doc/conf.py index 4e36b7a1acee..a52bdf2341b4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -249,7 +249,8 @@ def _check_dependencies(): # Custom sidebar templates, maps page names to templates. html_sidebars = { - 'index': ['sidebar_announcement.html', 'donate_sidebar.html'], + 'index': ['sidebar_announcement.html', 'sidebar_versions.html', + 'donate_sidebar.html'], '**': ['localtoc.html', 'relations.html', 'pagesource.html'] } diff --git a/doc/index.rst b/doc/index.rst index dc947dcac686..cb9c02f4e860 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -49,51 +49,8 @@ oriented interface or via a set of functions familiar to MATLAB users. Documentation ------------- -This is the documentation for Matplotlib version |version|. - To get started, read the :doc:`User's Guide `. -.. raw:: html - -

- - - Trying to learn how to do a particular kind of plot? Check out the :doc:`examples gallery ` or the :doc:`list of plotting commands `.