Skip to content

Commit cd119b3

Browse files
Comment on placeholder cells
1 parent c81651a commit cd119b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jupyter_sphinx/execute.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def apply(self):
147147
kernel_name = default_kernel
148148
file_name = next(default_names)
149149

150+
# Add empty placeholder cells for non-executed nodes so nodes and cells can be zipped
151+
# and the provided input/output can be inserted later
150152
notebook = execute_cells(
151153
kernel_name,
152154
[nbformat.v4.new_code_cell(node.astext() if node["execute"] else "") for node in nodes],
@@ -185,6 +187,7 @@ def apply(self):
185187
"Cell printed to stderr:\n{}".format(stderr[0]["text"])
186188
)
187189

190+
# Insert input/output into placeholders for non-executed cells
188191
for node, cell in zip(nodes, notebook.cells):
189192
if not node["execute"]:
190193
cell.source = node.children[0].astext()

0 commit comments

Comments
 (0)