Skip to content

Commit

Permalink
inline widget state into HTML
Browse files Browse the repository at this point in the history
The ipywidget embedding library only takes the contents of the
script tag; it won't load from a URL in the 'src' attribute.
  • Loading branch information
jbweston committed Oct 19, 2018
1 parent 852d6f3 commit a5a498a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jupyter_sphinx/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,9 @@ def apply(self):
# XXX: Can we specify a javascript node directly, rather than
# a 'raw' node of 'html' format?
doctree.append(docutils.nodes.raw(
text='<script type="{}" src="{}"></script>'
.format(WIDGET_STATE_MIMETYPE, filename),
text='<script type="{}">{}</script>'
.format(WIDGET_STATE_MIMETYPE,
json.dumps(get_widgets(notebook))),
format='html',
))

Expand Down

0 comments on commit a5a498a

Please sign in to comment.