##// END OF EJS Templates
Merge pull request #4178 from minrk/data_javascript...
Min RK -
r12460:b743e16a merge
parent child Browse files
Show More
@@ -1,142 +1,148 b''
1 1 {%- extends 'display_priority.tpl' -%}
2 2
3 3
4 4 {% block codecell %}
5 5 <div class="cell border-box-sizing code_cell vbox">
6 6 {{ super() }}
7 7 </div>
8 8 {%- endblock codecell %}
9 9
10 10 {% block input_group -%}
11 11 <div class="input hbox">
12 12 {{ super() }}
13 13 </div>
14 14 {% endblock input_group %}
15 15
16 16 {% block output_group %}
17 17 <div class="vbox output_wrapper">
18 18 <div class="output vbox">
19 19 {{ super() }}
20 20 </div>
21 21 </div>
22 22 {% endblock output_group %}
23 23
24 24 {% block in_prompt -%}
25 25 <div class="prompt input_prompt">
26 26 In&nbsp;[{{ cell.prompt_number }}]:
27 27 </div>
28 28 {%- endblock in_prompt %}
29 29
30 30 {#
31 31 output_prompt doesn't do anything in HTML,
32 32 because there is a prompt div in each output area (see output block)
33 33 #}
34 34 {% block output_prompt %}
35 35 {% endblock output_prompt %}
36 36
37 37 {% block input %}
38 38 <div class="input_area box-flex1">
39 39 {{ cell.input | highlight2html }}
40 40 </div>
41 41 {%- endblock input %}
42 42
43 43 {% block output %}
44 44 <div class="hbox output_area">
45 45 {%- if output.output_type == 'pyout' -%}
46 46 <div class="prompt output_prompt">
47 47 Out[{{ cell.prompt_number }}]:
48 48 {%- else -%}
49 49 <div class="prompt">
50 50 {%- endif -%}
51 51 </div>
52 52 {{ super() }}
53 53 </div>
54 54 {% endblock output %}
55 55
56 56 {% block markdowncell scoped %}
57 57 <div class="text_cell_render border-box-sizing rendered_html">
58 58 {{ cell.source | strip_math_space | markdown2html | strip_files_prefix }}
59 59 </div>
60 60 {%- endblock markdowncell %}
61 61
62 62 {% block headingcell scoped %}
63 63 <div class="text_cell_render border-box-sizing rendered_html">
64 64 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }}
65 65 </div>
66 66 {% endblock headingcell %}
67 67
68 68 {% block rawcell scoped %}
69 69 {{ cell.source }}
70 70 {% endblock rawcell %}
71 71
72 72 {% block unknowncell scoped %}
73 73 unknown type {{ cell.type }}
74 74 {% endblock unknowncell %}
75 75
76 76 {% block pyout -%}
77 77 <div class="box-flex1 output_subarea output_pyout">
78 78 {% block data_priority scoped %}
79 79 {{ super() }}
80 80 {% endblock %}
81 81 </div>
82 82 {%- endblock pyout %}
83 83
84 84 {% block stream_stdout -%}
85 85 <div class="box-flex1 output_subarea output_stream output_stdout">
86 86 <pre>
87 87 {{ output.text | ansi2html }}
88 88 </pre>
89 89 </div>
90 90 {%- endblock stream_stdout %}
91 91
92 92 {% block stream_stderr -%}
93 93 <div class="box-flex1 output_subarea output_stream output_stderr">
94 94 <pre>
95 95 {{ output.text | ansi2html }}
96 96 </pre>
97 97 </div>
98 98 {%- endblock stream_stderr %}
99 99
100 100 {% block data_svg -%}
101 101 {{ output.svg }}
102 102 {%- endblock data_svg %}
103 103
104 104 {% block data_html -%}
105 105 <div class="output_html rendered_html">
106 106 {{ output.html }}
107 107 </div>
108 108 {%- endblock data_html %}
109 109
110 110 {% block data_png %}
111 111 <img src="data:image/png;base64,{{ output.png }}">
112 112 {%- endblock data_png %}
113 113
114 114 {% block data_jpg %}
115 115 <img src="data:image/jpeg;base64,{{ output.jpeg }}">
116 116 {%- endblock data_jpg %}
117 117
118 118 {% block data_latex %}
119 119 {{ output.latex }}
120 120 {%- endblock data_latex %}
121 121
122 122 {% block pyerr -%}
123 123 <div class="box-flex1 output_subarea output_pyerr">
124 124 <pre>{{ super() }}</pre>
125 125 </div>
126 126 {%- endblock pyerr %}
127 127
128 128 {%- block traceback_line %}
129 129 {{ line | ansi2html }}
130 130 {%- endblock traceback_line %}
131 131
132 132 {%- block data_text %}
133 133 <pre>
134 134 {{ output.text | ansi2html }}
135 135 </pre>
136 136 {%- endblock -%}
137 137
138 {%- block data_javascript %}
139 <script type="text/javascript">
140 {{ output.javascript }}
141 </script>
142 {%- endblock -%}
143
138 144 {%- block display_data scoped -%}
139 145 <div class="box-flex1 output_subarea output_display_data">
140 146 {{ super() }}
141 147 </div>
142 148 {%- endblock display_data -%} No newline at end of file
@@ -1,39 +1,42 b''
1 1 ((= autogenerated file do not edit =))
2 2 ((*- extends 'null.tplx' -*))
3 3
4 4 ((=display data priority=))
5 5
6 6
7 7 ((*- block data_priority scoped -*))
8 8 ((*- for type in output | filter_data_type -*))
9 9 ((*- if type in ['pdf']*))
10 10 ((*- block data_pdf -*))
11 11 ((*- endblock -*))
12 12 ((*- endif -*))
13 13 ((*- if type in ['svg']*))
14 14 ((*- block data_svg -*))
15 15 ((*- endblock -*))
16 16 ((*- endif -*))
17 17 ((*- if type in ['png']*))
18 18 ((*- block data_png -*))
19 19 ((*- endblock -*))
20 20 ((*- endif -*))
21 21 ((*- if type in ['html']*))
22 22 ((*- block data_html -*))
23 23 ((*- endblock -*))
24 24 ((*- endif -*))
25 25 ((*- if type in ['jpeg']*))
26 26 ((*- block data_jpg -*))
27 27 ((*- endblock -*))
28 28 ((*- endif -*))
29 29 ((*- if type in ['text']*))
30 30 ((*- block data_text -*))
31 31 ((*- endblock -*))
32 32 ((*- endif -*))
33
34 33 ((*- if type in ['latex']*))
35 34 ((*- block data_latex -*))
36 35 ((*- endblock -*))
37 36 ((*- endif -*))
37 ((*- if type in ['javascript']*))
38 ((*- block data_javascript -*))
39 ((*- endblock -*))
40 ((*- endif -*))
38 41 ((*- endfor -*))
39 42 ((*- endblock data_priority -*))
@@ -1,23 +1,23 b''
1 1
2 2
3 all: tex/null.tplx tex/display_priority.tplx
3 all: ../latex/skeleton/null.tplx ../latex/skeleton/display_priority.tplx
4 4
5 5 # convert jinja syntax to tex
6 6 # cf http://flask.pocoo.org/snippets/55/
7 tex/%.tplx: %.tpl
7 ../latex/skeleton/%.tplx: %.tpl
8 8 @echo 'generating tex equivalent of $^: $@'
9 9 @echo '((= autogenerated file do not edit =))' > $@
10 10 @sed \
11 11 -e 's/{%/((*/g' \
12 12 -e 's/%}/*))/g' \
13 13 -e 's/{{/(((/g' \
14 14 -e 's/}}/)))/g' \
15 15 -e 's/{#/((=/g' \
16 16 -e 's/#}/=))/g' \
17 17 -e "s/tpl'/tplx'/g" \
18 18 $^ >> $@
19 19
20 20
21 21 clean:
22 22 @echo "cleaning generated tplx files..."
23 @rm tex/*
23 @rm ../latex/skeleton/*
@@ -1,38 +1,41 b''
1 1 {%- extends 'null.tpl' -%}
2 2
3 3 {#display data priority#}
4 4
5 5
6 6 {%- block data_priority scoped -%}
7 7 {%- for type in output | filter_data_type -%}
8 8 {%- if type in ['pdf']%}
9 9 {%- block data_pdf -%}
10 10 {%- endblock -%}
11 11 {%- endif -%}
12 12 {%- if type in ['svg']%}
13 13 {%- block data_svg -%}
14 14 {%- endblock -%}
15 15 {%- endif -%}
16 16 {%- if type in ['png']%}
17 17 {%- block data_png -%}
18 18 {%- endblock -%}
19 19 {%- endif -%}
20 20 {%- if type in ['html']%}
21 21 {%- block data_html -%}
22 22 {%- endblock -%}
23 23 {%- endif -%}
24 24 {%- if type in ['jpeg']%}
25 25 {%- block data_jpg -%}
26 26 {%- endblock -%}
27 27 {%- endif -%}
28 28 {%- if type in ['text']%}
29 29 {%- block data_text -%}
30 30 {%- endblock -%}
31 31 {%- endif -%}
32
33 32 {%- if type in ['latex']%}
34 33 {%- block data_latex -%}
35 34 {%- endblock -%}
36 35 {%- endif -%}
36 {%- if type in ['javascript']%}
37 {%- block data_javascript -%}
38 {%- endblock -%}
39 {%- endif -%}
37 40 {%- endfor -%}
38 41 {%- endblock data_priority -%}
General Comments 0
You need to be logged in to leave comments. Login now