@@ -201,8 +201,8 @@ class JupyterWidgetViewNode(docutils.nodes.Element):
201
201
outputs this doctree node is rendered generically.
202
202
"""
203
203
204
- def __init__ (self , view_spec ):
205
- super ().__init__ ('' , view_spec = view_spec )
204
+ def __init__ (self , rawsource = '' , * children , ** attributes ):
205
+ super ().__init__ ('' , view_spec = attributes [ ' view_spec' ] )
206
206
207
207
def html (self ):
208
208
return ipywidgets .embed .widget_view_template .format (
@@ -223,8 +223,8 @@ class JupyterWidgetStateNode(docutils.nodes.Element):
223
223
from all script tags on the page of the correct mimetype.
224
224
"""
225
225
226
- def __init__ (self , state ):
227
- super ().__init__ ('' , state = state )
226
+ def __init__ (self , rawsource = '' , * children , ** attributes ):
227
+ super ().__init__ ('' , state = attributes [ ' state' ] )
228
228
229
229
def html (self ):
230
230
# TODO: render into a separate file if 'html-manager' starts fully
@@ -323,7 +323,7 @@ def apply(self):
323
323
attach_outputs (output_nodes , node )
324
324
325
325
if contains_widgets (notebook ):
326
- doctree .append (JupyterWidgetStateNode (get_widgets (notebook )))
326
+ doctree .append (JupyterWidgetStateNode (state = get_widgets (notebook )))
327
327
328
328
329
329
### Roles
@@ -448,7 +448,7 @@ def cell_output_to_nodes(cell, data_priority, dir):
448
448
format = 'html' ,
449
449
))
450
450
elif mime_type == WIDGET_VIEW_MIMETYPE :
451
- to_add .append (JupyterWidgetViewNode (data ))
451
+ to_add .append (JupyterWidgetViewNode (view_spec = data ))
452
452
453
453
return to_add
454
454
0 commit comments