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

fix: the default title in the template is always Notebook #501

Merged

Conversation

mariobuikhuizen
Copy link
Member

The property used as a fallback for the title of the template is
not initialized by Voila. Following nbconvert, in which this
property is set to the filename of the notebook [1], this commit
now does the same.

Related to: voila-dashboards/voila-vuetify#25

[1] https://github.com/jupyter/nbconvert/blob/6c6e5fa0c757169017fd325fad98efa8d4a368ea/nbconvert/exporters/exporter.py#L172

The property used as a fallback for the title of the template is
not initialized by Voila. Following nbconvert, in which this
property is set to the filename of the notebook [1], this commit
now does the same.

Related to: voila-dashboards/voila-vuetify#25

[1] https://github.com/jupyter/nbconvert/blob/6c6e5fa0c757169017fd325fad98efa8d4a368ea/nbconvert/exporters/exporter.py#L172
@timkpaine
Copy link
Member

This means you can no longer override the name?

@mariobuikhuizen
Copy link
Member Author

If title is set in the notebook metadata, that is used.

{% set nb_title = nb.metadata.get('title', '') or resources['metadata']['name'] %}

@timkpaine
Copy link
Member

I think we were setting it in resources, which this now clobbers

@maartenbreddels
Copy link
Member

This breaks our tests, I'll fix that after the weekend.

@timkpaine
Copy link
Member

Yeah so extra resources should take precedence still https://github.com/voila-dashboards/voila/blob/master/voila/handler.py#L70

So this is backwards compatible

@jtpio
Copy link
Member

jtpio commented Jan 27, 2020

This looks good.

@maartenbreddels did you want to take another look? or can this be merged?

@maartenbreddels maartenbreddels merged commit 8557d9d into voila-dashboards:master Jan 29, 2020
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.

4 participants