Skip to content

Commit

Permalink
fix: the default title in the template is always Notebook
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mariobuikhuizen authored and maartenbreddels committed Feb 29, 2020
1 parent 3b06c0b commit 1913453
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion voila/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ async def get(self, path=None):
return
self.cwd = os.path.dirname(notebook_path)

path, basename = os.path.split(notebook_path)
notebook_name = os.path.splitext(basename)[0]

# render notebook to html
resources = {
'base_url': self.base_url,
'nbextensions': nbextensions,
'theme': self.voila_configuration.theme
'theme': self.voila_configuration.theme,
'metadata': {
'name': notebook_name
}
}

# include potential extra resources
Expand Down

0 comments on commit 1913453

Please sign in to comment.