##// END OF EJS Templates
Fixed classed for latex and text output
Jonathan Frederic -
Show More
@@ -1,189 +1,193 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 rendered unselected">
5 <div class="cell border-box-sizing code_cell rendered unselected">
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="inner_cell">
43 <div class="inner_cell">
44 <div class="input_area">
44 <div class="input_area">
45 {{ cell.input | highlight2html(language=resources.get('language'), metadata=cell.metadata) }}
45 {{ cell.input | highlight2html(language=resources.get('language'), metadata=cell.metadata) }}
46 </div>
46 </div>
47 </div>
47 </div>
48 {%- endblock input %}
48 {%- endblock input %}
49
49
50 {% block output %}
50 {% block output %}
51 <div class="output_area">
51 <div class="output_area">
52 {%- if output.output_type == 'pyout' -%}
52 {%- if output.output_type == 'pyout' -%}
53 <div class="prompt output_prompt">
53 <div class="prompt output_prompt">
54 Out[{{ cell.prompt_number }}]:
54 Out[{{ cell.prompt_number }}]:
55 {%- else -%}
55 {%- else -%}
56 <div class="prompt">
56 <div class="prompt">
57 {%- endif -%}
57 {%- endif -%}
58 </div>
58 </div>
59 {{ super() }}
59 {{ super() }}
60 </div>
60 </div>
61 {% endblock output %}
61 {% endblock output %}
62
62
63 {% block markdowncell scoped %}
63 {% block markdowncell scoped %}
64 <div class="cell border-box-sizing text_cell rendered unselected">
64 <div class="cell border-box-sizing text_cell rendered unselected">
65 {{ self.empty_in_prompt() }}
65 {{ self.empty_in_prompt() }}
66 <div class="inner_cell">
66 <div class="inner_cell">
67 <div class="text_cell_render border-box-sizing rendered_html">
67 <div class="text_cell_render border-box-sizing rendered_html">
68 {{ cell.source | markdown2html | strip_files_prefix }}
68 {{ cell.source | markdown2html | strip_files_prefix }}
69 </div>
69 </div>
70 </div>
70 </div>
71 </div>
71 </div>
72 {%- endblock markdowncell %}
72 {%- endblock markdowncell %}
73
73
74 {% block headingcell scoped %}
74 {% block headingcell scoped %}
75 <div class="cell border-box-sizing text_cell rendered unselected">
75 <div class="cell border-box-sizing text_cell rendered unselected">
76 {{ self.empty_in_prompt() }}
76 {{ self.empty_in_prompt() }}
77 <div class="inner_cell">
77 <div class="inner_cell">
78 <div class="text_cell_render border-box-sizing rendered_html">
78 <div class="text_cell_render border-box-sizing rendered_html">
79 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
79 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
80 </div>
80 </div>
81 </div>
81 </div>
82 </div>
82 </div>
83 {% endblock headingcell %}
83 {% endblock headingcell %}
84
84
85 {% block unknowncell scoped %}
85 {% block unknowncell scoped %}
86 unknown type {{ cell.type }}
86 unknown type {{ cell.type }}
87 {% endblock unknowncell %}
87 {% endblock unknowncell %}
88
88
89 {% block pyout -%}
89 {% block pyout -%}
90 <div class="output_subarea output_text">
90 <div class="output_subarea output_text">
91 {% block data_priority scoped %}
91 {% block data_priority scoped %}
92 {{ super() }}
92 {{ super() }}
93 {% endblock %}
93 {% endblock %}
94 </div>
94 </div>
95 {%- endblock pyout %}
95 {%- endblock pyout %}
96
96
97 {% block stream_stdout -%}
97 {% block stream_stdout -%}
98 <div class="output_subarea output_stream output_stdout output_text">
98 <div class="output_subarea output_stream output_stdout output_text">
99 <pre>
99 <pre>
100 {{ output.text | ansi2html }}
100 {{ output.text | ansi2html }}
101 </pre>
101 </pre>
102 </div>
102 </div>
103 {%- endblock stream_stdout %}
103 {%- endblock stream_stdout %}
104
104
105 {% block stream_stderr -%}
105 {% block stream_stderr -%}
106 <div class="box-flex1 output_subarea output_stream output_stderr">
106 <div class="box-flex1 output_subarea output_stream output_stderr">
107 <pre>
107 <pre>
108 {{ output.text | ansi2html }}
108 {{ output.text | ansi2html }}
109 </pre>
109 </pre>
110 </div>
110 </div>
111 {%- endblock stream_stderr %}
111 {%- endblock stream_stderr %}
112
112
113 {% block data_svg -%}
113 {% block data_svg -%}
114 <div class="output_svg output_subarea">
114 <div class="output_svg output_subarea">
115 {%- if output.svg_filename %}
115 {%- if output.svg_filename %}
116 <img src="{{output.svg_filename | posix_path}}"
116 <img src="{{output.svg_filename | posix_path}}"
117 {%- else %}
117 {%- else %}
118 {{ output.svg }}
118 {{ output.svg }}
119 {%- endif %}
119 {%- endif %}
120 </div>
120 </div>
121 {%- endblock data_svg %}
121 {%- endblock data_svg %}
122
122
123 {% block data_html -%}
123 {% block data_html -%}
124 <div class="output_html rendered_html output_subarea">
124 <div class="output_html rendered_html output_subarea">
125 {{ output.html }}
125 {{ output.html }}
126 </div>
126 </div>
127 {%- endblock data_html %}
127 {%- endblock data_html %}
128
128
129 {% block data_png %}
129 {% block data_png %}
130 <div class="output_png output_subarea">
130 <div class="output_png output_subarea">
131 {%- if output.png_filename %}
131 {%- if output.png_filename %}
132 <img src="{{output.png_filename | posix_path}}"
132 <img src="{{output.png_filename | posix_path}}"
133 {%- else %}
133 {%- else %}
134 <img src="data:image/png;base64,{{ output.png }}"
134 <img src="data:image/png;base64,{{ output.png }}"
135 {%- endif %}
135 {%- endif %}
136 {%- if 'metadata' in output and 'width' in output.metadata.get('png', {}) %}
136 {%- if 'metadata' in output and 'width' in output.metadata.get('png', {}) %}
137 width={{output.metadata['png']['width']}}
137 width={{output.metadata['png']['width']}}
138 {%- endif %}
138 {%- endif %}
139 {%- if 'metadata' in output and 'height' in output.metadata.get('png', {}) %}
139 {%- if 'metadata' in output and 'height' in output.metadata.get('png', {}) %}
140 height={{output.metadata['png']['height']}}
140 height={{output.metadata['png']['height']}}
141 {%- endif %}
141 {%- endif %}
142 >
142 >
143 </div>
143 </div>
144 {%- endblock data_png %}
144 {%- endblock data_png %}
145
145
146 {% block data_jpg %}
146 {% block data_jpg %}
147 <div class="output_jpeg output_subarea">
147 <div class="output_jpeg output_subarea">
148 {%- if output.jpeg_filename %}
148 {%- if output.jpeg_filename %}
149 <img src="{{output.jpeg_filename | posix_path}}"
149 <img src="{{output.jpeg_filename | posix_path}}"
150 {%- else %}
150 {%- else %}
151 <img src="data:image/jpeg;base64,{{ output.jpeg }}"
151 <img src="data:image/jpeg;base64,{{ output.jpeg }}"
152 {%- endif %}
152 {%- endif %}
153 {%- if 'metadata' in output and 'width' in output.metadata.get('jpeg', {}) %}
153 {%- if 'metadata' in output and 'width' in output.metadata.get('jpeg', {}) %}
154 width={{output.metadata['jpeg']['width']}}
154 width={{output.metadata['jpeg']['width']}}
155 {%- endif %}
155 {%- endif %}
156 {%- if 'metadata' in output and 'height' in output.metadata.get('jpeg', {}) %}
156 {%- if 'metadata' in output and 'height' in output.metadata.get('jpeg', {}) %}
157 height={{output.metadata['jpeg']['height']}}
157 height={{output.metadata['jpeg']['height']}}
158 {%- endif %}
158 {%- endif %}
159 >
159 >
160 </div>
160 </div>
161 {%- endblock data_jpg %}
161 {%- endblock data_jpg %}
162
162
163 {% block data_latex %}
163 {% block data_latex %}
164 <div class="output_latex output_subarea">
164 {{ output.latex }}
165 {{ output.latex }}
166 </div>
165 {%- endblock data_latex %}
167 {%- endblock data_latex %}
166
168
167 {% block pyerr -%}
169 {% block pyerr -%}
168 <div class="output_subarea output_text output_pyerr">
170 <div class="output_subarea output_text output_pyerr">
169 <pre>{{ super() }}</pre>
171 <pre>{{ super() }}</pre>
170 </div>
172 </div>
171 {%- endblock pyerr %}
173 {%- endblock pyerr %}
172
174
173 {%- block traceback_line %}
175 {%- block traceback_line %}
174 {{ line | ansi2html }}
176 {{ line | ansi2html }}
175 {%- endblock traceback_line %}
177 {%- endblock traceback_line %}
176
178
177 {%- block data_text %}
179 {%- block data_text %}
180 <div class="output_text output_subarea">
178 <pre>
181 <pre>
179 {{ output.text | ansi2html }}
182 {{ output.text | ansi2html }}
180 </pre>
183 </pre>
184 </div>
181 {%- endblock -%}
185 {%- endblock -%}
182
186
183 {%- block data_javascript %}
187 {%- block data_javascript %}
184 <div class="output_subarea output_javascript">
188 <div class="output_subarea output_javascript">
185 <script type="text/javascript">
189 <script type="text/javascript">
186 {{ output.javascript }}
190 {{ output.javascript }}
187 </script>
191 </script>
188 </div>
192 </div>
189 {%- endblock -%}
193 {%- endblock -%}
General Comments 0
You need to be logged in to leave comments. Login now