Skip to content

Commit

Permalink
docs: switch to myst-nb for notebook building in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjholland committed Mar 2, 2025
1 parent bacb659 commit 05e2e12
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 132 deletions.
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ build:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv venv
build:
html:
- uv run --all-extras sphinx-build -T -b html docs/source $READTHEDOCS_OUTPUT/html
Expand Down
12 changes: 3 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
"sphinx_tabs.tabs",
"sphinxcontrib.bibtex",
"sphinx_design",
"nbsphinx",
"myst_nb",
"sphinx.ext.autosummary",
]

autosummary_generate = True # Turn on sphinx.ext.autosummary

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "pydata_sphinx_theme"
Expand All @@ -51,11 +53,3 @@
bibtex_footbibliography_header = """.. rubric:: References"""
bibtex_reference_style = "author_year"
bibtex_tooltips = True

# -- nbsphinx configuration --------------------------------------------------
autosummary_generate = True
nbsphinx_execute = "always" # Always execute notebooks
nbsphinx_allow_errors = True # Raise exceptions when notebooks raise errors


autosummary_generate = True # Turn on sphinx.ext.autosummary
4 changes: 2 additions & 2 deletions docs/source/examples/comparing-pyprobe-performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@
"pygments_lexer": "ipython3",
"version": "3.12.3"
},
"nbsphinx": {
"execute": "never"
"mystnb": {
"execution_mode": "off"
}
},
"nbformat": 4,
Expand Down
1 change: 0 additions & 1 deletion docs/source/examples/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Examples
working-with-pybamm-models
analysing-GITT-data
differentiating-voltage-data
comparing-pyprobe-performance
ocv-fitting
providing-valid-inputs

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ dev = [
"pytest-xdist>=3.6.1",
]
docs = [
"nbsphinx>=0.9.6",
"myst-nb>=1.2.0",
"pydata-sphinx-theme>=0.16.1",
"sphinx>=8.1.3",
"sphinx>=7.2.6",
"sphinx-design>=0.6.1",
"sphinx-tabs>=3.4.7",
"sphinxcontrib-bibtex>=2.6.3",
Expand Down
Loading

0 comments on commit 05e2e12

Please sign in to comment.