Skip to content

Commit 26fb81a

Browse files
committed
remove widget views for non-html builds
1 parent 163af0c commit 26fb81a

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

jupyter_sphinx/execute.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ def html(self):
208208
return ipywidgets.embed.widget_view_template.format(
209209
view_spec=json.dumps(self['view_spec']))
210210

211-
def text(self):
212-
return '[ widget ]'
213-
214211

215212
class JupyterWidgetStateNode(docutils.nodes.Element):
216213
"""Appended to doctree if any Jupyter cell produced a widget as output.
@@ -625,17 +622,13 @@ def visit_widget_html(self, node):
625622
self.body.append(node.html())
626623
raise docutils.nodes.SkipNode
627624

628-
def visit_widget_text(self, node):
629-
self.body.append(node.text())
630-
raise docutils.nodes.SkipNode
631-
632625
app.add_node(
633626
JupyterWidgetViewNode,
634627
html=(visit_widget_html, None),
635-
latex=(visit_widget_text, None),
636-
textinfo=(visit_widget_text, None),
637-
text=(visit_widget_text, None),
638-
man=(visit_widget_text, None),
628+
latex=(skip, None),
629+
textinfo=(skip, None),
630+
text=(skip, None),
631+
man=(skip, None),
639632
)
640633
# JupyterWidgetStateNode holds the widget state JSON,
641634
# but is only rendered in HTML documents.

0 commit comments

Comments
 (0)