Skip to content

Commit

Permalink
Merge pull request #501 from mariobuikhuizen/fix_template_title
Browse files Browse the repository at this point in the history
fix: the default title in the template is always Notebook
  • Loading branch information
maartenbreddels authored Jan 29, 2020
2 parents 3b06c0b + 3cefe67 commit 8557d9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/app/execute_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_hello_world(http_client, base_url):
assert response.code == 200
html_text = response.body.decode('utf-8')
assert 'Hi Voila' in html_text
assert 'print' not in html_text, 'by default the source code should be stripped'
assert 'print(' not in html_text, 'by default the source code should be stripped'
assert 'test_template.css' not in html_text, "test_template should not be the default"


Expand Down
2 changes: 1 addition & 1 deletion tests/server/execute_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ def test_hello_world(http_client, print_notebook_url):
assert response.code == 200
html_text = response.body.decode('utf-8')
assert 'Hi Voila' in html_text
assert 'print' not in html_text, 'by default the source code should be stripped'
assert 'print(' not in html_text, 'by default the source code should be stripped'
assert 'test_template.css' not in html_text, "test_template should not be the default"
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 8557d9d

Please sign in to comment.