'make html' does not attempt to run examples
See original GitHub issueI’m trying to get started with sphinx-gallery. As far as I can tell I followed the instructions exactly. The issue is that sphinx does not even try to execute the example scripts, so no previews or images are being generated.
$ LC_ALL=C make html
Running Sphinx v1.8.1
loading pickled environment... done
generating gallery...
generating gallery for gallery... [100%] project.py
computation time summary:
- test.py: 0 sec
- project.py: 0 sec
- dos.py: 0 sec
- bz_plot.py: 0 sec
- band_plot.py: 0 sec
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 6 source files that are out of date
updating environment: [] 0 added, 6 changed, 0 removed
reading sources... [100%] gallery/test
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex
writing additional pages... search
copying images... [100%] gallery/images/thumb/sphx_glr_project_thumb.png
copying downloadable files... [100%] gallery/test.ipynb
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded.
The HTML pages are in _build/html.
embedding documentation hyperlinks...
embedding documentation hyperlinks for gallery... [100%] bz_plot.html
This generates all the galleries, code snippets, etc. just fine, but as you can see from the zero-second computation time, the example scripts aren’t touched. I can literally add a raise Exception
at the start of an example file and nothing will change.
The relevant parts of my conf.py
:
extensions = [
'sphinx_gallery.gen_gallery',
]
sphinx_gallery_conf = {
'examples_dirs': '../examples',
'gallery_dirs': 'gallery',
}
The versions I’m running are
Sphinx==1.8.1
sphinx-gallery==0.2.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Does Sphinx run my code on executing 'make html'?
When using autodoc, Sphinx imports the documented modules, so all module-level code is executed. This happens every time you do "make html".
Read more >Handling common HTML and CSS problems - MDN Web Docs
We said in the first article of this series that a good strategy to begin with is to test in a couple of...
Read more >HTML Editors - W3Schools
A simple text editor is all you need to learn HTML. Learn HTML Using Notepad or TextEdit. Web pages can be created and...
Read more >How To Build a Website with HTML | DigitalOcean
To explore HTML in practice and begin building an HTML website, we'll need to set up a new project using a text editor....
Read more >GNU make
GNU make. This file documents the GNU make utility, which determines automatically which pieces of a large program need to be recompiled, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
by default, SG will only run examples that begin with
plot_
…is that true in your case? I’ve been burned by this before…@mueslo agreed - we should definitely do this.
Actually, maybe a controversial statement, but I’d think that it’s more important to use a regex to define examples to skip rather than examples to plot. Wouldn’t most people assume what @mueslo did, which is that SG will by default run all of the examples in a folder that you specify?
(as one personal data point, most of the projects I work with that use Sphinx-Gallery ended up defining a regex to match everything that doesn’t have something like “noplot” in it)