Skip to content

Commit 807aba2

Browse files
committed
fix ReadTheDocs: replace notebook symlink with copy and pin Sphinx <9
The notebook images were broken because docs/source/notebooks is a symlink to ../../notebooks. nbsphinx extracts images to _build/doctrees/ and references them with relative paths, but the symlink causes those paths to resolve from the wrong directory (see nbsphinx issue #49). Fix by adding a pre_build job that replaces the symlink with a real copy. Also pin sphinx>=8.0,<9 since nbsphinx 0.9.8 only re-enabled 8.2+ support and Sphinx 9 is untested.
1 parent 10f7417 commit 807aba2

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ sphinx-autodocgen
44
sphinx-github-style>=1.2.2
55
sphinx-mdinclude
66
m2r2
7-
nbsphinx
7+
nbsphinx>=0.9.8
8+
sphinx>=8.0,<9
89
furo
910
typing-extensions
1011
IPython

readthedocs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ build:
66
python: "3.11"
77
apt_packages:
88
- pandoc
9+
jobs:
10+
pre_build:
11+
- rm docs/source/notebooks
12+
- cp -r notebooks docs/source/notebooks
913

1014
sphinx:
1115
configuration: docs/source/conf.py

0 commit comments

Comments
 (0)