Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af0a727

Browse files
tacaswellMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #11169: DOC: Reactivate search for codex
1 parent 136e7d8 commit af0a727

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
@@ -1002,7 +1002,7 @@ div.sphx-glr-download a {
10021002
background-image: none !important;
10031003
}
10041004

1005-
p.sphx-glr-signature a.reference.external {
1005+
p.sphx-glr-signature {
10061006
display: none !important;
10071007
}
10081008

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)