Skip to content

Commit 780902b

Browse files
hugokerstensjbweston
authored andcommitted
Only add thebe button when there are thebe cells
1 parent 3c29e02 commit 780902b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jupyter_sphinx/execute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ def apply(self):
304304
if not doctree.traverse(JupyterCellNode):
305305
return
306306

307-
if thebe_config:
307+
any_thebelab = any(not cell['no_thebelab'] for cell in doctree.traverse(JupyterCellNode))
308+
if thebe_config and any_thebelab:
308309
# Add the button at the bottom if it is not present
309310
if not doctree.traverse(ThebeButtonNode):
310311
doctree.append(ThebeButtonNode())

0 commit comments

Comments
 (0)