@@ -52,45 +52,6 @@ def linkcheck():
52
52
[sys .executable ]
53
53
+ '-msphinx -b linkcheck -d build/doctrees . build/linkcheck' .split ())
54
54
55
-
56
- # For generating PNGs of the top row of index.html:
57
- FRONTPAGE_PY_PATH = "../examples/frontpage/" # python scripts location
58
- FRONTPAGE_PNG_PATH = "_static/" # png files location
59
- # png files and corresponding generation scripts:
60
- FRONTPAGE_PNGS = {"surface3d_frontpage.png" : "3D.py" ,
61
- "contour_frontpage.png" : "contour.py" ,
62
- "histogram_frontpage.png" : "histogram.py" ,
63
- "membrane_frontpage.png" : "membrane.py" }
64
-
65
-
66
- def generate_frontpage_pngs (only_if_needed = True ):
67
- """Executes the scripts for PNG generation of the top row of index.html.
68
-
69
- If `only_if_needed` is `True`, then the PNG file is only generated, if it
70
- doesn't exist or if the python file is newer.
71
-
72
- Note that the element `div.responsive_screenshots` in the file
73
- `_static/mpl.css` has the height and cumulative width of the used PNG files
74
- as attributes. This ensures that the magnification of those PNGs is <= 1.
75
- """
76
- for fn_png , fn_py in FRONTPAGE_PNGS .items ():
77
- pn_png = os .path .join (FRONTPAGE_PNG_PATH , fn_png ) # get full paths
78
- pn_py = os .path .join (FRONTPAGE_PY_PATH , fn_py )
79
-
80
- # Read file modification times:
81
- mtime_py = os .path .getmtime (pn_py )
82
- mtime_png = (os .path .getmtime (pn_png ) if os .path .exists (pn_png ) else
83
- mtime_py - 1 ) # set older time, if file doesn't exist
84
-
85
- if only_if_needed and mtime_py <= mtime_png :
86
- continue # do nothing if png is newer
87
-
88
- # Execute python as subprocess (preferred over os.system()):
89
- subprocess .check_call (
90
- [sys .executable , pn_py ]) # raises CalledProcessError()
91
- os .rename (fn_png , pn_png ) # move file to _static/ directory
92
-
93
-
94
55
DEPSY_PATH = "_static/depsy_badge.svg"
95
56
DEPSY_URL = "http://depsy.org/api/package/pypi/matplotlib/badge.svg"
96
57
DEPSY_DEFAULT = "_static/depsy_badge_default.svg"
@@ -121,7 +82,6 @@ def fetch_depsy_badge():
121
82
def html (buildername = 'html' ):
122
83
"""Build Sphinx 'html' target. """
123
84
check_build ()
124
- generate_frontpage_pngs ()
125
85
fetch_depsy_badge ()
126
86
127
87
rc = '../lib/matplotlib/mpl-data/matplotlibrc'
@@ -213,10 +173,6 @@ def clean():
213
173
for filename in glob .glob (pattern ):
214
174
if os .path .exists (filename ):
215
175
os .remove (filename )
216
- for fn in FRONTPAGE_PNGS .keys (): # remove generated PNGs
217
- pn = os .path .join (FRONTPAGE_PNG_PATH , fn )
218
- if os .path .exists (pn ):
219
- os .remove (os .path .join (pn ))
220
176
221
177
222
178
def build_all ():
0 commit comments