##// END OF EJS Templates
svgoutput
Matthias BUSSONNIER -
Show More
@@ -40,7 +40,7 b' from IPython.utils.traitlets import (List, Unicode, Type, Bool, Dict, CaselessSt'
40 from IPython.utils.text import indent
40 from IPython.utils.text import indent
41 from .utils import remove_ansi
41 from .utils import remove_ansi
42 from markdown import markdown
42 from markdown import markdown
43 from .utils import highlight
43 from .utils import highlight,ansi2html
44 #-----------------------------------------------------------------------------
44 #-----------------------------------------------------------------------------
45 # Class declarations
45 # Class declarations
46 #-----------------------------------------------------------------------------
46 #-----------------------------------------------------------------------------
@@ -60,6 +60,7 b" env.filters['rm_fake'] = rm_fake"
60 env.filters['rm_ansi'] = remove_ansi
60 env.filters['rm_ansi'] = remove_ansi
61 env.filters['markdown'] = markdown
61 env.filters['markdown'] = markdown
62 env.filters['highlight'] = highlight
62 env.filters['highlight'] = highlight
63 env.filters['ansi2html'] = ansi2html
63
64
64 class ConverterTemplate(Configurable):
65 class ConverterTemplate(Configurable):
65
66
@@ -87,6 +88,11 b' class ConverterTemplate(Configurable):'
87 for worksheet in self.nb.worksheets:
88 for worksheet in self.nb.worksheets:
88 for cell in worksheet.cells:
89 for cell in worksheet.cells:
89 cell.type = cell.cell_type
90 cell.type = cell.cell_type
91 cell.haspyout = False
92 for out in cell.get('outputs',[]):
93 if out.output_type == 'pyout':
94 cell.haspyout = True
95 break
90 converted_cells.append(worksheet)
96 converted_cells.append(worksheet)
91
97
92 return converted_cells
98 return converted_cells
@@ -30,8 +30,7 b''
30
30
31 {% block output_prompt -%}
31 {% block output_prompt -%}
32 <div class="prompt output_prompt">
32 <div class="prompt output_prompt">
33 {%- if cell.prompt_number is not none -%}
33 {%- if cell.haspyout -%}
34 {#- check the case of Out[#]-#}
35 Out[{{cell.prompt_number}}]:
34 Out[{{cell.prompt_number}}]:
36 {%- endif -%}
35 {%- endif -%}
37 </div>
36 </div>
@@ -59,7 +58,7 b' Out[{{cell.prompt_number}}]:'
59 {% endblock headingcell %}
58 {% endblock headingcell %}
60
59
61 {% block rawcell scoped %}
60 {% block rawcell scoped %}
62 {{ cell.source | pycomment }}
61 {{ cell.source }}
63 {% endblock rawcell %}
62 {% endblock rawcell %}
64
63
65 {% block unknowncell scoped %}
64 {% block unknowncell scoped %}
@@ -69,12 +68,29 b' unknown type {{cell.type}}'
69
68
70 {% block pyout -%}
69 {% block pyout -%}
71 <div class="output_subarea output_pyout">
70 <div class="output_subarea output_pyout">
72 <pre>{{output.text}}</pre>
71 <pre>{{output.text | ansi2html}}</pre>
73 </div>
72 </div>
74 {%- endblock pyout %}
73 {%- endblock pyout %}
75
74
76 {% block stream -%}
75 {% block stream -%}
77 <div class="output_subarea output_stream output_stdout">
76 <div class="output_subarea output_stream output_stdout">
78 <pre>{{output.text}}</pre>
77 <pre>{{output.text |ansi2html}}</pre>
79 </div>
78 </div>
80 {%- endblock stream %}
79 {%- endblock stream %}
80
81 {% block display_data -%}
82 <div class="output_subarea output_display_data">
83 {{output.svg}}
84 </div>
85 {%- endblock display_data %}
86
87
88 {% block pyerr -%}
89 <div class="output_subarea output_pyerr">
90 <pre>{{super()}}</pre>
91 </div>
92 {%- endblock pyerr %}
93
94 {%- block traceback_line %}
95 {{line| ansi2html}}
96 {%- endblock traceback_line %}
@@ -771,9 +771,9 b' init_mathjax();'
771
771
772
772
773 {% block body %}
773 {% block body %}
774 <body>{{ super() }}<body/>
774 <body>{{ super() }}
775
775 </body>
776 {% endblock body %}
776 {%- endblock body %}
777
777
778
778
779
779
@@ -783,5 +783,4 b' init_mathjax();'
783
783
784
784
785 {% block footer %}
785 {% block footer %}
786 </html>
786 </html>{% endblock footer %}
787 {% endblock footer %}
General Comments 0
You need to be logged in to leave comments. Login now