Skip to content

Commit cec4b5c

Browse files
committed
Add possibility to ignore Python files
1 parent fb40c27 commit cec4b5c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CONTRIBUTING.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ files. If your example needs such data files, there are a few options available:
4949
- if the data files are small (few 10s of Kb) you may also include them in a
5050
``data/`` folder within the example folder. A zip file will be generated that
5151
can be downloaded from the example page.
52+
- for a Python file that should not be rendered you can save it with a leading
53+
underscore, e.g. ``_my_script.py``.
5254

5355
.. _sphinx-gallery: https://sphinx-gallery.github.io/
5456
.. _RestructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

src/generate-gallery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def __init__(self, example):
3838
self.config.default_role = ""
3939
self.config.sphinx_gallery_conf = {
4040
"filename_pattern": ".*",
41+
"ignore_pattern": r"^_.*\.py$",
4142
"examples_dirs": os.path.join(ROOT, example),
4243
"gallery_dirs": gallery_dir,
4344
"write_computation_times": False,

0 commit comments

Comments
 (0)