diff --git a/liquid_tags/notebook.py b/liquid_tags/notebook.py index 54b4aa2..1208f1e 100644 --- a/liquid_tags/notebook.py +++ b/liquid_tags/notebook.py @@ -269,11 +269,14 @@ def notebook(preprocessor, tag, markup): 'SubCell': {'enabled':True, 'start':start, 'end':end}}) - if os.path.exists('pelicanhtml.tpl'): - template_file = 'pelicanhtml' + template_file = 'basic' + if LooseVersion(IPython.__version__) >= '2.0': + if os.path.exists('pelicanhtml_2.tpl'): + template_file = 'pelicanhtml_2' else: - template_file = 'basic' - + if os.path.exists('pelicanhtml_1.tpl'): + template_file = 'pelicanhtml_1' + if LooseVersion(IPython.__version__) >= '2.0': subcell_kwarg = dict(preprocessors=[SubCell]) else: @@ -282,7 +285,6 @@ def notebook(preprocessor, tag, markup): exporter = HTMLExporter(config=c, template_file=template_file, filters={'highlight2html': custom_highlighter}, - extra_loaders=[pelican_loader], **subcell_kwarg) # read and parse the notebook diff --git a/liquid_tags/pelicanhtml.tpl b/liquid_tags/pelicanhtml_1.tpl similarity index 90% rename from liquid_tags/pelicanhtml.tpl rename to liquid_tags/pelicanhtml_1.tpl index b32a52b..e0094f3 100644 --- a/liquid_tags/pelicanhtml.tpl +++ b/liquid_tags/pelicanhtml_1.tpl @@ -26,18 +26,18 @@ {% if "# " in cell.input %}
{{output.text | ansi2html}}
+{%- endblock -%}
+
+{% block input %}
+{% if "# " in cell.input %}
+