diff --git a/templates/basichtml.tpl b/templates/basichtml.tpl index 9b6e7d8..9a538ad 100644 --- a/templates/basichtml.tpl +++ b/templates/basichtml.tpl @@ -1,42 +1,43 @@ -{%- extends 'basic.tpl' -%} +{%- extends 'null.tpl' -%} - -{% block codecell scoped %} +{% block codecell %}
-
-
In [{{cell.prompt_number if cell.prompt_number else ' '}}]:
-
-{{ cell.input|highlight -}} +{{ super() }}
+{% endblock codecell %} + +{% block input_group -%} +
+{{super()}}
-{% if cell.outputs %} -{%- for output in cell.outputs -%} +{% endblock input_group %} + +{% block output_group -%}
-
- {%- if output.output_type in ['pyout','stream'] %} -
-
{{ output.text }}
-
-
+{{ super() }}
- {%- elif output.output_type in ['display_data'] %} -
-{{"# image file: fucking display_data"}}
- {%- elif output.output_type in ['pyerr'] %} - {%- for line in output.traceback %} -{{ line |indent| rm_ansi}} - {%- endfor %} - {%- endif %} -{%- endfor -%} -{% endif %}
-
-{% endblock codecell %} +{% endblock output_group %} + + +{% block in_prompt -%} +
In [{{cell.prompt_number}}]:
+{%- endblock in_prompt %} + +{% block output_prompt -%} +
+{% endblock output_prompt %} + +{% block input %} +
+{{cell.input | highlight }}
+{%- endblock input %} + {% block markdowncell scoped -%}
@@ -59,3 +60,16 @@ {% block unknowncell scoped %} unknown type {{cell.type}} {% endblock unknowncell %} + + +{% block pyout -%} +
+
{{output.text}}
+
+{%- endblock pyout %} + +{% block stream -%} +
+
{{output.text}}
+
+{%- endblock stream %} diff --git a/templates/null.tpl b/templates/null.tpl index 32f0456..ba572ba 100644 --- a/templates/null.tpl +++ b/templates/null.tpl @@ -29,26 +29,32 @@ consider calling super even if block is leave block, we might insert more block {%- block any_cell scoped -%} {%- if cell.type in ['code'] -%} {%- block codecell scoped -%} - {%- block in_prompt -%}{%- endblock in_prompt -%} - {%- block input -%}{%- endblock input -%} - {%- if cell.outputs -%} - {%- block output_prompt -%}{%- endblock output_prompt -%} - {%- for output in cell.outputs -%} - {%- if output.output_type in ['pyout'] -%} - {%- block pyout scoped -%}{%- endblock pyout -%} - {%- elif output.output_type in ['stream'] -%} - {%- block stream scoped -%}{%- endblock stream -%} - {%- elif output.output_type in ['display_data'] -%} - {%- block display_data scoped -%}{%- endblock display_data -%} - {%- elif output.output_type in ['pyerr'] -%} - {%- block pyerr scoped -%} - {%- for line in output.traceback -%} - {%- block traceback_line scoped -%}{%- endblock traceback_line -%} - {%- endfor -%} - {%- endblock pyerr -%} + {%- block input_group -%} + {%- block in_prompt -%}{%- endblock in_prompt -%} + {%- block input -%}{%- endblock input -%} + {%- endblock input_group -%} + {%- block output_group -%} + {%- if cell.outputs -%} + {%- block output_prompt -%}{%- endblock output_prompt -%} + {%- block outputs -%} + {%- for output in cell.outputs -%} + {%- if output.output_type in ['pyout'] -%} + {%- block pyout scoped -%}{%- endblock pyout -%} + {%- elif output.output_type in ['stream'] -%} + {%- block stream scoped -%}{%- endblock stream -%} + {%- elif output.output_type in ['display_data'] -%} + {%- block display_data scoped -%}{%- endblock display_data -%} + {%- elif output.output_type in ['pyerr'] -%} + {%- block pyerr scoped -%} + {%- for line in output.traceback -%} + {%- block traceback_line scoped -%}{%- endblock traceback_line -%} + {%- endfor -%} + {%- endblock pyerr -%} + {%- endif -%} + {%- endfor -%} + {%- endblock outputs -%} {%- endif -%} - {%- endfor -%} - {%- endif -%} + {%- endblock output_group -%} {%- endblock codecell -%} {%- elif cell.type in ['markdown'] -%} {%- block markdowncell scoped-%}