From db3733be8e7f63d7d35573af1411077caac2c3cf Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 17 Feb 2024 16:02:23 +0000 Subject: [PATCH 1/2] Explain how to override default header links --- README.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.rst b/README.rst index bc76bdc..d7b8ee3 100644 --- a/README.rst +++ b/README.rst @@ -36,6 +36,19 @@ To change the social icons, edit ``mpl_sphinx_theme/mpl_icon_links.html`` To change the style, edit ``mpl_sphinx_theme/static/css/style.css`` +Overriding hard coded elements +------------------------------ +This theme is designed to be used with subprojects that are part of the main +Matplotlib webiste (e.g., [our cheatseets](https://github.com/matplotlib/cheatsheets] +and [list of third-party packages](https://github.com/matplotlib/mpl-third-party)). +As such several elements are hard coded, that other subprojects may want to override. +The following sections explain how to reset these back to their defaults by modifying +``html_theme_options`` in ``conf.py``. + +Header section links +~~~~~~~~~~~~~~~~~~~~ +Use a copy of [the default pydata-sphinx-theme navbar](https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/navbar-nav.html) and set the ``'navbar_center'`` key to this HTML file in ``html_theme_options``. + Building -------- To build the theme with a sample page, navigate into the ``doc/`` directory and run From f9e665d2a00eab89527bd9925ef88595434325f1 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 18 Feb 2024 22:20:41 +0000 Subject: [PATCH 2/2] Make it clear that all MPL subprojects can use this theme Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index d7b8ee3..663fc19 100644 --- a/README.rst +++ b/README.rst @@ -38,10 +38,11 @@ To change the style, edit ``mpl_sphinx_theme/static/css/style.css`` Overriding hard coded elements ------------------------------ -This theme is designed to be used with subprojects that are part of the main +This theme is primarily designed to be used with subprojects that are part of the main Matplotlib webiste (e.g., [our cheatseets](https://github.com/matplotlib/cheatsheets] and [list of third-party packages](https://github.com/matplotlib/mpl-third-party)). -As such several elements are hard coded, that other subprojects may want to override. +As such several elements are hard coded. However, the theme may also be used by +other subprojects that need to change the hard-coded defaults. The following sections explain how to reset these back to their defaults by modifying ``html_theme_options`` in ``conf.py``.