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