Show More
@@ -1,121 +1,132 b'' | |||||
1 | {%- extends 'display_priority.tpl' -%} |
|
1 | {%- extends 'display_priority.tpl' -%} | |
2 |
|
2 | |||
3 |
|
3 | |||
4 |
|
4 | |||
5 | {% block codecell %} |
|
5 | {% block codecell %} | |
6 | <div class="cell border-box-sizing code_cell vbox"> |
|
6 | <div class="cell border-box-sizing code_cell vbox"> | |
7 | {{ super() }}</div> |
|
7 | {{ super() }}</div> | |
8 | {%- endblock codecell %} |
|
8 | {%- endblock codecell %} | |
9 |
|
9 | |||
10 | {% block input_group -%} |
|
10 | {% block input_group -%} | |
11 | <div class="input hbox"> |
|
11 | <div class="input hbox"> | |
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="vbox output_wrapper"> |
|
17 | <div class="vbox output_wrapper"> | |
18 | <div class="output vbox"> |
|
18 | <div class="output vbox"> | |
19 | <div class="hbox output_area"> |
|
19 | <div class="hbox output_area"> | |
20 | {{ super() }} |
|
20 | {{ super() }} | |
21 | </div> |
|
21 | </div> | |
22 | </div> |
|
22 | </div> | |
23 | </div> |
|
23 | </div> | |
24 | {% endblock output_group %} |
|
24 | {% endblock output_group %} | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | {% block in_prompt -%} |
|
27 | {% block in_prompt -%} | |
28 | <div class="prompt input_prompt">In [{{cell.prompt_number}}]:</div> |
|
28 | <div class="prompt input_prompt">In [{{cell.prompt_number}}]:</div> | |
29 | {%- endblock in_prompt %} |
|
29 | {%- endblock in_prompt %} | |
30 |
|
30 | |||
31 | {% block output_prompt -%} |
|
31 | {% block output_prompt -%} | |
32 | <div class="prompt output_prompt"> |
|
32 | <div class="prompt output_prompt"> | |
33 | {%- if cell.haspyout -%} |
|
33 | {%- if cell.haspyout -%} | |
34 | Out[{{cell.prompt_number}}]: |
|
34 | Out[{{cell.prompt_number}}]: | |
35 | {%- endif -%} |
|
35 | {%- endif -%} | |
36 | </div> |
|
36 | </div> | |
37 | {% endblock output_prompt %} |
|
37 | {% endblock output_prompt %} | |
38 |
|
38 | |||
39 | {% block input %} |
|
39 | {% block input %} | |
40 | <div class="input_area box-flex1"> |
|
40 | <div class="input_area box-flex1"> | |
41 | {{cell.input | highlight }} |
|
41 | {{cell.input | highlight }} | |
42 | </div> |
|
42 | </div> | |
43 | {%- endblock input %} |
|
43 | {%- endblock input %} | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | {% block markdowncell scoped %} |
|
46 | {% block markdowncell scoped %} | |
47 | <div class="text_cell_render border-box-sizing rendered_html"> |
|
47 | <div class="text_cell_render border-box-sizing rendered_html"> | |
48 | {{ cell.source | markdown| rm_fake}} |
|
48 | {{ cell.source | markdown| rm_fake}} | |
49 | </div> |
|
49 | </div> | |
50 | {%- endblock markdowncell %} |
|
50 | {%- endblock markdowncell %} | |
51 |
|
51 | |||
52 | {% block headingcell scoped %} |
|
52 | {% block headingcell scoped %} | |
53 | <div class="text_cell_render border-box-sizing rendered_html"> |
|
53 | <div class="text_cell_render border-box-sizing rendered_html"> | |
54 | <h{{cell.level}}> |
|
54 | <h{{cell.level}}> | |
55 | {{cell.source}} |
|
55 | {{cell.source}} | |
56 | </h{{cell.level}}> |
|
56 | </h{{cell.level}}> | |
57 | </div> |
|
57 | </div> | |
58 | {% endblock headingcell %} |
|
58 | {% endblock headingcell %} | |
59 |
|
59 | |||
60 | {% block rawcell scoped %} |
|
60 | {% block rawcell scoped %} | |
61 | {{ cell.source }} |
|
61 | {{ cell.source }} | |
62 | {% endblock rawcell %} |
|
62 | {% endblock rawcell %} | |
63 |
|
63 | |||
64 | {% block unknowncell scoped %} |
|
64 | {% block unknowncell scoped %} | |
65 | unknown type {{cell.type}} |
|
65 | unknown type {{cell.type}} | |
66 | {% endblock unknowncell %} |
|
66 | {% endblock unknowncell %} | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | {% block pyout -%} |
|
69 | {% block pyout -%} | |
70 | <div class="output_subarea output_pyout"> |
|
70 | <div class="output_subarea output_pyout"> | |
71 | {% block data_priority scoped %}{{ super()}}{% endblock %} |
|
71 | {% block data_priority scoped %}{{ super()}}{% endblock %} | |
72 | </div> |
|
72 | </div> | |
73 | {%- endblock pyout %} |
|
73 | {%- endblock pyout %} | |
74 |
|
74 | |||
75 | {% block stream -%} |
|
75 | {% block stream_stdout -%} | |
76 | <div class="output_subarea output_stream output_stdout"> |
|
76 | <div class="output_subarea output_stream output_stdout"> | |
77 | <pre>{{output.text |ansi2html}}</pre> |
|
77 | <pre>{{output.text |ansi2html}}</pre> | |
78 | </div> |
|
78 | </div> | |
79 | {%- endblock stream %} |
|
79 | {%- endblock stream_stdout %} | |
|
80 | ||||
|
81 | {% block stream_stderr -%} | |||
|
82 | <div class="output_subarea output_stream output_stderr"> | |||
|
83 | <pre>{{output.text |ansi2html}}</pre> | |||
|
84 | </div> | |||
|
85 | {%- endblock stream_stderr %} | |||
80 |
|
86 | |||
81 | {% block data_svg -%} |
|
87 | {% block data_svg -%} | |
82 | {{output.svg}} |
|
88 | {{output.svg}} | |
83 | </div> |
|
|||
84 | {%- endblock data_svg %} |
|
89 | {%- endblock data_svg %} | |
85 |
|
90 | |||
86 |
|
91 | |||
87 | {% block data_html %} |
|
92 | {% block data_html -%} | |
|
93 | <div class="output_html rendered_html"> | |||
88 | {{output.html}} |
|
94 | {{output.html}} | |
89 | </div> |
|
95 | </div> | |
90 | {%- endblock data_html %} |
|
96 | {%- endblock data_html %} | |
91 |
|
97 | |||
92 | {% block data_png %} |
|
98 | {% block data_png %} | |
93 | <img src="data:image/png;base64,{{output.png}}"></img> |
|
99 | <img src="data:image/png;base64,{{output.png}}"></img> | |
94 | </div> |
|
|||
95 | {%- endblock data_png %} |
|
100 | {%- endblock data_png %} | |
96 |
|
101 | |||
97 |
|
102 | |||
98 | {% block data_jpg %} |
|
103 | {% block data_jpg %} | |
99 | <img src="data:image/jpeg;base64,{{output.jpeg}}"></img> |
|
104 | <img src="data:image/jpeg;base64,{{output.jpeg}}"></img> | |
100 | </div> |
|
|||
101 | {%- endblock data_jpg %} |
|
105 | {%- endblock data_jpg %} | |
102 |
|
106 | |||
103 |
|
107 | |||
104 | {% block data_latex %} |
|
108 | {% block data_latex %} | |
105 | {{output.latex}} |
|
109 | {{output.latex}} | |
106 | {%- endblock data_latex %} |
|
110 | {%- endblock data_latex %} | |
107 |
|
111 | |||
108 | {% block pyerr -%} |
|
112 | {% block pyerr -%} | |
109 | <div class="output_subarea output_pyerr"> |
|
113 | <div class="output_subarea output_pyerr"> | |
110 | <pre>{{super()}}</pre> |
|
114 | <pre>{{super()}}</pre> | |
111 | </div> |
|
115 | </div> | |
112 | {%- endblock pyerr %} |
|
116 | {%- endblock pyerr %} | |
113 |
|
117 | |||
114 | {%- block traceback_line %} |
|
118 | {%- block traceback_line %} | |
115 | {{line| ansi2html}} |
|
119 | {{line| ansi2html}} | |
116 | {%- endblock traceback_line %} |
|
120 | {%- endblock traceback_line %} | |
117 |
|
121 | |||
118 |
|
122 | |||
119 | {%- block data_text %} |
|
123 | {%- block data_text %} | |
120 | <pre>{{output.text |Β ansi2html}}</pre> |
|
124 | <pre>{{output.text |Β ansi2html}}</pre> | |
121 | {%- endblock -%} |
|
125 | {%- endblock -%} | |
|
126 | ||||
|
127 | ||||
|
128 | {%- block display_data scoped -%} | |||
|
129 | <div class="output_subarea output_display_data"> | |||
|
130 | {{super()}} | |||
|
131 | </div> | |||
|
132 | {%- endblock display_data -%} |
@@ -1,81 +1,89 b'' | |||||
1 | {# |
|
1 | {# | |
2 |
|
2 | |||
3 | DO NOT USE THIS AS A BASE WORK, |
|
3 | DO NOT USE THIS AS A BASE WORK, | |
4 | IF YOU ARE COPY AND PASTING THIS FILE |
|
4 | IF YOU ARE COPY AND PASTING THIS FILE | |
5 | YOU ARE PROBABLY DOING THINGS WRONG. |
|
5 | YOU ARE PROBABLY DOING THINGS WRONG. | |
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 diferents blocks of a notebook. |
|
8 | To layout the diferents blocks of a notebook. | |
9 |
|
9 | |||
10 | Subtemplates can Override Blocks to define their custom reresentation. |
|
10 | Subtemplates can Override Blocks to define their custom reresentation. | |
11 |
|
11 | |||
12 | If one of the block you do overrite is not a leave block, consider |
|
12 | If one of the block you do overrite 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 block is leave block, we might insert more block later. |
|
21 | consider calling super even if block is leave block, we might insert more block 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 worksheets -%} |
|
27 | {%- for worksheet in 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.type in ['code'] -%} |
|
30 | {%- if 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 -%} |
|
39 | {%- block outputs -%} | |
40 | {%- for output in cell.outputs -%} |
|
40 | {%- for output in cell.outputs -%} | |
41 | {%- if output.output_type in ['pyout'] -%} |
|
41 | {%- if output.output_type in ['pyout'] -%} | |
42 | {%- block pyout scoped -%}{%- endblock pyout -%} |
|
42 | {%- block pyout scoped -%}{%- endblock pyout -%} | |
43 | {%- elif output.output_type in ['stream'] -%} |
|
43 | {%- elif output.output_type in ['stream'] -%} | |
44 |
{%- block stream scoped -%} |
|
44 | {%- block stream scoped -%} | |
|
45 | {%- if output.stream in ['stdout'] -%} | |||
|
46 | {%- block stream_stdout scoped -%} | |||
|
47 | {%- endblock stream_stdout -%} | |||
|
48 | {%- elif output.stream in ['stderr'] -%} | |||
|
49 | {%- block stream_stderr scoped -%} | |||
|
50 | {%- endblock stream_stderr -%} | |||
|
51 | {%- endif -%} | |||
|
52 | {%- endblock stream -%} | |||
45 | {%- elif output.output_type in ['display_data'] -%} |
|
53 | {%- elif output.output_type in ['display_data'] -%} | |
46 | {%- block display_data scoped -%} |
|
54 | {%- block display_data scoped -%} | |
47 | {%- block data_priority scoped -%} |
|
55 | {%- block data_priority scoped -%} | |
48 | {%- endblock data_priority -%} |
|
56 | {%- endblock data_priority -%} | |
49 | {%- endblock display_data -%} |
|
57 | {%- endblock display_data -%} | |
50 | {%- elif output.output_type in ['pyerr'] -%} |
|
58 | {%- elif output.output_type in ['pyerr'] -%} | |
51 | {%- block pyerr scoped -%} |
|
59 | {%- block pyerr scoped -%} | |
52 | {%- for line in output.traceback -%} |
|
60 | {%- for line in output.traceback -%} | |
53 | {%- block traceback_line scoped -%}{%- endblock traceback_line -%} |
|
61 | {%- block traceback_line scoped -%}{%- endblock traceback_line -%} | |
54 | {%- endfor -%} |
|
62 | {%- endfor -%} | |
55 | {%- endblock pyerr -%} |
|
63 | {%- endblock pyerr -%} | |
56 | {%- endif -%} |
|
64 | {%- endif -%} | |
57 | {%- endfor -%} |
|
65 | {%- endfor -%} | |
58 | {%- endblock outputs -%} |
|
66 | {%- endblock outputs -%} | |
59 | {%- endblock output_group -%} |
|
67 | {%- endblock output_group -%} | |
60 | {%- endif -%} |
|
68 | {%- endif -%} | |
61 | {%- endblock codecell -%} |
|
69 | {%- endblock codecell -%} | |
62 | {%- elif cell.type in ['markdown'] -%} |
|
70 | {%- elif cell.type in ['markdown'] -%} | |
63 | {%- block markdowncell scoped-%} |
|
71 | {%- block markdowncell scoped-%} | |
64 | {%- endblock markdowncell -%} |
|
72 | {%- endblock markdowncell -%} | |
65 | {%- elif cell.type in ['heading'] -%} |
|
73 | {%- elif cell.type in ['heading'] -%} | |
66 | {%- block headingcell scoped-%} |
|
74 | {%- block headingcell scoped-%} | |
67 | {%- endblock headingcell -%} |
|
75 | {%- endblock headingcell -%} | |
68 | {%- elif cell.type in ['raw'] -%} |
|
76 | {%- elif cell.type in ['raw'] -%} | |
69 | {%- block rawcell scoped-%} |
|
77 | {%- block rawcell scoped-%} | |
70 | {%- endblock rawcell -%} |
|
78 | {%- endblock rawcell -%} | |
71 | {%- else -%} |
|
79 | {%- else -%} | |
72 | {%- block unknowncell scoped-%} |
|
80 | {%- block unknowncell scoped-%} | |
73 | {%- endblock unknowncell -%} |
|
81 | {%- endblock unknowncell -%} | |
74 | {%- endif -%} |
|
82 | {%- endif -%} | |
75 | {%- endblock any_cell -%} |
|
83 | {%- endblock any_cell -%} | |
76 | {%- endfor -%} |
|
84 | {%- endfor -%} | |
77 | {%- endfor -%} |
|
85 | {%- endfor -%} | |
78 | {%- endblock body -%} |
|
86 | {%- endblock body -%} | |
79 |
|
87 | |||
80 | {%- block footer -%} |
|
88 | {%- block footer -%} | |
81 | {%- endblock footer -%} |
|
89 | {%- endblock footer -%} |
General Comments 0
You need to be logged in to leave comments.
Login now