From eb58c9456eee0ec439e38b4e9b63c23ca4652302 Mon Sep 17 00:00:00 2001
From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Date: Sun, 24 Oct 2021 21:57:09 +0200
Subject: [PATCH 1/2] Merge pull request #21429 from jklymak/doc-use-mpl-sphinx
DOC: use mpl-sphinx-theme for navbar, social, logo
---
doc/_templates/mpl_nav_bar.html | 21 ----------
doc/conf.py | 26 +-----------
doc/devel/documenting_mpl.rst | 8 ++++
environment.yml | 58 +++++++++++++++++++++++++++
requirements/doc/doc-requirements.txt | 3 +-
5 files changed, 70 insertions(+), 46 deletions(-)
delete mode 100644 doc/_templates/mpl_nav_bar.html
create mode 100644 environment.yml
diff --git a/doc/_templates/mpl_nav_bar.html b/doc/_templates/mpl_nav_bar.html
deleted file mode 100644
index 82b8586de449..000000000000
--- a/doc/_templates/mpl_nav_bar.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
diff --git a/doc/conf.py b/doc/conf.py
index 2092a7d4cae4..64a9240f9072 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -292,7 +292,7 @@ def _check_dependencies():
f"mpl.css?{SHA}",
]
-html_theme = "pydata_sphinx_theme"
+html_theme = "mpl_sphinx_theme"
# The name for this set of Sphinx documents. If None, it defaults to
# " v documentation".
@@ -302,34 +302,12 @@ def _check_dependencies():
# the sidebar.
html_logo = "_static/logo2.svg"
html_theme_options = {
+ "native_site": True,
"logo_link": "index",
# collapse_navigation in pydata-sphinx-theme is slow, so skipped for local
# and CI builds https://github.com/pydata/pydata-sphinx-theme/pull/386
"collapse_navigation": not is_release_build,
- "icon_links": [
- {
- "name": "gitter",
- "url": "https://gitter.im/matplotlib",
- "icon": "fab fa-gitter",
- },
- {
- "name": "discourse",
- "url": "https://discourse.matplotlib.org",
- "icon": "fab fa-discourse",
- },
- {
- "name": "GitHub",
- "url": "https://github.com/matplotlib/matplotlib",
- "icon": "fab fa-github-square",
- },
- {
- "name": "twitter",
- "url": "https://twitter.com/matplotlib/",
- "icon": "fab fa-twitter-square",
- },
- ],
"show_prev_next": False,
- "navbar_center": ["mpl_nav_bar.html"],
}
include_analytics = is_release_build
if include_analytics:
diff --git a/doc/devel/documenting_mpl.rst b/doc/devel/documenting_mpl.rst
index 97a2fd4bc0bb..c1f2fd26c7cf 100644
--- a/doc/devel/documenting_mpl.rst
+++ b/doc/devel/documenting_mpl.rst
@@ -1019,6 +1019,14 @@ Example:
:parts: 2
+Navbar and style
+----------------
+
+Matplotlib has a few subprojects that share the same navbar and style, so these
+are centralized as a sphinx theme at
+`mpl_sphinx_theme `_. Changes to the
+style or topbar should be made there to propagate across all subprojects.
+
.. TODO: Add section about uploading docs
.. _ReST: https://docutils.sourceforge.io/rst.html
diff --git a/environment.yml b/environment.yml
new file mode 100644
index 000000000000..d73d7a99f579
--- /dev/null
+++ b/environment.yml
@@ -0,0 +1,58 @@
+# To set up a development environment using conda run:
+#
+# conda env create -f environment.yml
+# conda activate mpl-dev
+# pip install -e .
+#
+name: mpl-dev
+channels:
+ - conda-forge
+dependencies:
+ - cairocffi
+ - cycler>=0.10.0
+ - fonttools>=4.22.0
+ - kiwisolver>=1.0.1
+ - numpy>=1.17
+ - pillow>=6.2
+ - pygobject
+ - pyparsing
+ - pyqt
+ - python-dateutil>=2.1
+ - setuptools
+ - setuptools_scm
+ - wxpython
+ # building documentation
+ - colorspacious
+ - graphviz
+ - ipython
+ - ipywidgets
+ - numpydoc>=0.8
+ - packaging
+ - pydata-sphinx-theme
+ - scipy
+ - sphinx>=1.8.1,!=2.0.0
+ - sphinx-copybutton
+ - sphinx-gallery>=0.10
+ - sphinx-panels
+ - pip
+ - pip:
+ - mpl-sphinx-theme
+ - sphinxcontrib-svg2pdfconverter
+ # testing
+ - coverage
+ - flake8>=3.8
+ - flake8-docstrings>=1.4.0
+ - gtk3
+ - ipykernel
+ - nbconvert[execute]!=6.0.0,!=6.0.1
+ - nbformat!=5.0.0,!=5.0.1
+ - pandas!=0.25.0
+ - pikepdf
+ - pydocstyle>=5.1.0
+ - pytest!=4.6.0,!=5.4.0
+ - pytest-cov
+ - pytest-rerunfailures
+ - pytest-timeout
+ - pytest-xdist
+ - tornado
+ - pytz
diff --git a/requirements/doc/doc-requirements.txt b/requirements/doc/doc-requirements.txt
index 30b7c0c88669..afb5c4105fae 100644
--- a/requirements/doc/doc-requirements.txt
+++ b/requirements/doc/doc-requirements.txt
@@ -13,7 +13,8 @@ ipython
ipywidgets
numpydoc>=0.8
packaging>=20
-pydata-sphinx-theme>=0.6.0
+pyparsing<3.0.0
+mpl-sphinx-theme
sphinxcontrib-svg2pdfconverter>=1.1.0
sphinx-gallery>=0.10
sphinx-copybutton
From 4ca374385a690f112404d97e39422b124073e940 Mon Sep 17 00:00:00 2001
From: Jody Klymak
Date: Mon, 25 Oct 2021 22:35:18 +0200
Subject: [PATCH 2/2] Removing pyparsing pin
---
requirements/doc/doc-requirements.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/requirements/doc/doc-requirements.txt b/requirements/doc/doc-requirements.txt
index afb5c4105fae..c77787e4c72b 100644
--- a/requirements/doc/doc-requirements.txt
+++ b/requirements/doc/doc-requirements.txt
@@ -13,7 +13,6 @@ ipython
ipywidgets
numpydoc>=0.8
packaging>=20
-pyparsing<3.0.0
mpl-sphinx-theme
sphinxcontrib-svg2pdfconverter>=1.1.0
sphinx-gallery>=0.10