diff --git a/converters/reveal.py b/converters/reveal.py index 6654459..2cbc5f7 100644 --- a/converters/reveal.py +++ b/converters/reveal.py @@ -5,7 +5,12 @@ import os class ConverterReveal(ConverterMarkdown): """Convert a notebook to a html slideshow. - It generates a static html slideshow based in markdown and reveal.js. + It generates a static html slideshow based in markdown and reveal.js. + You have four ways to delimit the the slides: + ##--- delimit horizontal slides + ##<<< open vertical slides + ##>>> close vertical slides + ##>>><<< close vertical slides and open new vertical slides. """ def __init__(self, infile, highlight_source=False, show_prompts=True, @@ -34,12 +39,18 @@ class ConverterReveal(ConverterMarkdown): """ lines = [] lines.extend(self.optional_header()) - top = '
' + left = '
' text = self.main_body(cell_separator) for i,j in enumerate(text): - if j == u'---': - text[i] = bottom + top + if j == u'##---': + text[i] = right + left + if j == u'##<<<': + text[i] = right + '
' + left + if j == u'##>>>': + text[i] = right + '
' + left + if j == u'##>>><<<': + text[i] = right + '
' + left lines.extend(text) lines.extend(self.optional_footer()) return u'\n'.join(lines) diff --git a/example_slide.ipynb b/example_slide.ipynb index 1965635..b705225 100644 --- a/example_slide.ipynb +++ b/example_slide.ipynb @@ -1,6 +1,6 @@ { "metadata": { - "name": "test_example_slide" + "name": "example_slide" }, "nbformat": 3, "nbformat_minor": 0, @@ -33,7 +33,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##<<<" ] }, { @@ -55,7 +55,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -69,7 +69,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -85,7 +85,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##>>><<<" ] }, { @@ -111,7 +111,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -125,7 +125,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -150,7 +150,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##>>><<<" ] }, { @@ -172,7 +172,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -189,7 +189,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -205,7 +205,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -221,7 +221,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##>>>" ] }, { @@ -245,7 +245,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -289,7 +289,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -330,7 +330,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -350,7 +350,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##<<<" ] }, { @@ -381,7 +381,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, { @@ -407,7 +407,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##>>>" ] }, { @@ -428,7 +428,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---" + "##---" ] }, {