##// END OF EJS Templates
Restructuration of null.tpl and addition of inner_cell classes.
damianavila -
Show More
@@ -1,147 +1,163 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 {#
30 {#
31 output_prompt doesn't do anything in HTML,
31 output_prompt doesn't do anything in HTML,
32 because there is a prompt div in each output area (see output block)
32 because there is a prompt div in each output area (see output block)
33 #}
33 #}
34 {% block output_prompt %}
34 {% block output_prompt %}
35 {% endblock output_prompt %}
35 {% endblock output_prompt %}
36
36
37 {% block input %}
37 {% block input %}
38 <div class="input_area box-flex1">
38 <div class="input_area box-flex1">
39 {{ cell.input | highlight2html(metadata=cell.metadata) }}
39 {{ cell.input | highlight2html(metadata=cell.metadata) }}
40 </div>
40 </div>
41 {%- endblock input %}
41 {%- endblock input %}
42
42
43 {% block output %}
43 {% block output %}
44 <div class="output_area">
44 <div class="output_area">
45 {%- if output.output_type == 'pyout' -%}
45 {%- if output.output_type == 'pyout' -%}
46 <div class="prompt output_prompt">
46 <div class="prompt output_prompt">
47 Out[{{ cell.prompt_number }}]:
47 Out[{{ cell.prompt_number }}]:
48 {%- else -%}
48 {%- else -%}
49 <div class="prompt">
49 <div class="prompt">
50 {%- endif -%}
50 {%- endif -%}
51 </div>
51 </div>
52 {{ super() }}
52 {{ super() }}
53 </div>
53 </div>
54 {% endblock output %}
54 {% endblock output %}
55
55
56 {% block markdowncell scoped %}
56 {% block e_in_prompt -%}
57 <div class="text_cell_render border-box-sizing rendered_html">
57 <div class="prompt input_prompt">
58 <div class="prompt input_prompt"></div>
58 </div>
59 {%- endblock e_in_prompt %}
60
61 {% block m_input %}
59 <div class="inner_cell">
62 <div class="inner_cell">
63 <div class="text_cell_render border-box-sizing rendered_html">
60 {{ cell.source | markdown2html | strip_files_prefix }}
64 {{ cell.source | markdown2html | strip_files_prefix }}
61 </div>
65 </div>
62 </div>
66 </div>
63 {%- endblock markdowncell %}
67 {%- endblock m_input %}
64
68
65 {% block headingcell scoped %}
69 {% block h_input %}
70 <div class="inner_cell">
66 <div class="text_cell_render border-box-sizing rendered_html">
71 <div class="text_cell_render border-box-sizing rendered_html">
67 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
72 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
68 </div>
73 </div>
69 {% endblock headingcell %}
74 </div>
75 {% endblock h_input %}
76
77 {% block r_input %}
78 <div class="inner_cell">
79 {% if cell.metadata.get('raw_mimetype', resources.get('raw_mimetype', '')).lower() in resources.get('raw_mimetypes', ['']) %}
80 {{ cell.source }}
81 {% endif %}
82 </div>
83 {% endblock r_input %}
70
84
71 {% block unknowncell scoped %}
85 {% block u_input %}
86 <div class="inner_cell">
72 unknown type {{ cell.type }}
87 unknown type {{ cell.type }}
73 {% endblock unknowncell %}
88 </div>
89 {% endblock u_input %}
74
90
75 {% block pyout -%}
91 {% block pyout -%}
76 <div class="box-flex1 output_subarea output_pyout">
92 <div class="box-flex1 output_subarea output_pyout">
77 {% block data_priority scoped %}
93 {% block data_priority scoped %}
78 {{ super() }}
94 {{ super() }}
79 {% endblock %}
95 {% endblock %}
80 </div>
96 </div>
81 {%- endblock pyout %}
97 {%- endblock pyout %}
82
98
83 {% block stream_stdout -%}
99 {% block stream_stdout -%}
84 <div class="box-flex1 output_subarea output_stream output_stdout">
100 <div class="box-flex1 output_subarea output_stream output_stdout">
85 <pre>
101 <pre>
86 {{ output.text | ansi2html }}
102 {{ output.text | ansi2html }}
87 </pre>
103 </pre>
88 </div>
104 </div>
89 {%- endblock stream_stdout %}
105 {%- endblock stream_stdout %}
90
106
91 {% block stream_stderr -%}
107 {% block stream_stderr -%}
92 <div class="box-flex1 output_subarea output_stream output_stderr">
108 <div class="box-flex1 output_subarea output_stream output_stderr">
93 <pre>
109 <pre>
94 {{ output.text | ansi2html }}
110 {{ output.text | ansi2html }}
95 </pre>
111 </pre>
96 </div>
112 </div>
97 {%- endblock stream_stderr %}
113 {%- endblock stream_stderr %}
98
114
99 {% block data_svg -%}
115 {% block data_svg -%}
100 {{ output.svg }}
116 {{ output.svg }}
101 {%- endblock data_svg %}
117 {%- endblock data_svg %}
102
118
103 {% block data_html -%}
119 {% block data_html -%}
104 <div class="output_html rendered_html">
120 <div class="output_html rendered_html">
105 {{ output.html }}
121 {{ output.html }}
106 </div>
122 </div>
107 {%- endblock data_html %}
123 {%- endblock data_html %}
108
124
109 {% block data_png %}
125 {% block data_png %}
110 <img src="data:image/png;base64,{{ output.png }}">
126 <img src="data:image/png;base64,{{ output.png }}">
111 {%- endblock data_png %}
127 {%- endblock data_png %}
112
128
113 {% block data_jpg %}
129 {% block data_jpg %}
114 <img src="data:image/jpeg;base64,{{ output.jpeg }}">
130 <img src="data:image/jpeg;base64,{{ output.jpeg }}">
115 {%- endblock data_jpg %}
131 {%- endblock data_jpg %}
116
132
117 {% block data_latex %}
133 {% block data_latex %}
118 {{ output.latex }}
134 {{ output.latex }}
119 {%- endblock data_latex %}
135 {%- endblock data_latex %}
120
136
121 {% block pyerr -%}
137 {% block pyerr -%}
122 <div class="box-flex1 output_subarea output_pyerr">
138 <div class="box-flex1 output_subarea output_pyerr">
123 <pre>{{ super() }}</pre>
139 <pre>{{ super() }}</pre>
124 </div>
140 </div>
125 {%- endblock pyerr %}
141 {%- endblock pyerr %}
126
142
127 {%- block traceback_line %}
143 {%- block traceback_line %}
128 {{ line | ansi2html }}
144 {{ line | ansi2html }}
129 {%- endblock traceback_line %}
145 {%- endblock traceback_line %}
130
146
131 {%- block data_text %}
147 {%- block data_text %}
132 <pre>
148 <pre>
133 {{ output.text | ansi2html }}
149 {{ output.text | ansi2html }}
134 </pre>
150 </pre>
135 {%- endblock -%}
151 {%- endblock -%}
136
152
137 {%- block data_javascript %}
153 {%- block data_javascript %}
138 <script type="text/javascript">
154 <script type="text/javascript">
139 {{ output.javascript }}
155 {{ output.javascript }}
140 </script>
156 </script>
141 {%- endblock -%}
157 {%- endblock -%}
142
158
143 {%- block display_data scoped -%}
159 {%- block display_data scoped -%}
144 <div class="box-flex1 output_subarea output_display_data">
160 <div class="box-flex1 output_subarea output_display_data">
145 {{ super() }}
161 {{ super() }}
146 </div>
162 </div>
147 {%- endblock display_data -%}
163 {%- endblock display_data -%}
@@ -1,94 +1,106 b''
1 {#
1 {#
2
2
3 DO NOT USE THIS AS A BASE,
3 DO NOT USE THIS AS A BASE,
4 IF YOU ARE COPY AND PASTING THIS FILE
4 IF YOU ARE COPY AND PASTING THIS FILE
5 YOU ARE PROBABLY DOING THINGS INCORRECTLY.
5 YOU ARE PROBABLY DOING THINGS INCORRECTLY.
6
6
7 Null template, does nothing except defining a basic structure
7 Null template, does nothing except defining a basic structure
8 To layout the different blocks of a notebook.
8 To layout the different blocks of a notebook.
9
9
10 Subtemplates can override blocks to define their custom representation.
10 Subtemplates can override blocks to define their custom representation.
11
11
12 If one of the block you do overwrite is not a leave block, consider
12 If one of the block you do overwrite is not a leave block, consider
13 calling super.
13 calling super.
14
14
15 {%- block nonLeaveBlock -%}
15 {%- block nonLeaveBlock -%}
16 #add stuff at beginning
16 #add stuff at beginning
17 {{ super() }}
17 {{ super() }}
18 #add stuff at end
18 #add stuff at end
19 {%- endblock nonLeaveBlock -%}
19 {%- endblock nonLeaveBlock -%}
20
20
21 consider calling super even if it is a leave block, we might insert more blocks later.
21 consider calling super even if it is a leave block, we might insert more blocks later.
22
22
23 #}
23 #}
24 {%- block header -%}
24 {%- block header -%}
25 {%- endblock header -%}
25 {%- endblock header -%}
26 {%- block body -%}
26 {%- block body -%}
27 {%- for worksheet in nb.worksheets -%}
27 {%- for worksheet in nb.worksheets -%}
28 {%- for cell in worksheet.cells -%}
28 {%- for cell in worksheet.cells -%}
29 {%- block any_cell scoped -%}
29 {%- block any_cell scoped -%}
30 {%- if cell.cell_type in ['code'] -%}
30 {%- if cell.cell_type in ['code'] -%}
31 {%- block codecell scoped -%}
31 {%- block codecell scoped -%}
32 {%- block input_group -%}
32 {%- block input_group -%}
33 {%- block in_prompt -%}{%- endblock in_prompt -%}
33 {%- block in_prompt -%}{%- endblock in_prompt -%}
34 {%- block input -%}{%- endblock input -%}
34 {%- block input -%}{%- endblock input -%}
35 {%- endblock input_group -%}
35 {%- endblock input_group -%}
36 {%- if cell.outputs -%}
36 {%- if cell.outputs -%}
37 {%- block output_group -%}
37 {%- block output_group -%}
38 {%- block output_prompt -%}{%- endblock output_prompt -%}
38 {%- block output_prompt -%}{%- endblock output_prompt -%}
39 {%- block outputs scoped -%}
39 {%- block outputs scoped -%}
40 {%- for output in cell.outputs -%}
40 {%- for output in cell.outputs -%}
41 {%- block output scoped -%}
41 {%- block output scoped -%}
42 {%- if output.output_type in ['pyout'] -%}
42 {%- if output.output_type in ['pyout'] -%}
43 {%- block pyout scoped -%}{%- endblock pyout -%}
43 {%- block pyout scoped -%}{%- endblock pyout -%}
44 {%- elif output.output_type in ['stream'] -%}
44 {%- elif output.output_type in ['stream'] -%}
45 {%- block stream scoped -%}
45 {%- block stream scoped -%}
46 {%- if output.stream in ['stdout'] -%}
46 {%- if output.stream in ['stdout'] -%}
47 {%- block stream_stdout scoped -%}
47 {%- block stream_stdout scoped -%}
48 {%- endblock stream_stdout -%}
48 {%- endblock stream_stdout -%}
49 {%- elif output.stream in ['stderr'] -%}
49 {%- elif output.stream in ['stderr'] -%}
50 {%- block stream_stderr scoped -%}
50 {%- block stream_stderr scoped -%}
51 {%- endblock stream_stderr -%}
51 {%- endblock stream_stderr -%}
52 {%- endif -%}
52 {%- endif -%}
53 {%- endblock stream -%}
53 {%- endblock stream -%}
54 {%- elif output.output_type in ['display_data'] -%}
54 {%- elif output.output_type in ['display_data'] -%}
55 {%- block display_data scoped -%}
55 {%- block display_data scoped -%}
56 {%- block data_priority scoped -%}
56 {%- block data_priority scoped -%}
57 {%- endblock data_priority -%}
57 {%- endblock data_priority -%}
58 {%- endblock display_data -%}
58 {%- endblock display_data -%}
59 {%- elif output.output_type in ['pyerr'] -%}
59 {%- elif output.output_type in ['pyerr'] -%}
60 {%- block pyerr scoped -%}
60 {%- block pyerr scoped -%}
61 {%- for line in output.traceback -%}
61 {%- for line in output.traceback -%}
62 {%- block traceback_line scoped -%}{%- endblock traceback_line -%}
62 {%- block traceback_line scoped -%}{%- endblock traceback_line -%}
63 {%- endfor -%}
63 {%- endfor -%}
64 {%- endblock pyerr -%}
64 {%- endblock pyerr -%}
65 {%- endif -%}
65 {%- endif -%}
66 {%- endblock output -%}
66 {%- endblock output -%}
67 {%- endfor -%}
67 {%- endfor -%}
68 {%- endblock outputs -%}
68 {%- endblock outputs -%}
69 {%- endblock output_group -%}
69 {%- endblock output_group -%}
70 {%- endif -%}
70 {%- endif -%}
71 {%- endblock codecell -%}
71 {%- endblock codecell -%}
72 {%- elif cell.cell_type in ['markdown'] -%}
72 {%- elif cell.cell_type in ['markdown'] -%}
73 {%- block markdowncell scoped-%}
73 {%- block markdowncell scoped-%}
74 {%- block input_group -%}
75 {%- block e_in_prompt -%}{%- endblock e_in_prompt -%}
76 {%- block m_input -%}{%- endblock m_input -%}
77 {%- endblock input_group -%}
74 {%- endblock markdowncell -%}
78 {%- endblock markdowncell -%}
75 {%- elif cell.cell_type in ['heading'] -%}
79 {%- elif cell.cell_type in ['heading'] -%}
76 {%- block headingcell scoped-%}
80 {%- block headingcell scoped-%}
81 {%- block input_group -%}
82 {%- block e_in_prompt -%}{%- endblock e_in_prompt -%}
83 {%- block h_input -%}{%- endblock h_input -%}
84 {%- endblock input_group -%}
77 {%- endblock headingcell -%}
85 {%- endblock headingcell -%}
78 {%- elif cell.cell_type in ['raw'] -%}
86 {%- elif cell.cell_type in ['raw'] -%}
79 {%- block rawcell scoped -%}
87 {%- block rawcell scoped -%}
80 {% if cell.metadata.get('raw_mimetype', '').lower() in resources.get('raw_mimetypes', ['']) %}
88 {% if cell.metadata.get('raw_mimetype', '').lower() in resources.get('raw_mimetypes', ['']) %}
81 {{ cell.source }}
89 {{ cell.source }}
82 {% endif %}
90 {% endif %}
83 {%- endblock rawcell -%}
91 {%- endblock rawcell -%}
84 {%- else -%}
92 {%- else -%}
85 {%- block unknowncell scoped-%}
93 {%- block unknowncell scoped-%}
94 {%- block input_group -%}
95 {%- block e_in_prompt -%}{%- endblock e_in_prompt -%}
96 {%- block u_input -%}{%- endblock u_input -%}
97 {%- endblock input_group -%}
86 {%- endblock unknowncell -%}
98 {%- endblock unknowncell -%}
87 {%- endif -%}
99 {%- endif -%}
88 {%- endblock any_cell -%}
100 {%- endblock any_cell -%}
89 {%- endfor -%}
101 {%- endfor -%}
90 {%- endfor -%}
102 {%- endfor -%}
91 {%- endblock body -%}
103 {%- endblock body -%}
92
104
93 {%- block footer -%}
105 {%- block footer -%}
94 {%- endblock footer -%}
106 {%- endblock footer -%}
General Comments 0
You need to be logged in to leave comments. Login now