Looks like pandas’ approach is to loop through the docs and exclude everything except the one you ask for. This is in the conf.py and the make.py sets the relevant environment variable. So probably could be done with our existing make files - though a python make script might remove the need for separate Windows and Linux make files?
Thanks @rcomer - something like that seems like it would be really helpful for us. I may play with it, but if anyone else w/ more sphinx experience wants to give it a shot, I think it'd be a pretty worthwhile project.
means that you can build the docs in 5 seconds or so (on my machine). The first build is still really slow because it doesn't stop sphinx-gallery from running. If you further set example_dirs to an empty list, the whole build is super fast.
So I wonder if we should just document this for folks. I definitely didn't understand how exclude_patterns works, but now that I do, I'm not sure it's worth having a bunch of hooks or environment variables we check.
Activity
jklymak commented on Jan 8, 2023
OK, I looked into this for a while. This is currently really easy to do in conf.py. After the initial gallery builds, doing
exclude_patterns = [ 'api/prev_api_changes/api_changes_*/*', 'users/prev_whats_new/*', 'gallery/*', 'api/*', 'tutorials/*', 'plot_types/*', 'devel/*' ]means that you can build the docs in 5 seconds or so (on my machine). The first build is still really slow because it doesn't stop sphinx-gallery from running. If you further set example_dirs to an empty list, the whole build is super fast.
So I wonder if we should just document this for folks. I definitely didn't understand how exclude_patterns works, but now that I do, I'm not sure it's worth having a bunch of hooks or environment variables we check.
rcomer commented on Jan 8, 2023
What happens if you use this together with the make html-noplot option?
Edit: on second thoughts your approach of modifying example_dirs is clearly better as you might want the tutorials but not the gallery and plot types.