Skip to content

Commit a3932b4

Browse files
committed
addressing comments
1 parent 38d8632 commit a3932b4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

jupyter_sphinx/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@
3939
def skip(self, node):
4040
raise docutils.nodes.SkipNode
4141

42+
4243
# Used for nodes that should be gone by rendering time (OutputMimeBundleNode)
4344
def halt(self, node):
44-
raise ExtensionError((f"Rendering encountered a node type that should "
45-
"have been removed before rendering: {type(node)}"))
45+
raise ExtensionError(
46+
(
47+
"Rendering encountered a node type that should "
48+
"have been removed before rendering: %s" % type(node)
49+
)
50+
)
51+
4652

4753
# Renders the children of a container
4854
render_container = (

jupyter_sphinx/ast.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,22 +442,24 @@ def apply(self):
442442
# Image collect extra nodes from cell outputs that we need to process
443443
for node in self.document.traverse(image):
444444
# If the image node has `candidates` then it's already been processed
445-
# as in-line markdown, so skip it
445+
# as in-line content, so skip it
446446
if "candidates" in node:
447447
continue
448+
# re-initialize an ImageCollector because the `app` imagecollector instance
449+
# is only available via event listeners.
448450
col = ImageCollector()
449451
col.process_doc(self.app, node)
450452

451453

452454
def _return_first_node_type(node, node_type):
453455
found_nodes = list(node.traverse(node_type))
454456
if len(found_nodes) == 0:
455-
raise ValueError(f"Found no nodes of type {node_type} in node {node}")
457+
raise ValueError("Found no nodes of type %s in node %s" % (node_type, node))
456458
if len(found_nodes) > 1:
457459
raise ValueError(
458460
(
459-
f"Found more than one nodes of type {node_type} in node {node}. "
460-
"only return the first instance"
461+
"Found more than one nodes of type %s in node %s."
462+
"only return the first instance" % (node_type, node)
461463
)
462464
)
463465
return found_nodes[0]

0 commit comments

Comments
 (0)