Skip to content

Commit

Permalink
Merge pull request #58 from damianavila/fix_slideshow_key
Browse files Browse the repository at this point in the history
Fix missing slideshow key.
  • Loading branch information
minrk committed Jul 12, 2015
2 parents 74e5891 + fdaee98 commit e2c347c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nbconvert/preprocessors/revealhelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def preprocess(self, nb, resources):
# We need to break the loop when a new slide or subslide is
# found to avoid the propagation of the data-fragment-index
# across multiple slides/subslides
if nb.cells[index + i].metadata.slideshow.slide_type in ['slide', 'subslide']:
if nb.cells[index + i].metadata.slide_type in ['slide', 'subslide']:
break
else:
nb.cells[index + i].metadata.frag_helper = 'fragment_end'
Expand Down
5 changes: 4 additions & 1 deletion nbconvert/preprocessors/tests/test_revealhelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ def build_notebook(self):

slide_metadata = {'slideshow' : {'slide_type': 'slide'}}
subslide_metadata = {'slideshow' : {'slide_type': 'subslide'}}
fragment_metadata = {'slideshow' : {'slide_type': 'fragment'}}

cells=[nbformat.new_code_cell(source="", execution_count=1, outputs=outputs),
nbformat.new_markdown_cell(source="", metadata=slide_metadata),
nbformat.new_code_cell(source="", execution_count=2, outputs=outputs),
nbformat.new_markdown_cell(source="", metadata=slide_metadata),
nbformat.new_markdown_cell(source="", metadata=subslide_metadata)]
nbformat.new_markdown_cell(source="", metadata=subslide_metadata),
nbformat.new_markdown_cell(source="", metadata=fragment_metadata),
nbformat.new_code_cell(source="", execution_count=1, outputs=outputs)]

return nbformat.new_notebook(cells=cells)

Expand Down

0 comments on commit e2c347c

Please sign in to comment.