From 9f199aa202ee78357c94efaf03f1cc09834e9d8f Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sat, 5 Feb 2022 14:08:39 +0100 Subject: [PATCH 1/2] DOC: put the gallery keywords in the meta tag [skip actions] [skip azp] [skip appveyor] --- doc/conf.py | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 7d5e729c8a20..50475322b101 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -210,15 +210,30 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, mathmpl_fontsize = 11.0 mathmpl_srcset = ['2x'] -# Monkey-patching gallery signature to include search keywords -gen_rst.SPHX_GLR_SIG = """\n +# Monkey-patching gallery header to include search keywords +gen_rst.EXAMPLE_HEADER = """ +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "{0}" +.. LINE NUMBERS ARE GIVEN BELOW. + .. only:: html - .. rst-class:: sphx-glr-signature + .. meta:: + :keywords: matplotlib code example, codex, python plot, pyplot + + .. note:: + :class: sphx-glr-download-link-note + + Click :ref:`here ` + to download the full example code{2} - Keywords: matplotlib code example, codex, python plot, pyplot - `Gallery generated by Sphinx-Gallery - `_\n""" +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_{1}: + +""" # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From a3efa08a513d41a2b4a0f033e8ae365b5e1187f2 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Mon, 21 Feb 2022 09:52:24 +0100 Subject: [PATCH 2/2] DOC: remove all keywords except codex --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 50475322b101..667cead70d81 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -221,7 +221,7 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, .. only:: html .. meta:: - :keywords: matplotlib code example, codex, python plot, pyplot + :keywords: codex .. note:: :class: sphx-glr-download-link-note