diff --git a/converters/template.py b/converters/template.py index aae868d..b53fba8 100755 --- a/converters/template.py +++ b/converters/template.py @@ -40,7 +40,7 @@ from IPython.utils.traitlets import (List, Unicode, Type, Bool, Dict, CaselessSt from IPython.utils.text import indent from .utils import remove_ansi from markdown import markdown -from .utils import highlight +from .utils import highlight,ansi2html #----------------------------------------------------------------------------- # Class declarations #----------------------------------------------------------------------------- @@ -60,6 +60,7 @@ env.filters['rm_fake'] = rm_fake env.filters['rm_ansi'] = remove_ansi env.filters['markdown'] = markdown env.filters['highlight'] = highlight +env.filters['ansi2html'] = ansi2html class ConverterTemplate(Configurable): @@ -87,6 +88,11 @@ class ConverterTemplate(Configurable): for worksheet in self.nb.worksheets: for cell in worksheet.cells: cell.type = cell.cell_type + cell.haspyout = False + for out in cell.get('outputs',[]): + if out.output_type == 'pyout': + cell.haspyout = True + break converted_cells.append(worksheet) return converted_cells diff --git a/templates/basichtml.tpl b/templates/basichtml.tpl index 8906f57..af9572e 100644 --- a/templates/basichtml.tpl +++ b/templates/basichtml.tpl @@ -30,8 +30,7 @@ {% block output_prompt -%}