Skip to content

DOC: put the gallery keywords in the meta tag #22405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: codex

.. note::
:class: sphx-glr-download-link-note

Click :ref:`here <sphx_glr_download_{1}>`
to download the full example code{2}

Keywords: matplotlib code example, codex, python plot, pyplot
`Gallery generated by Sphinx-Gallery
<https://sphinx-gallery.readthedocs.io>`_\n"""
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_{1}:

"""

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