@@ -208,8 +208,6 @@ def _check_dependencies():
208208else :
209209 sg_matplotlib_animations = True
210210
211- # The following import is only necessary to monkey patch the signature later on
212- from sphinx_gallery import gen_rst
213211
214212# Prevent plt.show() from emitting a non-GUI backend warning.
215213warnings .filterwarnings ('ignore' , category = UserWarning ,
@@ -307,7 +305,7 @@ def autodoc_process_bases(app, name, obj, options, bases):
307305 'reference_url' : {'matplotlib' : None , 'mpl_toolkits' : None },
308306 'prefer_full_module' : {r'mpl_toolkits\.' },
309307 'remove_config_comments' : True ,
310- 'reset_modules' : ('matplotlib' , clear_basic_units ),
308+ 'reset_modules' : ('matplotlib' , clear_basic_units , 'sphinxext.util.patch_header' ),
311309 'subsection_order' : gallery_order_sectionorder ,
312310 'thumbnail_size' : (320 , 224 ),
313311 'within_subsection_order' : gallery_order_subsectionorder ,
@@ -355,31 +353,6 @@ def gallery_image_warning_filter(record):
355353mathmpl_fontsize = 11.0
356354mathmpl_srcset = ['2x' ]
357355
358- # Monkey-patching gallery header to include search keywords
359- gen_rst .EXAMPLE_HEADER = """
360- .. DO NOT EDIT.
361- .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
362- .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
363- .. "{0}"
364- .. LINE NUMBERS ARE GIVEN BELOW.
365-
366- .. only:: html
367-
368- .. meta::
369- :keywords: codex
370-
371- .. note::
372- :class: sphx-glr-download-link-note
373-
374- :ref:`Go to the end <sphx_glr_download_{1}>`
375- to download the full example code{2}
376-
377- .. rst-class:: sphx-glr-example-title
378-
379- .. _sphx_glr_{1}:
380-
381- """
382-
383356# Add any paths that contain templates here, relative to this directory.
384357templates_path = ['_templates' ]
385358
0 commit comments