##// 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 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 23 {% block codecell scoped %}
4 24 {% block in_prompt %}{% endblock in_prompt %}
5 25 {% block input %}{% endblock input %}
6 26 {% if cell.outputs %}
7 27 {% block output_prompt %}{% endblock output_prompt %}
8 28 {%- for output in cell.outputs -%}
9 29 {%- if output.output_type in ['pyout']%}
10 30 {% block pyout scoped %}{% endblock pyout %}
11 31 {%- elif output.output_type in ['stream'] %}
12 32 {% block stream scoped %}{% endblock stream %}
13 33 {%- elif output.output_type in ['display_data'] %}
14 34 {% block display_data scoped %}{% endblock display_data %}
15 35 {%- elif output.output_type in ['pyerr'] %}
16 36 {% block pyerr scoped %}
17 37 {%- for line in output.traceback %}
18 38 {% block traceback_line scoped %}{% endblock traceback_line %}
19 39 {%- endfor %}
20 40 {% endblock pyerr %}
21 41 {%- endif %}
22 42 {%- endfor -%}
23 43 {% endif %}
24 44
25 45 {% endblock codecell %}
26 46
27 47 {% block markdowncell scoped %}
28 48 {% endblock markdowncell %}
29 49
30 50 {% block headingcell scoped %}
31 51 {% endblock headingcell %}
32 52
33 53 {% block rawcell scoped %}
34 54 {% endblock rawcell %}
35 55
36 56 {% block unknowncell scoped %}
37 57 {% endblock unknowncell %}
General Comments 0
You need to be logged in to leave comments. Login now