##// END OF EJS Templates
don't assume outputs have metadata...
MinRK -
Show More
@@ -1,173 +1,173 b''
1 {%- extends 'display_priority.tpl' -%}
1 {%- extends 'display_priority.tpl' -%}
2
2
3
3
4 {% block codecell %}
4 {% block codecell %}
5 <div class="cell border-box-sizing code_cell">
5 <div class="cell border-box-sizing code_cell">
6 {{ super() }}
6 {{ super() }}
7 </div>
7 </div>
8 {%- endblock codecell %}
8 {%- endblock codecell %}
9
9
10 {% block input_group -%}
10 {% block input_group -%}
11 <div class="input">
11 <div class="input">
12 {{ super() }}
12 {{ super() }}
13 </div>
13 </div>
14 {% endblock input_group %}
14 {% endblock input_group %}
15
15
16 {% block output_group %}
16 {% block output_group %}
17 <div class="output_wrapper">
17 <div class="output_wrapper">
18 <div class="output">
18 <div class="output">
19 {{ super() }}
19 {{ super() }}
20 </div>
20 </div>
21 </div>
21 </div>
22 {% endblock output_group %}
22 {% endblock output_group %}
23
23
24 {% block in_prompt -%}
24 {% block in_prompt -%}
25 <div class="prompt input_prompt">
25 <div class="prompt input_prompt">
26 In&nbsp;[{{ cell.prompt_number }}]:
26 In&nbsp;[{{ cell.prompt_number }}]:
27 </div>
27 </div>
28 {%- endblock in_prompt %}
28 {%- endblock in_prompt %}
29
29
30 {% block empty_in_prompt -%}
30 {% block empty_in_prompt -%}
31 <div class="prompt input_prompt">
31 <div class="prompt input_prompt">
32 </div>
32 </div>
33 {%- endblock empty_in_prompt %}
33 {%- endblock empty_in_prompt %}
34
34
35 {#
35 {#
36 output_prompt doesn't do anything in HTML,
36 output_prompt doesn't do anything in HTML,
37 because there is a prompt div in each output area (see output block)
37 because there is a prompt div in each output area (see output block)
38 #}
38 #}
39 {% block output_prompt %}
39 {% block output_prompt %}
40 {% endblock output_prompt %}
40 {% endblock output_prompt %}
41
41
42 {% block input %}
42 {% block input %}
43 <div class="input_area box-flex1">
43 <div class="input_area box-flex1">
44 {{ cell.input | highlight2html(metadata=cell.metadata) }}
44 {{ cell.input | highlight2html(metadata=cell.metadata) }}
45 </div>
45 </div>
46 {%- endblock input %}
46 {%- endblock input %}
47
47
48 {% block output %}
48 {% block output %}
49 <div class="output_area">
49 <div class="output_area">
50 {%- if output.output_type == 'pyout' -%}
50 {%- if output.output_type == 'pyout' -%}
51 <div class="prompt output_prompt">
51 <div class="prompt output_prompt">
52 Out[{{ cell.prompt_number }}]:
52 Out[{{ cell.prompt_number }}]:
53 {%- else -%}
53 {%- else -%}
54 <div class="prompt">
54 <div class="prompt">
55 {%- endif -%}
55 {%- endif -%}
56 </div>
56 </div>
57 {{ super() }}
57 {{ super() }}
58 </div>
58 </div>
59 {% endblock output %}
59 {% endblock output %}
60
60
61 {% block markdowncell scoped %}
61 {% block markdowncell scoped %}
62 <div class="input">
62 <div class="input">
63 {{ self.empty_in_prompt() }}
63 {{ self.empty_in_prompt() }}
64 <div class="inner_cell">
64 <div class="inner_cell">
65 <div class="text_cell_render border-box-sizing rendered_html">
65 <div class="text_cell_render border-box-sizing rendered_html">
66 {{ cell.source | markdown2html | strip_files_prefix }}
66 {{ cell.source | markdown2html | strip_files_prefix }}
67 </div>
67 </div>
68 </div>
68 </div>
69 </div>
69 </div>
70 {%- endblock markdowncell %}
70 {%- endblock markdowncell %}
71
71
72 {% block headingcell scoped %}
72 {% block headingcell scoped %}
73 <div class="input">
73 <div class="input">
74 {{ self.empty_in_prompt() }}
74 {{ self.empty_in_prompt() }}
75 <div class="inner_cell">
75 <div class="inner_cell">
76 <div class="text_cell_render border-box-sizing rendered_html">
76 <div class="text_cell_render border-box-sizing rendered_html">
77 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
77 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
78 </div>
78 </div>
79 </div>
79 </div>
80 </div>
80 </div>
81 {% endblock headingcell %}
81 {% endblock headingcell %}
82
82
83 {% block unknowncell scoped %}
83 {% block unknowncell scoped %}
84 unknown type {{ cell.type }}
84 unknown type {{ cell.type }}
85 {% endblock unknowncell %}
85 {% endblock unknowncell %}
86
86
87 {% block pyout -%}
87 {% block pyout -%}
88 <div class="box-flex1 output_subarea output_pyout">
88 <div class="box-flex1 output_subarea output_pyout">
89 {% block data_priority scoped %}
89 {% block data_priority scoped %}
90 {{ super() }}
90 {{ super() }}
91 {% endblock %}
91 {% endblock %}
92 </div>
92 </div>
93 {%- endblock pyout %}
93 {%- endblock pyout %}
94
94
95 {% block stream_stdout -%}
95 {% block stream_stdout -%}
96 <div class="box-flex1 output_subarea output_stream output_stdout">
96 <div class="box-flex1 output_subarea output_stream output_stdout">
97 <pre>
97 <pre>
98 {{ output.text | ansi2html }}
98 {{ output.text | ansi2html }}
99 </pre>
99 </pre>
100 </div>
100 </div>
101 {%- endblock stream_stdout %}
101 {%- endblock stream_stdout %}
102
102
103 {% block stream_stderr -%}
103 {% block stream_stderr -%}
104 <div class="box-flex1 output_subarea output_stream output_stderr">
104 <div class="box-flex1 output_subarea output_stream output_stderr">
105 <pre>
105 <pre>
106 {{ output.text | ansi2html }}
106 {{ output.text | ansi2html }}
107 </pre>
107 </pre>
108 </div>
108 </div>
109 {%- endblock stream_stderr %}
109 {%- endblock stream_stderr %}
110
110
111 {% block data_svg -%}
111 {% block data_svg -%}
112 {{ output.svg }}
112 {{ output.svg }}
113 {%- endblock data_svg %}
113 {%- endblock data_svg %}
114
114
115 {% block data_html -%}
115 {% block data_html -%}
116 <div class="output_html rendered_html">
116 <div class="output_html rendered_html">
117 {{ output.html }}
117 {{ output.html }}
118 </div>
118 </div>
119 {%- endblock data_html %}
119 {%- endblock data_html %}
120
120
121 {% block data_png %}
121 {% block data_png %}
122 <img src="data:image/png;base64,{{ output.png }}"
122 <img src="data:image/png;base64,{{ output.png }}"
123 {%- if 'width' in output.metadata.get('png', {}) %}
123 {%- if 'metadata' in output and 'width' in output.metadata.get('png', {}) %}
124 width={{output.metadata['png']['width']}}
124 width={{output.metadata['png']['width']}}
125 {%- endif %}
125 {%- endif %}
126 {%- if 'height' in output.metadata.get('png', {}) %}
126 {%- if 'metadata' in output and 'height' in output.metadata.get('png', {}) %}
127 height={{output.metadata['png']['height']}}
127 height={{output.metadata['png']['height']}}
128 {%- endif %}
128 {%- endif %}
129 >
129 >
130 {%- endblock data_png %}
130 {%- endblock data_png %}
131
131
132 {% block data_jpg %}
132 {% block data_jpg %}
133 <img src="data:image/jpeg;base64,{{ output.jpeg }}"
133 <img src="data:image/jpeg;base64,{{ output.jpeg }}"
134 {%- if 'width' in output.metadata.get('jpeg', {}) %}
134 {%- if 'metadata' in output and 'width' in output.metadata.get('jpeg', {}) %}
135 width={{output.metadata['jpeg']['width']}}
135 width={{output.metadata['jpeg']['width']}}
136 {%- endif %}
136 {%- endif %}
137 {%- if 'height' in output.metadata.get('jpeg', {}) %}
137 {%- if 'metadata' in output and 'height' in output.metadata.get('jpeg', {}) %}
138 height={{output.metadata['jpeg']['height']}}
138 height={{output.metadata['jpeg']['height']}}
139 {%- endif %}
139 {%- endif %}
140 >
140 >
141 {%- endblock data_jpg %}
141 {%- endblock data_jpg %}
142
142
143 {% block data_latex %}
143 {% block data_latex %}
144 {{ output.latex }}
144 {{ output.latex }}
145 {%- endblock data_latex %}
145 {%- endblock data_latex %}
146
146
147 {% block pyerr -%}
147 {% block pyerr -%}
148 <div class="box-flex1 output_subarea output_pyerr">
148 <div class="box-flex1 output_subarea output_pyerr">
149 <pre>{{ super() }}</pre>
149 <pre>{{ super() }}</pre>
150 </div>
150 </div>
151 {%- endblock pyerr %}
151 {%- endblock pyerr %}
152
152
153 {%- block traceback_line %}
153 {%- block traceback_line %}
154 {{ line | ansi2html }}
154 {{ line | ansi2html }}
155 {%- endblock traceback_line %}
155 {%- endblock traceback_line %}
156
156
157 {%- block data_text %}
157 {%- block data_text %}
158 <pre>
158 <pre>
159 {{ output.text | ansi2html }}
159 {{ output.text | ansi2html }}
160 </pre>
160 </pre>
161 {%- endblock -%}
161 {%- endblock -%}
162
162
163 {%- block data_javascript %}
163 {%- block data_javascript %}
164 <script type="text/javascript">
164 <script type="text/javascript">
165 {{ output.javascript }}
165 {{ output.javascript }}
166 </script>
166 </script>
167 {%- endblock -%}
167 {%- endblock -%}
168
168
169 {%- block display_data scoped -%}
169 {%- block display_data scoped -%}
170 <div class="box-flex1 output_subarea output_display_data">
170 <div class="box-flex1 output_subarea output_display_data">
171 {{ super() }}
171 {{ super() }}
172 </div>
172 </div>
173 {%- endblock display_data -%}
173 {%- endblock display_data -%}
General Comments 0
You need to be logged in to leave comments. Login now