Skip to content

Commit 5351d95

Browse files
committed
Examples: Clean up example scripts for building documentation
1 parent 843a222 commit 5351d95

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

doc/conf.py

+13
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"sphinx.ext.mathjax",
4747
"sphinx.ext.napoleon",
4848
"sphinx_design",
49+
"sphinx_gallery.gen_gallery",
4950
]
5051

5152
# Create links to references within diffsims' documentation to these packages
@@ -162,3 +163,15 @@ def linkcode_resolve(domain, info):
162163
autodoc_default_options = {
163164
"show-inheritance": True,
164165
}
166+
167+
# -- Sphinx-Gallery---------------
168+
# https://sphinx-gallery.github.io
169+
sphinx_gallery_conf = {
170+
"backreferences_dir": "reference/generated",
171+
"doc_module": ("diffsims",),
172+
"examples_dirs": "../examples", # path to your example scripts
173+
"gallery_dirs": "examples", # path to where to save gallery generated output
174+
"filename_pattern": "^((?!sgskip).)*$", # pattern to define which will be executed
175+
"ignore_pattern": "_sgskip.py", # pattern to define which will not be executed
176+
"reference_url": {"diffsims": None},
177+
}

doc/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ diffsims is an open-source Python library for simulating diffraction.
1212
reference/index.rst
1313
dev/index.rst
1414
changelog.rst
15+
Examples <examples/index>
16+
1517

1618
Installation
1719
============

examples/README.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _examples-index:
2+
3+
Gallery of Examples
4+
===================
5+
6+
Below is a gallery of examples for different operations in diffsims.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _examples-index:
2+
3+
Simulation Library
4+
==================
5+
6+
These examples show specific workflows for creating a library of simulations

examples/creating_a_simulation_library/simulating_diffraction_patterns.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
=====================================================
3-
Simulating One Diffraction Pattern for a Single Phase
3+
Simulating One Diffraction Pattern for a Single Phase
44
=====================================================
55
"""
66

0 commit comments

Comments
 (0)