Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: support static widgets in Reveal.js slides #1553

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

agoose77
Copy link
Contributor

This restores the embedding of widget state in rendered notebooks using the SlidesExporter with the default reveal template. This has been implemented by adding a call to super() in the footer block, which calls the lab/base.html.j2 implementation.

I don't know whether this is the preferred style of nbconvert. Looking at base.html.j2 and index.html.j2, it seems like there is an implementation (base) vs client (index) separation. If this is the case, perhaps a more robust (although breaking) change would be to rename the footer block in base.html.j2 to something like embed_widget_state:

{%- block footer %}
{% set mimetype = 'application/vnd.jupyter.widget-state+json'%}
{% if mimetype in nb.metadata.get("widgets",{})%}
<script type="{{ mimetype }}">
{{ nb.metadata.widgets[mimetype] | json_dumps }}
</script>
{% endif %}
{{ super() }}
{%- endblock footer-%}

This restores the embedding of widget state in rendered notebooks using the `SlidesExporter` with the default `reveal` template. This has been implemented by adding a call to `super()` in the footer block, which calls the `lab/base.html.j2` implementation. 

I don't know whether this is the preferred style of nbconvert. Looking at `base.html.j2` and `index.html.j2`, it seems like there is an `implementation` (base) vs `client` (index) separation. If this is the case, perhaps a more robust (although breaking) change would be to rename the `footer` block in `base.html.j2` to something like `embed_widget_state`: https://github.com/jupyter/nbconvert/blob/e49b9a8a220c9f9f87c23764ea7b48eac4707937/share/jupyter/nbconvert/templates/lab/base.html.j2#L262-L270
@agoose77 agoose77 changed the title Feature: support static widgets in reveal slides Feature: support static widgets in Reveal.js slides Apr 15, 2021
@MSeal MSeal merged commit 3eb751f into jupyter:main Jun 7, 2021
@MSeal
Copy link
Contributor

MSeal commented Jun 7, 2021

Thanks for the improvement, and sorry no one looked at this for a while

@MSeal MSeal added this to the 6.1 milestone Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants