##// END OF EJS Templates
inheritance example and doc
Matthias BUSSONNIER -
Show More
@@ -0,0 +1,10
1 {%- extends 'python.tpl' -%}
2
3 {% block codecell %}
4 ==============================
5 =======start codecell=========
6 {{ super() }}
7 ======= end codecell =========
8 ==============================
9 {% endblock codecell %}
10
@@ -1,37 +1,57
1 {%- extends 'basic.tpl' -%}
1 {%- extends 'basic.tpl' -%}
2
2
3 {#
4
5 Null template, Does nothing except defining a basic structure
6 To layout the diferents blocks of a notebook.
7
8 Subtemplates can Override Blocks to define their custom reresentation.
9
10 If one of the block you do overrite is nt a leave block, consider
11 calling super.
12
13 {% block nonLeaveBlock %}
14 #add stuff at beginning
15 {{ super() }}
16 #add stuff at end
17 {% endblock nonLeaveBlock %}
18
19 consider calling super even if block is leave block, we might insert more block later.
20
21 #}
22
3 {% block codecell scoped %}
23 {% block codecell scoped %}
4 {% block in_prompt %}{% endblock in_prompt %}
24 {% block in_prompt %}{% endblock in_prompt %}
5 {% block input %}{% endblock input %}
25 {% block input %}{% endblock input %}
6 {% if cell.outputs %}
26 {% if cell.outputs %}
7 {% block output_prompt %}{% endblock output_prompt %}
27 {% block output_prompt %}{% endblock output_prompt %}
8 {%- for output in cell.outputs -%}
28 {%- for output in cell.outputs -%}
9 {%- if output.output_type in ['pyout']%}
29 {%- if output.output_type in ['pyout']%}
10 {% block pyout scoped %}{% endblock pyout %}
30 {% block pyout scoped %}{% endblock pyout %}
11 {%- elif output.output_type in ['stream'] %}
31 {%- elif output.output_type in ['stream'] %}
12 {% block stream scoped %}{% endblock stream %}
32 {% block stream scoped %}{% endblock stream %}
13 {%- elif output.output_type in ['display_data'] %}
33 {%- elif output.output_type in ['display_data'] %}
14 {% block display_data scoped %}{% endblock display_data %}
34 {% block display_data scoped %}{% endblock display_data %}
15 {%- elif output.output_type in ['pyerr'] %}
35 {%- elif output.output_type in ['pyerr'] %}
16 {% block pyerr scoped %}
36 {% block pyerr scoped %}
17 {%- for line in output.traceback %}
37 {%- for line in output.traceback %}
18 {% block traceback_line scoped %}{% endblock traceback_line %}
38 {% block traceback_line scoped %}{% endblock traceback_line %}
19 {%- endfor %}
39 {%- endfor %}
20 {% endblock pyerr %}
40 {% endblock pyerr %}
21 {%- endif %}
41 {%- endif %}
22 {%- endfor -%}
42 {%- endfor -%}
23 {% endif %}
43 {% endif %}
24
44
25 {% endblock codecell %}
45 {% endblock codecell %}
26
46
27 {% block markdowncell scoped %}
47 {% block markdowncell scoped %}
28 {% endblock markdowncell %}
48 {% endblock markdowncell %}
29
49
30 {% block headingcell scoped %}
50 {% block headingcell scoped %}
31 {% endblock headingcell %}
51 {% endblock headingcell %}
32
52
33 {% block rawcell scoped %}
53 {% block rawcell scoped %}
34 {% endblock rawcell %}
54 {% endblock rawcell %}
35
55
36 {% block unknowncell scoped %}
56 {% block unknowncell scoped %}
37 {% endblock unknowncell %}
57 {% endblock unknowncell %}
General Comments 0
You need to be logged in to leave comments. Login now