Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc workflow #3

Merged
merged 14 commits into from
Oct 29, 2023
Merged
Prev Previous commit
Next Next commit
Fix build doc examples
ericpre committed Oct 29, 2023
commit 23ea7b00e548316bcbbac60cbedb9ae6d09ff48d
21 changes: 19 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -35,16 +35,21 @@
# "numpydoc",
"sphinx_design",
"sphinx_favicon",
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx_gallery.gen_gallery",
]

linkcheck_ignore = [
"https://doi.org/10.1021/acs.nanolett.5b00449", # 403 Client Error: Forbidden for url
"https://onlinelibrary.wiley.com/doi/10.1111/j.1365-2818.2006.01549.x", # 403 Client Error: Forbidden for url
# Remove when setup
"https://github.com/hyperspy/exspy-demos",
"https://www.anaconda.com/blog/understanding-conda-and-pip", # Transcient?
]

intersphinx_mapping = {
@@ -125,5 +130,17 @@
}
toc_object_entries_show_parents = "hide"

# def setup(app):
# app.add_css_file("custom-styles.css")
# -- Sphinx-Gallery---------------

# https://sphinx-gallery.github.io
sphinx_gallery_conf = {
"examples_dirs": "../examples", # path to your example scripts
"gallery_dirs": "auto_examples", # path to where to save gallery generated output
"filename_pattern": ".py", # pattern to define which will be executed
"ignore_pattern": "_sgskip.py", # pattern to define which will not be executed
}

# -- Sphinx-copybutton -----------

copybutton_prompt_text = r">>> |\.\.\. "
copybutton_prompt_is_regexp = True
6 changes: 6 additions & 0 deletions examples/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _examples-index:

Gallery of Examples
===================

Below is a gallery of examples.
2 changes: 1 addition & 1 deletion examples/model_fitting/EELS_curve_fitting.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
beam_energy=300, convergence_angle=24.6, collection_angle=13.6
)

m = s.create_model(ll=ll)
m = s.create_model(low_loss=ll)
m.enable_fine_structure()
m.multifit(kind="smart")
m.plot()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@
"sphinx-copybutton",
"sphinx-design",
"sphinx-favicon",
"sphinx-gallery",
],
"tests": [
"pytest >= 5.0",