Skip to content

Commit

Permalink
Use "title" instead of "name" for metadata to match the notebook format
Browse files Browse the repository at this point in the history
  • Loading branch information
m-rossi committed Nov 11, 2017
1 parent 4abde40 commit 08aa66f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions nbconvert/exporters/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def from_filename(self, filename, resources=None, **kw):
resources['metadata'] = ResourcesDict()
path, basename = os.path.split(filename)
notebook_name = basename[:basename.rfind('.')]
resources['metadata']['name'] = notebook_name
resources['metadata']['title'] = notebook_name
resources['metadata']['path'] = path

modified_date = datetime.datetime.fromtimestamp(os.path.getmtime(filename))
Expand Down Expand Up @@ -277,8 +277,8 @@ def _init_resources(self, resources):
resources['metadata'] = new_metadata
else:
resources['metadata'] = ResourcesDict()
if not resources['metadata']['name']:
resources['metadata']['name'] = 'Notebook'
if not resources['metadata']['title']:
resources['metadata']['title'] = 'Notebook'

#Set the output extension
resources['output_extension'] = self.file_extension
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/templates/html/full.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<head>
{%- block html_head -%}
<meta charset="utf-8" />
<title>{{resources['metadata']['name']}}</title>
<title>{{resources['metadata']['title']}}</title>

{%- if "widgets" in nb.metadata -%}
<script src="https://unpkg.com/jupyter-js-widgets@2.0.*/dist/embed.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/templates/html/slides_reveal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

<title>{{resources['metadata']['name']}} slides</title>
<title>{{resources['metadata']['title']}} slides</title>

<script src="{{resources.reveal.require_js_url}}"></script>
<script src="{{resources.reveal.jquery_url}}"></script>
Expand Down

0 comments on commit 08aa66f

Please sign in to comment.