8000 Merge pull request #11175 from matplotlib/auto-backport-of-pr-11169 · matplotlib/matplotlib@a2a908f · GitHub
[go: up one dir, main page]

Skip to content

Commit a2a908f

Browse files
authored
Merge pull request #11175 from matplotlib/auto-backport-of-pr-11169
Backport PR #11169 on branch v2.2.2-doc
2 parents 5a83e8f + af0a727 commit a2a908f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

doc/_static/mpl.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ div.sphx-glr-download a {
983983
background-image: none !important;
984984
}
985985

986-
p.sphx-glr-signature a.reference.external {
986+
p.sphx-glr-signature {
987987
display: none !important;
988988
}
989989

doc/conf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import six
1919
from glob import glob
2020

21+
# This is only necessary to monkey patch the signature later on.
22+
from sphinx_gallery import gen_rst
23+
2124
# If your extensions are in another directory, add it here. If the directory
2225
# is relative to the documentation root, use os.path.abspath to make it
2326
# absolute, like shown here.
@@ -139,6 +142,16 @@ def _check_deps():
139142

140143
plot_gallery = 'True'
141144

145+
# Monkey-patching gallery signature to include search keywords
146+
gen_rst.SPHX_GLR_SIG = """\n
147+
.. only:: html
148+
149+
.. rst-class:: sphx-glr-signature
150+
151+
Keywords: matplotlib code example, codex, python plot, pyplot
152+
`Gallery generated by Sphinx-Gallery
153+
<https://sphinx-gallery.readthedocs.io>`_\n"""
154+
142155
# Add any paths that contain templates here, relative to this directory.
143156
templates_path = ['_templates']
144157

0 commit comments

Comments
 (0)
0