Skip to content

Commit

Permalink
Allow overriding embed_url for python embed code
Browse files Browse the repository at this point in the history
  • Loading branch information
vidartf committed May 24, 2017
1 parent 14139db commit e174fc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ipywidgets/widgets/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def embed_snippet(widgets=None,
expand_dependencies='full',
drop_defaults=True,
indent=2,
embed_url=None,
):
"""Return a snippet that can be embedded in an HTML file. """

Expand All @@ -193,9 +194,12 @@ def embed_snippet(widgets=None,
for view_spec in data['view_specs']
)

values = {
if embed_url is None:
# TODO: Get widgets npm version automatically:
'embed_url':'https://unpkg.com/jupyter-js-widgets@~3.0.0-alpha.0/dist/embed.js',
embed_url = 'https://unpkg.com/jupyter-js-widgets@~3.0.0-alpha.0/dist/embed.js'

values = {
'embed_url': embed_url,
'json_data': json.dumps(data['manager_state'], indent=indent),
'widget_views': widget_views,
}
Expand Down

0 comments on commit e174fc5

Please sign in to comment.