##// END OF EJS Templates
Wrap nbconvert Markdown/Heading cells in live divs...
Aron Ahmadia -
Show More
@@ -1,173 +1,177 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="cell border-box-sizing text_cell">
62 <div class="input">
63 <div class="input">
63 {{ self.empty_in_prompt() }}
64 {{ self.empty_in_prompt() }}
64 <div class="inner_cell">
65 <div class="inner_cell">
65 <div class="text_cell_render border-box-sizing rendered_html">
66 <div class="text_cell_render border-box-sizing rendered_html">
66 {{ cell.source | markdown2html | strip_files_prefix }}
67 {{ cell.source | markdown2html | strip_files_prefix }}
67 </div>
68 </div>
68 </div>
69 </div>
69 </div>
70 </div>
71 </div>
70 {%- endblock markdowncell %}
72 {%- endblock markdowncell %}
71
73
72 {% block headingcell scoped %}
74 {% block headingcell scoped %}
75 <div class="cell border-box-sizing text_cell">
73 <div class="input">
76 <div class="input">
74 {{ self.empty_in_prompt() }}
77 {{ self.empty_in_prompt() }}
75 <div class="inner_cell">
78 <div class="inner_cell">
76 <div class="text_cell_render border-box-sizing rendered_html">
79 <div class="text_cell_render border-box-sizing rendered_html">
77 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
80 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
78 </div>
81 </div>
79 </div>
82 </div>
80 </div>
83 </div>
84 </div>
81 {% endblock headingcell %}
85 {% endblock headingcell %}
82
86
83 {% block unknowncell scoped %}
87 {% block unknowncell scoped %}
84 unknown type {{ cell.type }}
88 unknown type {{ cell.type }}
85 {% endblock unknowncell %}
89 {% endblock unknowncell %}
86
90
87 {% block pyout -%}
91 {% block pyout -%}
88 <div class="box-flex1 output_subarea output_pyout">
92 <div class="box-flex1 output_subarea output_pyout">
89 {% block data_priority scoped %}
93 {% block data_priority scoped %}
90 {{ super() }}
94 {{ super() }}
91 {% endblock %}
95 {% endblock %}
92 </div>
96 </div>
93 {%- endblock pyout %}
97 {%- endblock pyout %}
94
98
95 {% block stream_stdout -%}
99 {% block stream_stdout -%}
96 <div class="box-flex1 output_subarea output_stream output_stdout">
100 <div class="box-flex1 output_subarea output_stream output_stdout">
97 <pre>
101 <pre>
98 {{ output.text | ansi2html }}
102 {{ output.text | ansi2html }}
99 </pre>
103 </pre>
100 </div>
104 </div>
101 {%- endblock stream_stdout %}
105 {%- endblock stream_stdout %}
102
106
103 {% block stream_stderr -%}
107 {% block stream_stderr -%}
104 <div class="box-flex1 output_subarea output_stream output_stderr">
108 <div class="box-flex1 output_subarea output_stream output_stderr">
105 <pre>
109 <pre>
106 {{ output.text | ansi2html }}
110 {{ output.text | ansi2html }}
107 </pre>
111 </pre>
108 </div>
112 </div>
109 {%- endblock stream_stderr %}
113 {%- endblock stream_stderr %}
110
114
111 {% block data_svg -%}
115 {% block data_svg -%}
112 {{ output.svg }}
116 {{ output.svg }}
113 {%- endblock data_svg %}
117 {%- endblock data_svg %}
114
118
115 {% block data_html -%}
119 {% block data_html -%}
116 <div class="output_html rendered_html">
120 <div class="output_html rendered_html">
117 {{ output.html }}
121 {{ output.html }}
118 </div>
122 </div>
119 {%- endblock data_html %}
123 {%- endblock data_html %}
120
124
121 {% block data_png %}
125 {% block data_png %}
122 <img src="data:image/png;base64,{{ output.png }}"
126 <img src="data:image/png;base64,{{ output.png }}"
123 {%- if 'metadata' in output and 'width' in output.metadata.get('png', {}) %}
127 {%- if 'metadata' in output and 'width' in output.metadata.get('png', {}) %}
124 width={{output.metadata['png']['width']}}
128 width={{output.metadata['png']['width']}}
125 {%- endif %}
129 {%- endif %}
126 {%- if 'metadata' in output and 'height' in output.metadata.get('png', {}) %}
130 {%- if 'metadata' in output and 'height' in output.metadata.get('png', {}) %}
127 height={{output.metadata['png']['height']}}
131 height={{output.metadata['png']['height']}}
128 {%- endif %}
132 {%- endif %}
129 >
133 >
130 {%- endblock data_png %}
134 {%- endblock data_png %}
131
135
132 {% block data_jpg %}
136 {% block data_jpg %}
133 <img src="data:image/jpeg;base64,{{ output.jpeg }}"
137 <img src="data:image/jpeg;base64,{{ output.jpeg }}"
134 {%- if 'metadata' in output and 'width' in output.metadata.get('jpeg', {}) %}
138 {%- if 'metadata' in output and 'width' in output.metadata.get('jpeg', {}) %}
135 width={{output.metadata['jpeg']['width']}}
139 width={{output.metadata['jpeg']['width']}}
136 {%- endif %}
140 {%- endif %}
137 {%- if 'metadata' in output and 'height' in output.metadata.get('jpeg', {}) %}
141 {%- if 'metadata' in output and 'height' in output.metadata.get('jpeg', {}) %}
138 height={{output.metadata['jpeg']['height']}}
142 height={{output.metadata['jpeg']['height']}}
139 {%- endif %}
143 {%- endif %}
140 >
144 >
141 {%- endblock data_jpg %}
145 {%- endblock data_jpg %}
142
146
143 {% block data_latex %}
147 {% block data_latex %}
144 {{ output.latex }}
148 {{ output.latex }}
145 {%- endblock data_latex %}
149 {%- endblock data_latex %}
146
150
147 {% block pyerr -%}
151 {% block pyerr -%}
148 <div class="box-flex1 output_subarea output_pyerr">
152 <div class="box-flex1 output_subarea output_pyerr">
149 <pre>{{ super() }}</pre>
153 <pre>{{ super() }}</pre>
150 </div>
154 </div>
151 {%- endblock pyerr %}
155 {%- endblock pyerr %}
152
156
153 {%- block traceback_line %}
157 {%- block traceback_line %}
154 {{ line | ansi2html }}
158 {{ line | ansi2html }}
155 {%- endblock traceback_line %}
159 {%- endblock traceback_line %}
156
160
157 {%- block data_text %}
161 {%- block data_text %}
158 <pre>
162 <pre>
159 {{ output.text | ansi2html }}
163 {{ output.text | ansi2html }}
160 </pre>
164 </pre>
161 {%- endblock -%}
165 {%- endblock -%}
162
166
163 {%- block data_javascript %}
167 {%- block data_javascript %}
164 <script type="text/javascript">
168 <script type="text/javascript">
165 {{ output.javascript }}
169 {{ output.javascript }}
166 </script>
170 </script>
167 {%- endblock -%}
171 {%- endblock -%}
168
172
169 {%- block display_data scoped -%}
173 {%- block display_data scoped -%}
170 <div class="box-flex1 output_subarea output_display_data">
174 <div class="box-flex1 output_subarea output_display_data">
171 {{ super() }}
175 {{ super() }}
172 </div>
176 </div>
173 {%- endblock display_data -%}
177 {%- endblock display_data -%}
General Comments 0
You need to be logged in to leave comments. Login now