diff --git a/IPython/nbconvert/exporters/html.py b/IPython/nbconvert/exporters/html.py index d833691..1948709 100644 --- a/IPython/nbconvert/exporters/html.py +++ b/IPython/nbconvert/exporters/html.py @@ -1,16 +1,7 @@ """HTML Exporter class""" -#----------------------------------------------------------------------------- -# Copyright (c) 2013, the IPython Development Team. -# +# Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- import os @@ -46,7 +37,7 @@ class HTMLExporter(TemplateExporter): def default_config(self): c = Config({ 'NbConvertBase': { - 'display_data_priority' : ['text/javascript', 'text/html', 'application/pdf', 'image/svg+xml', 'text/latex', 'image/png', 'image/jpeg', 'text/plain'] + 'display_data_priority' : ['text/javascript', 'text/html', 'text/markdown', 'application/pdf', 'image/svg+xml', 'text/latex', 'image/png', 'image/jpeg', 'text/plain'] }, 'CSSHTMLHeaderPreprocessor':{ 'enabled':True diff --git a/IPython/nbconvert/templates/html/basic.tpl b/IPython/nbconvert/templates/html/basic.tpl index a8c3b0d..b23d1a1 100644 --- a/IPython/nbconvert/templates/html/basic.tpl +++ b/IPython/nbconvert/templates/html/basic.tpl @@ -123,6 +123,12 @@ unknown type {{ cell.type }} {%- endblock data_html %} +{% block data_markdown scoped -%} +
+{{ output.data['text/markdown'] | markdown2html }} +
+{%- endblock data_markdown %} + {% block data_png scoped %}
{%- if 'image/png' in output.metadata.get('filenames', {}) %} diff --git a/IPython/nbconvert/templates/latex/skeleton/display_priority.tplx b/IPython/nbconvert/templates/latex/skeleton/display_priority.tplx index 5788f7b..6e5366c 100644 --- a/IPython/nbconvert/templates/latex/skeleton/display_priority.tplx +++ b/IPython/nbconvert/templates/latex/skeleton/display_priority.tplx @@ -21,6 +21,9 @@ ((*- elif type == 'text/html' -*)) ((*- block data_html -*)) ((*- endblock -*)) + ((*- elif type == 'text/markdown' -*)) + ((*- block data_markdown -*)) + ((*- endblock -*)) ((*- elif type == 'image/jpeg' -*)) ((*- block data_jpg -*)) ((*- endblock -*)) diff --git a/IPython/nbconvert/templates/markdown.tpl b/IPython/nbconvert/templates/markdown.tpl index a6b9d35..b0de4e9 100644 --- a/IPython/nbconvert/templates/markdown.tpl +++ b/IPython/nbconvert/templates/markdown.tpl @@ -50,6 +50,10 @@ {{ output.data['text/html'] }} {% endblock data_html %} +{% block data_markdown scoped %} +{{ output.data['text/markdown'] }} +{% endblock data_markdown %} + {% block data_text scoped %} {{ output.data['text/plain'] | indent }} {% endblock data_text %} diff --git a/IPython/nbconvert/templates/skeleton/display_priority.tpl b/IPython/nbconvert/templates/skeleton/display_priority.tpl index 0ed3afc..e73d6ef 100644 --- a/IPython/nbconvert/templates/skeleton/display_priority.tpl +++ b/IPython/nbconvert/templates/skeleton/display_priority.tpl @@ -17,6 +17,9 @@ {%- elif type == 'text/html' -%} {%- block data_html -%} {%- endblock -%} + {%- elif type == 'text/markdown' -%} + {%- block data_markdown -%} + {%- endblock -%} {%- elif type == 'image/jpeg' -%} {%- block data_jpg -%} {%- endblock -%}