forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport PR matplotlib#28103: [DOC]: Fix compatibility with sphinx-ga…
…llery 0.16
- Loading branch information
1 parent
26979f7
commit 29e77e3
Showing
5 changed files
with
48 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import sys | ||
|
||
|
||
def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, | ||
**kwargs): | ||
""" | ||
Reduce srcset when creating a PDF. | ||
Because sphinx-gallery runs *very* early, we cannot modify this even in the | ||
earliest builder-inited signal. Thus we do it at scraping time. | ||
""" | ||
from sphinx_gallery.scrapers import matplotlib_scraper | ||
|
||
if gallery_conf['builder_name'] == 'latex': | ||
gallery_conf['image_srcset'] = [] | ||
return matplotlib_scraper(block, block_vars, gallery_conf, **kwargs) | ||
|
||
|
||
# Clear basic_units module to re-register with unit registry on import. | ||
def clear_basic_units(gallery_conf, fname): | ||
return sys.modules.pop('basic_units', None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters