Skip to content

Commit

Permalink
Merge pull request jupyter#487 from michaelpacer/new_mimetypes
Browse files Browse the repository at this point in the history
Fixing the widget calls, conditionally embedding the script tag
  • Loading branch information
Carreau committed Dec 13, 2016
2 parents d87a474 + 71f3965 commit 5d1287b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nbconvert/templates/html/basic.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ var element = $('#{{ div_id }}');

{%- block footer %}
{% set mimetype = 'application/vnd.jupyter.widget-state+json'%}
{% if mimetype in nb.metadata.widgets %}
{% if mimetype in nb.metadata.get("widgets",{})%}
<script type="{{ mimetype }}">
{{ nb.metadata.widgets[mimetype] | json_dumps }}
</script>
Expand Down
4 changes: 4 additions & 0 deletions nbconvert/templates/html/full.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<meta charset="utf-8" />
<title>{{resources['metadata']['name']}}</title>

{%- if "widgets" in nb.metadata -%}
<script src="https://unpkg.com/jupyter-js-widgets@2.0.*/dist/embed.js"></script>
{%- endif-%}

<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

Expand Down

0 comments on commit 5d1287b

Please sign in to comment.