{%- extends 'nbconvert/templates/reveal/index.html.j2' -%}
{% import "log.macro.html.j2" as log %}

{%- block html_head_js -%}
{%- block html_head_js_logs -%}
{{ log.js() }}
{%- endblock html_head_js_logs -%}
{%- block html_head_js_jquery -%}
<script src="{{ resources.jquery_url }}"></script>
{%- endblock html_head_js_jquery -%}
{%- endblock html_head_js -%}

{% block jupyter_widgets %}
    {{ resources.include_css("static/materialcolors.css") }}
    {{ resources.include_css("static/labvariables.css") }}

{% block notebook_execute %}
    {%- set kernel_id = kernel_start(nb) -%}
    <script id="jupyter-config-data" type="application/json">
    {
        "baseUrl": "{{resources.base_url}}",
        "kernelId": "{{kernel_id}}"
    }
    </script>
    {# from this point on, nb.cells contains output of the executed cells #}
    {% do notebook_execute(nb, kernel_id) %}
{%- endblock notebook_execute -%}
{% endblock jupyter_widgets %}

{% block body_header %}
<body data-base-url="{{resources.base_url}}voila/">
<div class="reveal">
<div class="slides">
{% endblock body_header %}

{% block footer_js %}
<script
    src="{{resources.base_url}}voila/static/require.min.js"
    integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA="
    crossorigin="anonymous">
</script>
<script>
requirejs.config({ baseUrl: '{{resources.base_url}}voila/', waitSeconds: 30})
requirejs(
    [
        "static/main",
    {% for ext in resources.nbextensions -%}
        "{{resources.base_url}}voila/nbextensions/{{ ext }}.js",
    {% endfor %}
    ]
)
</script>
{{ super() }}
{% endblock footer_js %}
