From 0104a64d0cf9ecd6fe3ddb633a33f909c51469a2 2013-07-07 22:32:38 From: damianavila Date: 2013-07-07 22:32:38 Subject: [PATCH] Added support for markdown in heading cells when they are nbconverted. --- diff --git a/IPython/nbconvert/templates/basichtml.tpl b/IPython/nbconvert/templates/basichtml.tpl index ac35df9..1785cd4 100644 --- a/IPython/nbconvert/templates/basichtml.tpl +++ b/IPython/nbconvert/templates/basichtml.tpl @@ -62,7 +62,7 @@ Out[{{cell.prompt_number}}]: {% set source = cell.source | replace(' ','_') %} - {{cell.source}} + {{cell.source | markdown| rm_fake}} diff --git a/IPython/nbconvert/templates/markdown.tpl b/IPython/nbconvert/templates/markdown.tpl index f0e431d..661c7fa 100644 --- a/IPython/nbconvert/templates/markdown.tpl +++ b/IPython/nbconvert/templates/markdown.tpl @@ -61,7 +61,7 @@ $$ {% block headingcell scoped %} -{{ '#' * cell.level }} {{ cell.source}} +{{ '#' * cell.level }} {{ cell.source | wrap(80)}} {% endblock headingcell %} diff --git a/IPython/nbconvert/templates/rst.tpl b/IPython/nbconvert/templates/rst.tpl index 2435238..fb58eb2 100644 --- a/IPython/nbconvert/templates/rst.tpl +++ b/IPython/nbconvert/templates/rst.tpl @@ -64,7 +64,7 @@ Out[{{cell.prompt_number}}]:{% endif %}{% endblock output_prompt %} {% block headingcell scoped %} {%- set len = cell.source|length -%} -{{ cell.source}} +{{ cell.source | markdown2rst}} {% if cell.level == 1 %} {{- '=' * len }} {%- elif cell.level == 2 %}