Skip to content

Commit 44a2323

Browse files
committed
more comments
1 parent a3932b4 commit 44a2323

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jupyter_sphinx/ast.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ def attach_outputs(output_nodes, node, thebe_config, cm_language):
363363
if not node.attributes["hide_code"]: # only add css if code is displayed
364364
node.attributes["classes"] = ["jupyter_container"]
365365

366-
input_node = _return_first_node_type(node, CellInputNode)
367-
outputbundle_node = _return_first_node_type(node, CellOutputBundleNode)
366+
input_node = _find_only_child_by_type(node, CellInputNode)
367+
outputbundle_node = _find_only_child_by_type(node, CellOutputBundleNode)
368368
output_node = CellOutputNode(classes=["cell_output"])
369369
if thebe_config:
370370
# Move the source from the input node into the thebe_source node
@@ -425,7 +425,7 @@ def apply(self):
425425
thebe_config = self.config.jupyter_sphinx_thebelab_config
426426

427427
for cell_node in self.document.traverse(JupyterCellNode):
428-
output_bundle_node = _return_first_node_type(
428+
output_bundle_node = _find_only_child_by_type(
429429
cell_node, CellOutputBundleNode
430430
)
431431
# Create doctree nodes for cell outputs.
@@ -451,7 +451,7 @@ def apply(self):
451451
col.process_doc(self.app, node)
452452

453453

454-
def _return_first_node_type(node, node_type):
454+
def _find_only_child_by_type(node, node_type):
455455
found_nodes = list(node.traverse(node_type))
456456
if len(found_nodes) == 0:
457457
raise ValueError("Found no nodes of type %s in node %s" % (node_type, node))

jupyter_sphinx/css/jupyter-sphinx.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ div.jupyter_container {
5858
div.jupyter_container div.highlight {
5959
background-color: #f7f7f7; /* for haiku */
6060
}
61-
div.jupyter_container * {
61+
div.jupyter_container {
6262
padding: 0;
6363
margin: 0;
6464
}

0 commit comments

Comments
 (0)