Skip to content

Commit fbcfea4

Browse files
authored
Merge pull request #22405 from jklymak/doc-fix-gallery-keywords
DOC: put the gallery keywords in the meta tag
2 parents 59c8a87 + a3efa08 commit fbcfea4

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

doc/conf.py

+21-6
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,30 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
198198
mathmpl_fontsize = 11.0
199199
mathmpl_srcset = ['2x']
200200

201-
# Monkey-patching gallery signature to include search keywords
202-
gen_rst.SPHX_GLR_SIG = """\n
201+
# Monkey-patching gallery header to include search keywords
202+
gen_rst.EXAMPLE_HEADER = """
203+
.. DO NOT EDIT.
204+
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
205+
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
206+
.. "{0}"
207+
.. LINE NUMBERS ARE GIVEN BELOW.
208+
203209
.. only:: html
204210
205-
.. rst-class:: sphx-glr-signature
211+
.. meta::
212+
:keywords: codex
213+
214+
.. note::
215+
:class: sphx-glr-download-link-note
216+
217+
Click :ref:`here <sphx_glr_download_{1}>`
218+
to download the full example code{2}
206219
207-
Keywords: matplotlib code example, codex, python plot, pyplot
208-
`Gallery generated by Sphinx-Gallery
209-
<https://sphinx-gallery.readthedocs.io>`_\n"""
220+
.. rst-class:: sphx-glr-example-title
221+
222+
.. _sphx_glr_{1}:
223+
224+
"""
210225

211226
# Add any paths that contain templates here, relative to this directory.
212227
templates_path = ['_templates']

0 commit comments

Comments
 (0)