34
34
# are we running circle CI?
35
35
CIRCLECI = 'CIRCLECI' in os .environ
36
36
37
+ # shortcuts: subdirectories to not build. Should be relative
38
+ # to the doc directory. Note that you cannot skip "users"
39
+ # but can skip subdirectories...
40
+ #
41
+ # Note if any of the sphinx-galleries are skipped then they
42
+ # will not be built using sphinx-gallery.
43
+ skip_subdirs = []
44
+ if False :
45
+ skip_subdirs = ['users/prev_whats_new/*' ,
46
+ 'gallery/*' ,
47
+ 'api/*' ,
48
+ 'tutorials/*' ,
49
+ 'plot_types/*' ,
50
+ 'devel/*' ]
51
+
37
52
# Parse year using SOURCE_DATE_EPOCH, falling back to current time.
38
53
# https://reproducible-builds.org/specs/source-date-epoch/
39
54
sourceyear = datetime .utcfromtimestamp (
80
95
]
81
96
82
97
exclude_patterns = [
83
- 'api/prev_api_changes/api_changes_*/*' ,
98
+ 'api/prev_api_changes/api_changes_*/*'
84
99
]
85
100
101
+ exclude_patterns += skip_subdirs
86
102
87
103
def _check_dependencies ():
88
104
names = {
@@ -157,7 +173,6 @@ def _check_dependencies():
157
173
'xarray' : ('https://docs.xarray.dev/en/stable/' , None ),
158
174
}
159
175
160
-
161
176
# Sphinx gallery configuration
162
177
163
178
def matplotlib_reduced_latex_scraper (block , block_vars , gallery_conf ,
@@ -174,13 +189,20 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
174
189
gallery_conf ['image_srcset' ] = []
175
190
return matplotlib_scraper (block , block_vars , gallery_conf , ** kwargs )
176
191
192
+ example_dirs = []
193
+ if 'gallery/*' not in skip_subdirs :
194
+ example_dirs += ['../examples' ]
195
+ if 'tutorials/*' not in skip_subdirs :
196
+ example_dirs += ['../tutorials' ]
197
+ if 'plot_types/*' not in skip_subdirs :
198
+ example_dirs += ['../plot_types' ]
177
199
178
200
sphinx_gallery_conf = {
179
201
'backreferences_dir' : Path ('api' ) / Path ('_as_gen' ),
180
202
# Compression is a significant effort that we skip for local and CI builds.
181
203
'compress_images' : ('thumbnails' , 'images' ) if is_release_build else (),
182
204
'doc_module' : ('matplotlib' , 'mpl_toolkits' ),
183
- 'examples_dirs' : [ '../examples' , '../tutorials' , '../plot_types' ] ,
205
+ 'examples_dirs' : example_dirs ,
184
206
'filename_pattern' : '^((?!sgskip).)*$' ,
185
207
'gallery_dirs' : ['gallery' , 'tutorials' , 'plot_types' ],
186
208
'image_scrapers' : (matplotlib_reduced_latex_scraper , ),
0 commit comments