From 63cc9e09be5671a1b77fc18b966b2a11c24f5417 2013-04-23 17:28:12 From: Brian E. Granger Date: 2013-04-23 17:28:12 Subject: [PATCH] Merge pull request #113 from minrk/reorder-output-div fix output div ordering in html --- diff --git a/templates/basichtml.tpl b/templates/basichtml.tpl index f878707..ac35df9 100644 --- a/templates/basichtml.tpl +++ b/templates/basichtml.tpl @@ -13,31 +13,23 @@ {% endblock input_group %} -{% block outputs -%} -
-{{ super() }} -
-{% endblock outputs %} - -{% block output_group -%} +{% block output_group %}
-
+
{{ super() }}
{% endblock output_group %} - {% block in_prompt -%}
In [{{cell.prompt_number}}]:
{%- endblock in_prompt %} -{% block output_prompt -%} -
-{%- if cell.haspyout -%} -Out[{{cell.prompt_number}}]: -{%- endif -%} -
+{# + output_prompt doesn't do anything in HTML, + because there is a prompt div in each output area (see output block) +#} +{% block output_prompt %} {% endblock output_prompt %} {% block input %} @@ -46,6 +38,18 @@ Out[{{cell.prompt_number}}]:
{%- endblock input %} +{% block output %} +
+{%- if output.output_type == 'pyout' -%} +
+Out[{{cell.prompt_number}}]: +{%- else -%} +
+{%- endif -%} +
+{{ super() }} +
+{% endblock output %} {% block markdowncell scoped %}
diff --git a/templates/skeleton/null.tpl b/templates/skeleton/null.tpl index 6107029..e048b69 100644 --- a/templates/skeleton/null.tpl +++ b/templates/skeleton/null.tpl @@ -5,11 +5,11 @@ IF YOU ARE COPY AND PASTING THIS FILE YOU ARE PROBABLY DOING THINGS WRONG. Null template, Does nothing except defining a basic structure -To layout the diferents blocks of a notebook. +To layout the different blocks of a notebook. -Subtemplates can Override Blocks to define their custom reresentation. +Subtemplates can override blocks to define their custom representation. -If one of the block you do overrite is not a leave block, consider +If one of the block you do overwrite is not a leave block, consider calling super. {%- block nonLeaveBlock -%} @@ -18,7 +18,7 @@ calling super. #add stuff at end {%- endblock nonLeaveBlock -%} -consider calling super even if block is leave block, we might insert more block later. +consider calling super even if it is a leave block, we might insert more blocks later. #} {%- block header -%} @@ -33,11 +33,12 @@ consider calling super even if block is leave block, we might insert more block {%- block in_prompt -%}{%- endblock in_prompt -%} {%- block input -%}{%- endblock input -%} {%- endblock input_group -%} - {%- if cell.outputs -%} + {%- if cell.outputs -%} {%- block output_group -%} - {%- block output_prompt -%}{%- endblock output_prompt -%} - {%- block outputs -%} - {%- for output in cell.outputs -%} + {%- block output_prompt -%}{%- endblock output_prompt -%} + {%- block outputs scoped -%} + {%- for output in cell.outputs -%} + {%- block output scoped -%} {%- if output.output_type in ['pyout'] -%} {%- block pyout scoped -%}{%- endblock pyout -%} {%- elif output.output_type in ['stream'] -%} @@ -62,10 +63,11 @@ consider calling super even if block is leave block, we might insert more block {%- endfor -%} {%- endblock pyerr -%} {%- endif -%} - {%- endfor -%} - {%- endblock outputs -%} + {%- endblock output -%} + {%- endfor -%} + {%- endblock outputs -%} {%- endblock output_group -%} - {%- endif -%} + {%- endif -%} {%- endblock codecell -%} {%- elif cell.type in ['markdown'] -%} {%- block markdowncell scoped-%} diff --git a/templates/skeleton/tex/null.tplx b/templates/skeleton/tex/null.tplx index 3e94a9b..e818d65 100644 --- a/templates/skeleton/tex/null.tplx +++ b/templates/skeleton/tex/null.tplx @@ -6,11 +6,11 @@ IF YOU ARE COPY AND PASTING THIS FILE YOU ARE PROBABLY DOING THINGS WRONG. Null template, Does nothing except defining a basic structure -To layout the diferents blocks of a notebook. +To layout the different blocks of a notebook. -Subtemplates can Override Blocks to define their custom reresentation. +Subtemplates can override blocks to define their custom representation. -If one of the block you do overrite is not a leave block, consider +If one of the block you do overwrite is not a leave block, consider calling super. ((*- block nonLeaveBlock -*)) @@ -19,7 +19,7 @@ calling super. #add stuff at end ((*- endblock nonLeaveBlock -*)) -consider calling super even if block is leave block, we might insert more block later. +consider calling super even if it is a leave block, we might insert more blocks later. =)) ((*- block header -*)) @@ -34,11 +34,12 @@ consider calling super even if block is leave block, we might insert more block ((*- block in_prompt -*))((*- endblock in_prompt -*)) ((*- block input -*))((*- endblock input -*)) ((*- endblock input_group -*)) - ((*- if cell.outputs -*)) + ((*- if cell.outputs -*)) ((*- block output_group -*)) - ((*- block output_prompt -*))((*- endblock output_prompt -*)) - ((*- block outputs -*)) - ((*- for output in cell.outputs -*)) + ((*- block output_prompt -*))((*- endblock output_prompt -*)) + ((*- block outputs scoped -*)) + ((*- for output in cell.outputs -*)) + ((*- block output scoped -*)) ((*- if output.output_type in ['pyout'] -*)) ((*- block pyout scoped -*))((*- endblock pyout -*)) ((*- elif output.output_type in ['stream'] -*)) @@ -63,10 +64,11 @@ consider calling super even if block is leave block, we might insert more block ((*- endfor -*)) ((*- endblock pyerr -*)) ((*- endif -*)) - ((*- endfor -*)) - ((*- endblock outputs -*)) + ((*- endblock output -*)) + ((*- endfor -*)) + ((*- endblock outputs -*)) ((*- endblock output_group -*)) - ((*- endif -*)) + ((*- endif -*)) ((*- endblock codecell -*)) ((*- elif cell.type in ['markdown'] -*)) ((*- block markdowncell scoped-*))