From 034daf402acd8d8a6b348ac14282bcc8a8c9b6bc Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Wed, 19 Sep 2018 21:17:26 +0200 Subject: [PATCH] Comment markdown cells in py light format #66 --- jupytext/cell_to_text.py | 1 + .../mirror/ipynb_to_script/sample_rise_notebook_66.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jupytext/cell_to_text.py b/jupytext/cell_to_text.py index 27a718214..fd5418951 100644 --- a/jupytext/cell_to_text.py +++ b/jupytext/cell_to_text.py @@ -147,6 +147,7 @@ def is_code(self): # Treat markdown cells with metadata as code cells (#66) if self.cell_type == 'markdown' and self.metadata: self.metadata['cell_type'] = self.cell_type + self.source = comment(self.source, self.prefix) return True return super(LightScriptCellExporter, self).is_code() diff --git a/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py b/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py index 990c8b9f1..40b2afe2b 100644 --- a/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py +++ b/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py @@ -17,10 +17,10 @@ # --- # + {"slideshow": {"slide_type": "slide"}, "cell_type": "markdown"} -A markdown cell +# A markdown cell # + {"slideshow": {"slide_type": ""}} 1+1 # + {"cell_style": "center", "slideshow": {"slide_type": "fragment"}, "cell_type": "markdown"} -Markdown cell two +# Markdown cell two