Show More
@@ -1,148 +1,144 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 [{{ cell.prompt_number }}]: |
|
26 | In [{{ 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 markdowncell scoped %} | |
57 | <div class="text_cell_render border-box-sizing rendered_html"> |
|
57 | <div class="text_cell_render border-box-sizing rendered_html"> | |
58 | {{ cell.source | markdown2html | strip_files_prefix }} |
|
58 | {{ cell.source | markdown2html | strip_files_prefix }} | |
59 | </div> |
|
59 | </div> | |
60 | {%- endblock markdowncell %} |
|
60 | {%- endblock markdowncell %} | |
61 |
|
61 | |||
62 | {% block headingcell scoped %} |
|
62 | {% block headingcell scoped %} | |
63 | <div class="text_cell_render border-box-sizing rendered_html"> |
|
63 | <div class="text_cell_render border-box-sizing rendered_html"> | |
64 | {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }} |
|
64 | {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }} | |
65 | </div> |
|
65 | </div> | |
66 | {% endblock headingcell %} |
|
66 | {% endblock headingcell %} | |
67 |
|
67 | |||
68 | {% block rawcell scoped %} |
|
|||
69 | {{ cell.source }} |
|
|||
70 | {% endblock rawcell %} |
|
|||
71 |
|
||||
72 | {% block unknowncell scoped %} |
|
68 | {% block unknowncell scoped %} | |
73 | unknown type {{ cell.type }} |
|
69 | unknown type {{ cell.type }} | |
74 | {% endblock unknowncell %} |
|
70 | {% endblock unknowncell %} | |
75 |
|
71 | |||
76 | {% block pyout -%} |
|
72 | {% block pyout -%} | |
77 | <div class="box-flex1 output_subarea output_pyout"> |
|
73 | <div class="box-flex1 output_subarea output_pyout"> | |
78 | {% block data_priority scoped %} |
|
74 | {% block data_priority scoped %} | |
79 | {{ super() }} |
|
75 | {{ super() }} | |
80 | {% endblock %} |
|
76 | {% endblock %} | |
81 | </div> |
|
77 | </div> | |
82 | {%- endblock pyout %} |
|
78 | {%- endblock pyout %} | |
83 |
|
79 | |||
84 | {% block stream_stdout -%} |
|
80 | {% block stream_stdout -%} | |
85 | <div class="box-flex1 output_subarea output_stream output_stdout"> |
|
81 | <div class="box-flex1 output_subarea output_stream output_stdout"> | |
86 | <pre> |
|
82 | <pre> | |
87 | {{ output.text | ansi2html }} |
|
83 | {{ output.text | ansi2html }} | |
88 | </pre> |
|
84 | </pre> | |
89 | </div> |
|
85 | </div> | |
90 | {%- endblock stream_stdout %} |
|
86 | {%- endblock stream_stdout %} | |
91 |
|
87 | |||
92 | {% block stream_stderr -%} |
|
88 | {% block stream_stderr -%} | |
93 | <div class="box-flex1 output_subarea output_stream output_stderr"> |
|
89 | <div class="box-flex1 output_subarea output_stream output_stderr"> | |
94 | <pre> |
|
90 | <pre> | |
95 | {{ output.text | ansi2html }} |
|
91 | {{ output.text | ansi2html }} | |
96 | </pre> |
|
92 | </pre> | |
97 | </div> |
|
93 | </div> | |
98 | {%- endblock stream_stderr %} |
|
94 | {%- endblock stream_stderr %} | |
99 |
|
95 | |||
100 | {% block data_svg -%} |
|
96 | {% block data_svg -%} | |
101 | {{ output.svg }} |
|
97 | {{ output.svg }} | |
102 | {%- endblock data_svg %} |
|
98 | {%- endblock data_svg %} | |
103 |
|
99 | |||
104 | {% block data_html -%} |
|
100 | {% block data_html -%} | |
105 | <div class="output_html rendered_html"> |
|
101 | <div class="output_html rendered_html"> | |
106 | {{ output.html }} |
|
102 | {{ output.html }} | |
107 | </div> |
|
103 | </div> | |
108 | {%- endblock data_html %} |
|
104 | {%- endblock data_html %} | |
109 |
|
105 | |||
110 | {% block data_png %} |
|
106 | {% block data_png %} | |
111 | <img src="data:image/png;base64,{{ output.png }}"> |
|
107 | <img src="data:image/png;base64,{{ output.png }}"> | |
112 | {%- endblock data_png %} |
|
108 | {%- endblock data_png %} | |
113 |
|
109 | |||
114 | {% block data_jpg %} |
|
110 | {% block data_jpg %} | |
115 | <img src="data:image/jpeg;base64,{{ output.jpeg }}"> |
|
111 | <img src="data:image/jpeg;base64,{{ output.jpeg }}"> | |
116 | {%- endblock data_jpg %} |
|
112 | {%- endblock data_jpg %} | |
117 |
|
113 | |||
118 | {% block data_latex %} |
|
114 | {% block data_latex %} | |
119 | {{ output.latex }} |
|
115 | {{ output.latex }} | |
120 | {%- endblock data_latex %} |
|
116 | {%- endblock data_latex %} | |
121 |
|
117 | |||
122 | {% block pyerr -%} |
|
118 | {% block pyerr -%} | |
123 | <div class="box-flex1 output_subarea output_pyerr"> |
|
119 | <div class="box-flex1 output_subarea output_pyerr"> | |
124 | <pre>{{ super() }}</pre> |
|
120 | <pre>{{ super() }}</pre> | |
125 | </div> |
|
121 | </div> | |
126 | {%- endblock pyerr %} |
|
122 | {%- endblock pyerr %} | |
127 |
|
123 | |||
128 | {%- block traceback_line %} |
|
124 | {%- block traceback_line %} | |
129 | {{ line | ansi2html }} |
|
125 | {{ line | ansi2html }} | |
130 | {%- endblock traceback_line %} |
|
126 | {%- endblock traceback_line %} | |
131 |
|
127 | |||
132 | {%- block data_text %} |
|
128 | {%- block data_text %} | |
133 | <pre> |
|
129 | <pre> | |
134 | {{ output.text | ansi2html }} |
|
130 | {{ output.text | ansi2html }} | |
135 | </pre> |
|
131 | </pre> | |
136 | {%- endblock -%} |
|
132 | {%- endblock -%} | |
137 |
|
133 | |||
138 | {%- block data_javascript %} |
|
134 | {%- block data_javascript %} | |
139 | <script type="text/javascript"> |
|
135 | <script type="text/javascript"> | |
140 | {{ output.javascript }} |
|
136 | {{ output.javascript }} | |
141 | </script> |
|
137 | </script> | |
142 | {%- endblock -%} |
|
138 | {%- endblock -%} | |
143 |
|
139 | |||
144 | {%- block display_data scoped -%} |
|
140 | {%- block display_data scoped -%} | |
145 | <div class="box-flex1 output_subarea output_display_data"> |
|
141 | <div class="box-flex1 output_subarea output_display_data"> | |
146 | {{ super() }} |
|
142 | {{ super() }} | |
147 | </div> |
|
143 | </div> | |
148 | {%- endblock display_data -%} |
|
144 | {%- endblock display_data -%} |
@@ -1,228 +1,223 b'' | |||||
1 | ((= Latex base template (must inherit) |
|
1 | ((= Latex base template (must inherit) | |
2 | This template builds upon the abstract template, adding common latex output |
|
2 | This template builds upon the abstract template, adding common latex output | |
3 | functions. Figures, data_text, |
|
3 | functions. Figures, data_text, | |
4 | This template does not define a docclass, the inheriting class must define this.=)) |
|
4 | This template does not define a docclass, the inheriting class must define this.=)) | |
5 |
|
5 | |||
6 | ((*- extends 'display_priority.tplx' -*)) |
|
6 | ((*- extends 'display_priority.tplx' -*)) | |
7 |
|
7 | |||
8 | %=============================================================================== |
|
8 | %=============================================================================== | |
9 | % Abstract overrides |
|
9 | % Abstract overrides | |
10 | %=============================================================================== |
|
10 | %=============================================================================== | |
11 |
|
11 | |||
12 | ((* block header *)) |
|
12 | ((* block header *)) | |
13 | ((* block docclass *))((* endblock docclass *)) |
|
13 | ((* block docclass *))((* endblock docclass *)) | |
14 |
|
14 | |||
15 | ((* block packages *)) |
|
15 | ((* block packages *)) | |
16 | \usepackage{graphicx} % Used to insert images |
|
16 | \usepackage{graphicx} % Used to insert images | |
17 | \usepackage{adjustbox} % Used to constrain images to a maximum size |
|
17 | \usepackage{adjustbox} % Used to constrain images to a maximum size | |
18 | \usepackage{color} % Allow colors to be defined |
|
18 | \usepackage{color} % Allow colors to be defined | |
19 | \usepackage{enumerate} % Needed for markdown enumerations to work |
|
19 | \usepackage{enumerate} % Needed for markdown enumerations to work | |
20 | \usepackage{geometry} % Used to adjust the document margins |
|
20 | \usepackage{geometry} % Used to adjust the document margins | |
21 | \usepackage{amsmath} % Equations |
|
21 | \usepackage{amsmath} % Equations | |
22 | \usepackage{amssymb} % Equations |
|
22 | \usepackage{amssymb} % Equations | |
23 | \usepackage[utf8]{inputenc} % Allow utf-8 characters in the tex document |
|
23 | \usepackage[utf8]{inputenc} % Allow utf-8 characters in the tex document | |
24 | \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support |
|
24 | \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support | |
25 | \usepackage{fancyvrb} % verbatim replacement that allows latex |
|
25 | \usepackage{fancyvrb} % verbatim replacement that allows latex | |
26 | \usepackage{grffile} % extends the file name processing of package graphics |
|
26 | \usepackage{grffile} % extends the file name processing of package graphics | |
27 | % to support a larger range |
|
27 | % to support a larger range | |
28 | % The hyperref package gives us a pdf with properly built |
|
28 | % The hyperref package gives us a pdf with properly built | |
29 | % internal navigation ('pdf bookmarks' for the table of contents, |
|
29 | % internal navigation ('pdf bookmarks' for the table of contents, | |
30 | % internal cross-reference links, web links for URLs, etc.) |
|
30 | % internal cross-reference links, web links for URLs, etc.) | |
31 | \usepackage{hyperref} |
|
31 | \usepackage{hyperref} | |
32 | \usepackage{longtable} % longtable support required by pandoc >1.10 |
|
32 | \usepackage{longtable} % longtable support required by pandoc >1.10 | |
33 | ((* endblock packages *)) |
|
33 | ((* endblock packages *)) | |
34 |
|
34 | |||
35 | ((* block definitions *)) |
|
35 | ((* block definitions *)) | |
36 | \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} |
|
36 | \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} | |
37 | \definecolor{darkorange}{rgb}{.71,0.21,0.01} |
|
37 | \definecolor{darkorange}{rgb}{.71,0.21,0.01} | |
38 | \definecolor{darkgreen}{rgb}{.12,.54,.11} |
|
38 | \definecolor{darkgreen}{rgb}{.12,.54,.11} | |
39 | \definecolor{myteal}{rgb}{.26, .44, .56} |
|
39 | \definecolor{myteal}{rgb}{.26, .44, .56} | |
40 | \definecolor{gray}{gray}{0.45} |
|
40 | \definecolor{gray}{gray}{0.45} | |
41 | \definecolor{lightgray}{gray}{.95} |
|
41 | \definecolor{lightgray}{gray}{.95} | |
42 | \definecolor{mediumgray}{gray}{.8} |
|
42 | \definecolor{mediumgray}{gray}{.8} | |
43 | \definecolor{inputbackground}{rgb}{.95, .95, .85} |
|
43 | \definecolor{inputbackground}{rgb}{.95, .95, .85} | |
44 | \definecolor{outputbackground}{rgb}{.95, .95, .95} |
|
44 | \definecolor{outputbackground}{rgb}{.95, .95, .95} | |
45 | \definecolor{traceback}{rgb}{1, .95, .95} |
|
45 | \definecolor{traceback}{rgb}{1, .95, .95} | |
46 | % ansi colors |
|
46 | % ansi colors | |
47 | \definecolor{red}{rgb}{.6,0,0} |
|
47 | \definecolor{red}{rgb}{.6,0,0} | |
48 | \definecolor{green}{rgb}{0,.65,0} |
|
48 | \definecolor{green}{rgb}{0,.65,0} | |
49 | \definecolor{brown}{rgb}{0.6,0.6,0} |
|
49 | \definecolor{brown}{rgb}{0.6,0.6,0} | |
50 | \definecolor{blue}{rgb}{0,.145,.698} |
|
50 | \definecolor{blue}{rgb}{0,.145,.698} | |
51 | \definecolor{purple}{rgb}{.698,.145,.698} |
|
51 | \definecolor{purple}{rgb}{.698,.145,.698} | |
52 | \definecolor{cyan}{rgb}{0,.698,.698} |
|
52 | \definecolor{cyan}{rgb}{0,.698,.698} | |
53 | \definecolor{lightgray}{gray}{0.5} |
|
53 | \definecolor{lightgray}{gray}{0.5} | |
54 |
|
54 | |||
55 | % bright ansi colors |
|
55 | % bright ansi colors | |
56 | \definecolor{darkgray}{gray}{0.25} |
|
56 | \definecolor{darkgray}{gray}{0.25} | |
57 | \definecolor{lightred}{rgb}{1.0,0.39,0.28} |
|
57 | \definecolor{lightred}{rgb}{1.0,0.39,0.28} | |
58 | \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} |
|
58 | \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} | |
59 | \definecolor{lightblue}{rgb}{0.53,0.81,0.92} |
|
59 | \definecolor{lightblue}{rgb}{0.53,0.81,0.92} | |
60 | \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} |
|
60 | \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} | |
61 | \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} |
|
61 | \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} | |
62 |
|
62 | |||
63 | % commands and environments needed by pandoc snippets |
|
63 | % commands and environments needed by pandoc snippets | |
64 | % extracted from the output of `pandoc -s` |
|
64 | % extracted from the output of `pandoc -s` | |
65 |
|
65 | |||
66 | \DefineShortVerb[commandchars=\\\{\}]{\|} |
|
66 | \DefineShortVerb[commandchars=\\\{\}]{\|} | |
67 | \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} |
|
67 | \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} | |
68 | % Add ',fontsize=\small' for more characters per line |
|
68 | % Add ',fontsize=\small' for more characters per line | |
69 | \newenvironment{Shaded}{}{} |
|
69 | \newenvironment{Shaded}{}{} | |
70 | \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} |
|
70 | \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} | |
71 | \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} |
|
71 | \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} | |
72 | \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} |
|
72 | \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} | |
73 | \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} |
|
73 | \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} | |
74 | \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} |
|
74 | \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} | |
75 | \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} |
|
75 | \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} | |
76 | \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} |
|
76 | \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} | |
77 | \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} |
|
77 | \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} | |
78 | \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} |
|
78 | \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} | |
79 | \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} |
|
79 | \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} | |
80 | \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} |
|
80 | \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} | |
81 | \newcommand{\RegionMarkerTok}[1]{{#1}} |
|
81 | \newcommand{\RegionMarkerTok}[1]{{#1}} | |
82 | \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} |
|
82 | \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} | |
83 | \newcommand{\NormalTok}[1]{{#1}} |
|
83 | \newcommand{\NormalTok}[1]{{#1}} | |
84 |
|
84 | |||
85 | % Define a nice break command that doesn't care if a line doesn't already |
|
85 | % Define a nice break command that doesn't care if a line doesn't already | |
86 | % exist. |
|
86 | % exist. | |
87 | \def\br{\hspace*{\fill} \\* } |
|
87 | \def\br{\hspace*{\fill} \\* } | |
88 | % Math Jax compatability definitions |
|
88 | % Math Jax compatability definitions | |
89 | \def\gt{>} |
|
89 | \def\gt{>} | |
90 | \def\lt{<} |
|
90 | \def\lt{<} | |
91 | % Document parameters |
|
91 | % Document parameters | |
92 | ((* block title *))\title{((( resources.metadata.name | escape_latex )))}((* endblock title *)) |
|
92 | ((* block title *))\title{((( resources.metadata.name | escape_latex )))}((* endblock title *)) | |
93 | ((* block date *))((* endblock date *)) |
|
93 | ((* block date *))((* endblock date *)) | |
94 | ((* block author *))((* endblock author *)) |
|
94 | ((* block author *))((* endblock author *)) | |
95 | ((* endblock definitions *)) |
|
95 | ((* endblock definitions *)) | |
96 |
|
96 | |||
97 | ((* block commands *)) |
|
97 | ((* block commands *)) | |
98 | % Prevent overflowing lines due to hard-to-break entities |
|
98 | % Prevent overflowing lines due to hard-to-break entities | |
99 | \sloppy |
|
99 | \sloppy | |
100 | % Setup hyperref package |
|
100 | % Setup hyperref package | |
101 | \hypersetup{ |
|
101 | \hypersetup{ | |
102 | breaklinks=true, % so long urls are correctly broken across lines |
|
102 | breaklinks=true, % so long urls are correctly broken across lines | |
103 | colorlinks=true, |
|
103 | colorlinks=true, | |
104 | urlcolor=blue, |
|
104 | urlcolor=blue, | |
105 | linkcolor=darkorange, |
|
105 | linkcolor=darkorange, | |
106 | citecolor=darkgreen, |
|
106 | citecolor=darkgreen, | |
107 | } |
|
107 | } | |
108 | % Slightly bigger margins than the latex defaults |
|
108 | % Slightly bigger margins than the latex defaults | |
109 | ((* block margins *)) |
|
109 | ((* block margins *)) | |
110 | \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in} |
|
110 | \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in} | |
111 | ((* endblock margins *)) |
|
111 | ((* endblock margins *)) | |
112 | ((* endblock commands *)) |
|
112 | ((* endblock commands *)) | |
113 | ((* endblock header *)) |
|
113 | ((* endblock header *)) | |
114 |
|
114 | |||
115 | ((* block body *)) |
|
115 | ((* block body *)) | |
116 | \begin{document} |
|
116 | \begin{document} | |
117 |
|
117 | |||
118 | ((* block predoc *)) |
|
118 | ((* block predoc *)) | |
119 | ((* block maketitle *))\maketitle((* endblock maketitle *)) |
|
119 | ((* block maketitle *))\maketitle((* endblock maketitle *)) | |
120 | ((* block abstract *))((* endblock abstract *)) |
|
120 | ((* block abstract *))((* endblock abstract *)) | |
121 | ((* endblock predoc *)) |
|
121 | ((* endblock predoc *)) | |
122 |
|
122 | |||
123 | ((( super() ))) |
|
123 | ((( super() ))) | |
124 |
|
124 | |||
125 | % Add a bibliography block to the postdoc |
|
125 | % Add a bibliography block to the postdoc | |
126 | ((* block postdoc *)) |
|
126 | ((* block postdoc *)) | |
127 | ((* block bibliography *))((* endblock bibliography *)) |
|
127 | ((* block bibliography *))((* endblock bibliography *)) | |
128 | ((* endblock postdoc *)) |
|
128 | ((* endblock postdoc *)) | |
129 | \end{document} |
|
129 | \end{document} | |
130 | ((* endblock body *)) |
|
130 | ((* endblock body *)) | |
131 |
|
131 | |||
132 | %=============================================================================== |
|
132 | %=============================================================================== | |
133 | % Support blocks |
|
133 | % Support blocks | |
134 | %=============================================================================== |
|
134 | %=============================================================================== | |
135 |
|
135 | |||
136 | % Displaying simple data text |
|
136 | % Displaying simple data text | |
137 | ((* block data_text *)) |
|
137 | ((* block data_text *)) | |
138 | \begin{verbatim} |
|
138 | \begin{verbatim} | |
139 | ((( output.text ))) |
|
139 | ((( output.text ))) | |
140 | \end{verbatim} |
|
140 | \end{verbatim} | |
141 | ((* endblock data_text *)) |
|
141 | ((* endblock data_text *)) | |
142 |
|
142 | |||
143 | % Display python error text as-is |
|
143 | % Display python error text as-is | |
144 | ((* block pyerr *)) |
|
144 | ((* block pyerr *)) | |
145 | \begin{Verbatim}[commandchars=\\\{\}] |
|
145 | \begin{Verbatim}[commandchars=\\\{\}] | |
146 | ((( super() ))) |
|
146 | ((( super() ))) | |
147 | \end{Verbatim} |
|
147 | \end{Verbatim} | |
148 | ((* endblock pyerr *)) |
|
148 | ((* endblock pyerr *)) | |
149 | ((* block traceback_line *)) |
|
149 | ((* block traceback_line *)) | |
150 | ((( line | indent | strip_ansi | escape_latex ))) |
|
150 | ((( line | indent | strip_ansi | escape_latex ))) | |
151 | ((* endblock traceback_line *)) |
|
151 | ((* endblock traceback_line *)) | |
152 |
|
152 | |||
153 | % Display stream ouput with coloring |
|
153 | % Display stream ouput with coloring | |
154 | ((* block stream *)) |
|
154 | ((* block stream *)) | |
155 | \begin{Verbatim}[commandchars=\\\{\}] |
|
155 | \begin{Verbatim}[commandchars=\\\{\}] | |
156 | ((( output.text | escape_latex | ansi2latex ))) |
|
156 | ((( output.text | escape_latex | ansi2latex ))) | |
157 | \end{Verbatim} |
|
157 | \end{Verbatim} | |
158 | ((* endblock stream *)) |
|
158 | ((* endblock stream *)) | |
159 |
|
159 | |||
160 | % Display latex |
|
160 | % Display latex | |
161 | ((* block data_latex -*)) |
|
161 | ((* block data_latex -*)) | |
162 | ((*- if output.latex.startswith('$'): -*)) |
|
162 | ((*- if output.latex.startswith('$'): -*)) | |
163 | ((= Replace $ symbols with more explicit, equation block. =)) |
|
163 | ((= Replace $ symbols with more explicit, equation block. =)) | |
164 | \begin{equation*} |
|
164 | \begin{equation*} | |
165 | ((( output.latex | strip_dollars ))) |
|
165 | ((( output.latex | strip_dollars ))) | |
166 | \end{equation*} |
|
166 | \end{equation*} | |
167 | ((*- else -*)) |
|
167 | ((*- else -*)) | |
168 | ((( output.latex ))) |
|
168 | ((( output.latex ))) | |
169 | ((*- endif *)) |
|
169 | ((*- endif *)) | |
170 | ((* endblock data_latex *)) |
|
170 | ((* endblock data_latex *)) | |
171 |
|
171 | |||
172 | % Default mechanism for rendering figures |
|
172 | % Default mechanism for rendering figures | |
173 | ((*- block data_png -*))((( draw_figure(output.png_filename) )))((*- endblock -*)) |
|
173 | ((*- block data_png -*))((( draw_figure(output.png_filename) )))((*- endblock -*)) | |
174 | ((*- block data_jpg -*))((( draw_figure(output.jpeg_filename) )))((*- endblock -*)) |
|
174 | ((*- block data_jpg -*))((( draw_figure(output.jpeg_filename) )))((*- endblock -*)) | |
175 | ((*- block data_svg -*))((( draw_figure(output.svg_filename) )))((*- endblock -*)) |
|
175 | ((*- block data_svg -*))((( draw_figure(output.svg_filename) )))((*- endblock -*)) | |
176 | ((*- block data_pdf -*))((( draw_figure(output.pdf_filename) )))((*- endblock -*)) |
|
176 | ((*- block data_pdf -*))((( draw_figure(output.pdf_filename) )))((*- endblock -*)) | |
177 |
|
177 | |||
178 | % Draw a figure using the graphicx package. |
|
178 | % Draw a figure using the graphicx package. | |
179 | ((* macro draw_figure(filename) -*)) |
|
179 | ((* macro draw_figure(filename) -*)) | |
180 | ((* set filename = filename | posix_path *)) |
|
180 | ((* set filename = filename | posix_path *)) | |
181 | ((*- block figure scoped -*)) |
|
181 | ((*- block figure scoped -*)) | |
182 | \begin{center} |
|
182 | \begin{center} | |
183 | \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))} |
|
183 | \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))} | |
184 | \end{center} |
|
184 | \end{center} | |
185 | { \hspace*{\fill} \\} |
|
185 | { \hspace*{\fill} \\} | |
186 | ((*- endblock figure -*)) |
|
186 | ((*- endblock figure -*)) | |
187 | ((*- endmacro *)) |
|
187 | ((*- endmacro *)) | |
188 |
|
188 | |||
189 | % Draw heading cell. Explicitly map different cell levels. |
|
189 | % Draw heading cell. Explicitly map different cell levels. | |
190 | ((* block headingcell scoped *)) |
|
190 | ((* block headingcell scoped *)) | |
191 |
|
191 | |||
192 | ((* if cell.level == 1 -*)) |
|
192 | ((* if cell.level == 1 -*)) | |
193 | ((* block h1 -*))\section((* endblock h1 -*)) |
|
193 | ((* block h1 -*))\section((* endblock h1 -*)) | |
194 | ((* elif cell.level == 2 -*)) |
|
194 | ((* elif cell.level == 2 -*)) | |
195 | ((* block h2 -*))\subsection((* endblock h2 -*)) |
|
195 | ((* block h2 -*))\subsection((* endblock h2 -*)) | |
196 | ((* elif cell.level == 3 -*)) |
|
196 | ((* elif cell.level == 3 -*)) | |
197 | ((* block h3 -*))\subsubsection((* endblock h3 -*)) |
|
197 | ((* block h3 -*))\subsubsection((* endblock h3 -*)) | |
198 | ((* elif cell.level == 4 -*)) |
|
198 | ((* elif cell.level == 4 -*)) | |
199 | ((* block h4 -*))\paragraph((* endblock h4 -*)) |
|
199 | ((* block h4 -*))\paragraph((* endblock h4 -*)) | |
200 | ((* elif cell.level == 5 -*)) |
|
200 | ((* elif cell.level == 5 -*)) | |
201 | ((* block h5 -*))\subparagraph((* endblock h5 -*)) |
|
201 | ((* block h5 -*))\subparagraph((* endblock h5 -*)) | |
202 | ((* elif cell.level == 6 -*)) |
|
202 | ((* elif cell.level == 6 -*)) | |
203 | ((* block h6 -*))\\*\textit((* endblock h6 -*)) |
|
203 | ((* block h6 -*))\\*\textit((* endblock h6 -*)) | |
204 | ((*- endif -*)) |
|
204 | ((*- endif -*)) | |
205 | {((( cell.source | replace('\n', ' ') | citation2latex | markdown2latex )))} |
|
205 | {((( cell.source | replace('\n', ' ') | citation2latex | markdown2latex )))} | |
206 |
|
206 | |||
207 | ((* endblock headingcell *)) |
|
207 | ((* endblock headingcell *)) | |
208 |
|
208 | |||
209 | % Redirect pyout to display data priority. |
|
209 | % Redirect pyout to display data priority. | |
210 | ((* block pyout scoped *)) |
|
210 | ((* block pyout scoped *)) | |
211 | ((* block data_priority scoped *)) |
|
211 | ((* block data_priority scoped *)) | |
212 | ((( super() ))) |
|
212 | ((( super() ))) | |
213 | ((* endblock *)) |
|
213 | ((* endblock *)) | |
214 | ((* endblock pyout *)) |
|
214 | ((* endblock pyout *)) | |
215 |
|
215 | |||
216 | % Render markdown |
|
216 | % Render markdown | |
217 | ((* block markdowncell scoped *)) |
|
217 | ((* block markdowncell scoped *)) | |
218 | ((( cell.source | citation2latex | markdown2latex ))) |
|
218 | ((( cell.source | citation2latex | markdown2latex ))) | |
219 | ((* endblock markdowncell *)) |
|
219 | ((* endblock markdowncell *)) | |
220 |
|
220 | |||
221 | % Spit out the contents of raw cells unmodified |
|
|||
222 | ((* block rawcell scoped *)) |
|
|||
223 | ((( cell.source ))) |
|
|||
224 | ((* endblock rawcell *)) |
|
|||
225 |
|
||||
226 | % Don't display unknown types |
|
221 | % Don't display unknown types | |
227 | ((* block unknowncell scoped *)) |
|
222 | ((* block unknowncell scoped *)) | |
228 | ((* endblock unknowncell *)) |
|
223 | ((* endblock unknowncell *)) |
@@ -1,95 +1,98 b'' | |||||
1 | ((= Auto-generated template file, DO NOT edit directly! |
|
1 | ((= Auto-generated template file, DO NOT edit directly! | |
2 | To edit this file, please refer to ../../skeleton/README.md =)) |
|
2 | To edit this file, please refer to ../../skeleton/README.md =)) | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | ((= |
|
5 | ((= | |
6 |
|
6 | |||
7 | DO NOT USE THIS AS A BASE, |
|
7 | DO NOT USE THIS AS A BASE, | |
8 | IF YOU ARE COPY AND PASTING THIS FILE |
|
8 | IF YOU ARE COPY AND PASTING THIS FILE | |
9 | YOU ARE PROBABLY DOING THINGS INCORRECTLY. |
|
9 | YOU ARE PROBABLY DOING THINGS INCORRECTLY. | |
10 |
|
10 | |||
11 | Null template, does nothing except defining a basic structure |
|
11 | Null template, does nothing except defining a basic structure | |
12 | To layout the different blocks of a notebook. |
|
12 | To layout the different blocks of a notebook. | |
13 |
|
13 | |||
14 | Subtemplates can override blocks to define their custom representation. |
|
14 | Subtemplates can override blocks to define their custom representation. | |
15 |
|
15 | |||
16 | If one of the block you do overwrite is not a leave block, consider |
|
16 | If one of the block you do overwrite is not a leave block, consider | |
17 | calling super. |
|
17 | calling super. | |
18 |
|
18 | |||
19 | ((*- block nonLeaveBlock -*)) |
|
19 | ((*- block nonLeaveBlock -*)) | |
20 | #add stuff at beginning |
|
20 | #add stuff at beginning | |
21 | ((( super() ))) |
|
21 | ((( super() ))) | |
22 | #add stuff at end |
|
22 | #add stuff at end | |
23 | ((*- endblock nonLeaveBlock -*)) |
|
23 | ((*- endblock nonLeaveBlock -*)) | |
24 |
|
24 | |||
25 | consider calling super even if it is a leave block, we might insert more blocks later. |
|
25 | consider calling super even if it is a leave block, we might insert more blocks later. | |
26 |
|
26 | |||
27 | =)) |
|
27 | =)) | |
28 | ((*- block header -*)) |
|
28 | ((*- block header -*)) | |
29 | ((*- endblock header -*)) |
|
29 | ((*- endblock header -*)) | |
30 | ((*- block body -*)) |
|
30 | ((*- block body -*)) | |
31 | ((*- for worksheet in nb.worksheets -*)) |
|
31 | ((*- for worksheet in nb.worksheets -*)) | |
32 | ((*- for cell in worksheet.cells -*)) |
|
32 | ((*- for cell in worksheet.cells -*)) | |
33 | ((*- block any_cell scoped -*)) |
|
33 | ((*- block any_cell scoped -*)) | |
34 | ((*- if cell.cell_type in ['code'] -*)) |
|
34 | ((*- if cell.cell_type in ['code'] -*)) | |
35 | ((*- block codecell scoped -*)) |
|
35 | ((*- block codecell scoped -*)) | |
36 | ((*- block input_group -*)) |
|
36 | ((*- block input_group -*)) | |
37 | ((*- block in_prompt -*))((*- endblock in_prompt -*)) |
|
37 | ((*- block in_prompt -*))((*- endblock in_prompt -*)) | |
38 | ((*- block input -*))((*- endblock input -*)) |
|
38 | ((*- block input -*))((*- endblock input -*)) | |
39 | ((*- endblock input_group -*)) |
|
39 | ((*- endblock input_group -*)) | |
40 | ((*- if cell.outputs -*)) |
|
40 | ((*- if cell.outputs -*)) | |
41 | ((*- block output_group -*)) |
|
41 | ((*- block output_group -*)) | |
42 | ((*- block output_prompt -*))((*- endblock output_prompt -*)) |
|
42 | ((*- block output_prompt -*))((*- endblock output_prompt -*)) | |
43 | ((*- block outputs scoped -*)) |
|
43 | ((*- block outputs scoped -*)) | |
44 | ((*- for output in cell.outputs -*)) |
|
44 | ((*- for output in cell.outputs -*)) | |
45 | ((*- block output scoped -*)) |
|
45 | ((*- block output scoped -*)) | |
46 | ((*- if output.output_type in ['pyout'] -*)) |
|
46 | ((*- if output.output_type in ['pyout'] -*)) | |
47 | ((*- block pyout scoped -*))((*- endblock pyout -*)) |
|
47 | ((*- block pyout scoped -*))((*- endblock pyout -*)) | |
48 | ((*- elif output.output_type in ['stream'] -*)) |
|
48 | ((*- elif output.output_type in ['stream'] -*)) | |
49 | ((*- block stream scoped -*)) |
|
49 | ((*- block stream scoped -*)) | |
50 | ((*- if output.stream in ['stdout'] -*)) |
|
50 | ((*- if output.stream in ['stdout'] -*)) | |
51 | ((*- block stream_stdout scoped -*)) |
|
51 | ((*- block stream_stdout scoped -*)) | |
52 | ((*- endblock stream_stdout -*)) |
|
52 | ((*- endblock stream_stdout -*)) | |
53 | ((*- elif output.stream in ['stderr'] -*)) |
|
53 | ((*- elif output.stream in ['stderr'] -*)) | |
54 | ((*- block stream_stderr scoped -*)) |
|
54 | ((*- block stream_stderr scoped -*)) | |
55 | ((*- endblock stream_stderr -*)) |
|
55 | ((*- endblock stream_stderr -*)) | |
56 | ((*- endif -*)) |
|
56 | ((*- endif -*)) | |
57 | ((*- endblock stream -*)) |
|
57 | ((*- endblock stream -*)) | |
58 | ((*- elif output.output_type in ['display_data'] -*)) |
|
58 | ((*- elif output.output_type in ['display_data'] -*)) | |
59 | ((*- block display_data scoped -*)) |
|
59 | ((*- block display_data scoped -*)) | |
60 | ((*- block data_priority scoped -*)) |
|
60 | ((*- block data_priority scoped -*)) | |
61 | ((*- endblock data_priority -*)) |
|
61 | ((*- endblock data_priority -*)) | |
62 | ((*- endblock display_data -*)) |
|
62 | ((*- endblock display_data -*)) | |
63 | ((*- elif output.output_type in ['pyerr'] -*)) |
|
63 | ((*- elif output.output_type in ['pyerr'] -*)) | |
64 | ((*- block pyerr scoped -*)) |
|
64 | ((*- block pyerr scoped -*)) | |
65 | ((*- for line in output.traceback -*)) |
|
65 | ((*- for line in output.traceback -*)) | |
66 | ((*- block traceback_line scoped -*))((*- endblock traceback_line -*)) |
|
66 | ((*- block traceback_line scoped -*))((*- endblock traceback_line -*)) | |
67 | ((*- endfor -*)) |
|
67 | ((*- endfor -*)) | |
68 | ((*- endblock pyerr -*)) |
|
68 | ((*- endblock pyerr -*)) | |
69 | ((*- endif -*)) |
|
69 | ((*- endif -*)) | |
70 | ((*- endblock output -*)) |
|
70 | ((*- endblock output -*)) | |
71 | ((*- endfor -*)) |
|
71 | ((*- endfor -*)) | |
72 | ((*- endblock outputs -*)) |
|
72 | ((*- endblock outputs -*)) | |
73 | ((*- endblock output_group -*)) |
|
73 | ((*- endblock output_group -*)) | |
74 | ((*- endif -*)) |
|
74 | ((*- endif -*)) | |
75 | ((*- endblock codecell -*)) |
|
75 | ((*- endblock codecell -*)) | |
76 | ((*- elif cell.cell_type in ['markdown'] -*)) |
|
76 | ((*- elif cell.cell_type in ['markdown'] -*)) | |
77 | ((*- block markdowncell scoped-*)) |
|
77 | ((*- block markdowncell scoped-*)) | |
78 | ((*- endblock markdowncell -*)) |
|
78 | ((*- endblock markdowncell -*)) | |
79 | ((*- elif cell.cell_type in ['heading'] -*)) |
|
79 | ((*- elif cell.cell_type in ['heading'] -*)) | |
80 | ((*- block headingcell scoped-*)) |
|
80 | ((*- block headingcell scoped-*)) | |
81 | ((*- endblock headingcell -*)) |
|
81 | ((*- endblock headingcell -*)) | |
82 | ((*- elif cell.cell_type in ['raw'] -*)) |
|
82 | ((*- elif cell.cell_type in ['raw'] -*)) | |
83 | ((*- block rawcell scoped-*)) |
|
83 | ((*- block rawcell scoped -*)) | |
|
84 | ((* if cell.metadata.get('raw_format', resources.get('raw_format')) == resources.get('raw_format') *)) | |||
|
85 | ((( cell.source ))) | |||
|
86 | ((* endif *)) | |||
84 | ((*- endblock rawcell -*)) |
|
87 | ((*- endblock rawcell -*)) | |
85 | ((*- else -*)) |
|
88 | ((*- else -*)) | |
86 | ((*- block unknowncell scoped-*)) |
|
89 | ((*- block unknowncell scoped-*)) | |
87 | ((*- endblock unknowncell -*)) |
|
90 | ((*- endblock unknowncell -*)) | |
88 | ((*- endif -*)) |
|
91 | ((*- endif -*)) | |
89 | ((*- endblock any_cell -*)) |
|
92 | ((*- endblock any_cell -*)) | |
90 | ((*- endfor -*)) |
|
93 | ((*- endfor -*)) | |
91 | ((*- endfor -*)) |
|
94 | ((*- endfor -*)) | |
92 | ((*- endblock body -*)) |
|
95 | ((*- endblock body -*)) | |
93 |
|
96 | |||
94 | ((*- block footer -*)) |
|
97 | ((*- block footer -*)) | |
95 | ((*- endblock footer -*)) |
|
98 | ((*- endblock footer -*)) |
@@ -1,72 +1,68 b'' | |||||
1 | {% extends 'display_priority.tpl' %} |
|
1 | {% extends 'display_priority.tpl' %} | |
2 |
|
2 | |||
3 |
|
3 | |||
4 | {% block in_prompt %} |
|
4 | {% block in_prompt %} | |
5 | {% endblock in_prompt %} |
|
5 | {% endblock in_prompt %} | |
6 |
|
6 | |||
7 | {% block output_prompt %} |
|
7 | {% block output_prompt %} | |
8 | {%- endblock output_prompt %} |
|
8 | {%- endblock output_prompt %} | |
9 |
|
9 | |||
10 | {% block input %} |
|
10 | {% block input %} | |
11 | {{ cell.input | indent(4)}} |
|
11 | {{ cell.input | indent(4)}} | |
12 | {% endblock input %} |
|
12 | {% endblock input %} | |
13 |
|
13 | |||
14 | {% block pyerr %} |
|
14 | {% block pyerr %} | |
15 | {{ super() }} |
|
15 | {{ super() }} | |
16 | {% endblock pyerr %} |
|
16 | {% endblock pyerr %} | |
17 |
|
17 | |||
18 | {% block traceback_line %} |
|
18 | {% block traceback_line %} | |
19 | {{ line | indent | strip_ansi }} |
|
19 | {{ line | indent | strip_ansi }} | |
20 | {% endblock traceback_line %} |
|
20 | {% endblock traceback_line %} | |
21 |
|
21 | |||
22 | {% block pyout %} |
|
22 | {% block pyout %} | |
23 |
|
23 | |||
24 | {% block data_priority scoped %} |
|
24 | {% block data_priority scoped %} | |
25 | {{ super() }} |
|
25 | {{ super() }} | |
26 | {% endblock %} |
|
26 | {% endblock %} | |
27 | {% endblock pyout %} |
|
27 | {% endblock pyout %} | |
28 |
|
28 | |||
29 | {% block stream %} |
|
29 | {% block stream %} | |
30 | {{ output.text | indent }} |
|
30 | {{ output.text | indent }} | |
31 | {% endblock stream %} |
|
31 | {% endblock stream %} | |
32 |
|
32 | |||
33 | {% block data_svg %} |
|
33 | {% block data_svg %} | |
34 | ![svg]({{ output.svg_filename | path2url }}) |
|
34 | ![svg]({{ output.svg_filename | path2url }}) | |
35 | {% endblock data_svg %} |
|
35 | {% endblock data_svg %} | |
36 |
|
36 | |||
37 | {% block data_png %} |
|
37 | {% block data_png %} | |
38 | ![png]({{ output.png_filename | path2url }}) |
|
38 | ![png]({{ output.png_filename | path2url }}) | |
39 | {% endblock data_png %} |
|
39 | {% endblock data_png %} | |
40 |
|
40 | |||
41 | {% block data_jpg %} |
|
41 | {% block data_jpg %} | |
42 | ![jpeg]({{ output.jpeg_filename | path2url }}) |
|
42 | ![jpeg]({{ output.jpeg_filename | path2url }}) | |
43 | {% endblock data_jpg %} |
|
43 | {% endblock data_jpg %} | |
44 |
|
44 | |||
45 | {% block data_latex %} |
|
45 | {% block data_latex %} | |
46 | {{ output.latex }} |
|
46 | {{ output.latex }} | |
47 | {% endblock data_latex %} |
|
47 | {% endblock data_latex %} | |
48 |
|
48 | |||
49 | {% block data_html scoped %} |
|
49 | {% block data_html scoped %} | |
50 | {{ output.html }} |
|
50 | {{ output.html }} | |
51 | {% endblock data_html %} |
|
51 | {% endblock data_html %} | |
52 |
|
52 | |||
53 | {% block data_text scoped %} |
|
53 | {% block data_text scoped %} | |
54 | {{ output.text | indent }} |
|
54 | {{ output.text | indent }} | |
55 | {% endblock data_text %} |
|
55 | {% endblock data_text %} | |
56 |
|
56 | |||
57 | {% block markdowncell scoped %} |
|
57 | {% block markdowncell scoped %} | |
58 | {{ cell.source | wrap_text(80) }} |
|
58 | {{ cell.source | wrap_text(80) }} | |
59 | {% endblock markdowncell %} |
|
59 | {% endblock markdowncell %} | |
60 |
|
60 | |||
61 |
|
61 | |||
62 | {% block headingcell scoped %} |
|
62 | {% block headingcell scoped %} | |
63 | {{ '#' * cell.level }} {{ cell.source | replace('\n', ' ') }} |
|
63 | {{ '#' * cell.level }} {{ cell.source | replace('\n', ' ') }} | |
64 | {% endblock headingcell %} |
|
64 | {% endblock headingcell %} | |
65 |
|
65 | |||
66 | {% block rawcell scoped %} |
|
|||
67 | {{ cell.source }} |
|
|||
68 | {% endblock rawcell %} |
|
|||
69 |
|
||||
70 | {% block unknowncell scoped %} |
|
66 | {% block unknowncell scoped %} | |
71 | unknown type {{ cell.type }} |
|
67 | unknown type {{ cell.type }} | |
72 | {% endblock unknowncell %} No newline at end of file |
|
68 | {% endblock unknowncell %} |
@@ -1,55 +1,51 b'' | |||||
1 | {%- extends 'null.tpl' -%} |
|
1 | {%- extends 'null.tpl' -%} | |
2 |
|
2 | |||
3 |
|
3 | |||
4 | {% block in_prompt %} |
|
4 | {% block in_prompt %} | |
5 | # In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]: |
|
5 | # In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]: | |
6 | {% endblock in_prompt %} |
|
6 | {% endblock in_prompt %} | |
7 |
|
7 | |||
8 | {% block output_prompt %} |
|
8 | {% block output_prompt %} | |
9 | # Out[{{ cell.prompt_number }}]: |
|
9 | # Out[{{ cell.prompt_number }}]: | |
10 | {% endblock output_prompt %} |
|
10 | {% endblock output_prompt %} | |
11 |
|
11 | |||
12 | {% block input %} |
|
12 | {% block input %} | |
13 | {{ cell.input | ipython2python }} |
|
13 | {{ cell.input | ipython2python }} | |
14 | {% endblock input %} |
|
14 | {% endblock input %} | |
15 |
|
15 | |||
16 | {# Those Two are for error displaying |
|
16 | {# Those Two are for error displaying | |
17 | even if the first one seem to do nothing, |
|
17 | even if the first one seem to do nothing, | |
18 | it introduces a new line |
|
18 | it introduces a new line | |
19 | #} |
|
19 | #} | |
20 | {% block pyerr %} |
|
20 | {% block pyerr %} | |
21 | {{ super() }} |
|
21 | {{ super() }} | |
22 | {% endblock pyerr %} |
|
22 | {% endblock pyerr %} | |
23 |
|
23 | |||
24 | {% block traceback_line %} |
|
24 | {% block traceback_line %} | |
25 | {{ line | indent | strip_ansi }} |
|
25 | {{ line | indent | strip_ansi }} | |
26 | {% endblock traceback_line %} |
|
26 | {% endblock traceback_line %} | |
27 | {# .... #} |
|
27 | {# .... #} | |
28 |
|
28 | |||
29 | {% block pyout %} |
|
29 | {% block pyout %} | |
30 | {{ output.text | indent | comment_lines }} |
|
30 | {{ output.text | indent | comment_lines }} | |
31 | {% endblock pyout %} |
|
31 | {% endblock pyout %} | |
32 |
|
32 | |||
33 | {% block stream %} |
|
33 | {% block stream %} | |
34 | {{ output.text | indent | comment_lines }} |
|
34 | {{ output.text | indent | comment_lines }} | |
35 | {% endblock stream %} |
|
35 | {% endblock stream %} | |
36 |
|
36 | |||
37 | {% block display_data scoped %} |
|
37 | {% block display_data scoped %} | |
38 | # image file: |
|
38 | # image file: | |
39 | {% endblock display_data %} |
|
39 | {% endblock display_data %} | |
40 |
|
40 | |||
41 | {% block markdowncell scoped %} |
|
41 | {% block markdowncell scoped %} | |
42 | {{ cell.source | comment_lines }} |
|
42 | {{ cell.source | comment_lines }} | |
43 | {% endblock markdowncell %} |
|
43 | {% endblock markdowncell %} | |
44 |
|
44 | |||
45 | {% block headingcell scoped %} |
|
45 | {% block headingcell scoped %} | |
46 | {{ '#' * cell.level }}{{ cell.source | replace('\n', ' ') | comment_lines }} |
|
46 | {{ '#' * cell.level }}{{ cell.source | replace('\n', ' ') | comment_lines }} | |
47 | {% endblock headingcell %} |
|
47 | {% endblock headingcell %} | |
48 |
|
48 | |||
49 | {% block rawcell scoped %} |
|
|||
50 | {{ cell.source | comment_lines }} |
|
|||
51 | {% endblock rawcell %} |
|
|||
52 |
|
||||
53 | {% block unknowncell scoped %} |
|
49 | {% block unknowncell scoped %} | |
54 | unknown type {{ cell.type }} |
|
50 | unknown type {{ cell.type }} | |
55 | {% endblock unknowncell %} No newline at end of file |
|
51 | {% endblock unknowncell %} |
@@ -1,84 +1,80 b'' | |||||
1 | {%- extends 'display_priority.tpl' -%} |
|
1 | {%- extends 'display_priority.tpl' -%} | |
2 |
|
2 | |||
3 |
|
3 | |||
4 | {% block in_prompt %} |
|
4 | {% block in_prompt %} | |
5 | {% endblock in_prompt %} |
|
5 | {% endblock in_prompt %} | |
6 |
|
6 | |||
7 | {% block output_prompt %} |
|
7 | {% block output_prompt %} | |
8 | {% endblock output_prompt %} |
|
8 | {% endblock output_prompt %} | |
9 |
|
9 | |||
10 | {% block input %} |
|
10 | {% block input %} | |
11 | {%- if not cell.input.isspace() -%} |
|
11 | {%- if not cell.input.isspace() -%} | |
12 | .. code:: python |
|
12 | .. code:: python | |
13 |
|
13 | |||
14 | {{ cell.input | indent}} |
|
14 | {{ cell.input | indent}} | |
15 | {%- endif -%} |
|
15 | {%- endif -%} | |
16 | {% endblock input %} |
|
16 | {% endblock input %} | |
17 |
|
17 | |||
18 | {% block pyerr %} |
|
18 | {% block pyerr %} | |
19 | :: |
|
19 | :: | |
20 |
|
20 | |||
21 | {{ super() }} |
|
21 | {{ super() }} | |
22 | {% endblock pyerr %} |
|
22 | {% endblock pyerr %} | |
23 |
|
23 | |||
24 | {% block traceback_line %} |
|
24 | {% block traceback_line %} | |
25 | {{ line | indent | strip_ansi }} |
|
25 | {{ line | indent | strip_ansi }} | |
26 | {% endblock traceback_line %} |
|
26 | {% endblock traceback_line %} | |
27 |
|
27 | |||
28 | {% block pyout %} |
|
28 | {% block pyout %} | |
29 | {% block data_priority scoped %} |
|
29 | {% block data_priority scoped %} | |
30 | {{ super() }} |
|
30 | {{ super() }} | |
31 | {% endblock %} |
|
31 | {% endblock %} | |
32 | {% endblock pyout %} |
|
32 | {% endblock pyout %} | |
33 |
|
33 | |||
34 | {% block stream %} |
|
34 | {% block stream %} | |
35 | .. parsed-literal:: |
|
35 | .. parsed-literal:: | |
36 |
|
36 | |||
37 | {{ output.text | indent }} |
|
37 | {{ output.text | indent }} | |
38 | {% endblock stream %} |
|
38 | {% endblock stream %} | |
39 |
|
39 | |||
40 | {% block data_svg %} |
|
40 | {% block data_svg %} | |
41 | .. image:: {{ output.svg_filename }} |
|
41 | .. image:: {{ output.svg_filename }} | |
42 | {% endblock data_svg %} |
|
42 | {% endblock data_svg %} | |
43 |
|
43 | |||
44 | {% block data_png %} |
|
44 | {% block data_png %} | |
45 | .. image:: {{ output.png_filename }} |
|
45 | .. image:: {{ output.png_filename }} | |
46 | {% endblock data_png %} |
|
46 | {% endblock data_png %} | |
47 |
|
47 | |||
48 | {% block data_jpg %} |
|
48 | {% block data_jpg %} | |
49 | .. image:: {{ output.jpeg_filename }} |
|
49 | .. image:: {{ output.jpeg_filename }} | |
50 | {% endblock data_jpg %} |
|
50 | {% endblock data_jpg %} | |
51 |
|
51 | |||
52 | {% block data_latex %} |
|
52 | {% block data_latex %} | |
53 | .. math:: |
|
53 | .. math:: | |
54 |
|
54 | |||
55 | {{ output.latex | strip_dollars | indent }} |
|
55 | {{ output.latex | strip_dollars | indent }} | |
56 | {% endblock data_latex %} |
|
56 | {% endblock data_latex %} | |
57 |
|
57 | |||
58 | {% block data_text scoped %} |
|
58 | {% block data_text scoped %} | |
59 | .. parsed-literal:: |
|
59 | .. parsed-literal:: | |
60 |
|
60 | |||
61 | {{ output.text | indent }} |
|
61 | {{ output.text | indent }} | |
62 | {% endblock data_text %} |
|
62 | {% endblock data_text %} | |
63 |
|
63 | |||
64 | {% block data_html scoped %} |
|
64 | {% block data_html scoped %} | |
65 | .. raw:: html |
|
65 | .. raw:: html | |
66 |
|
66 | |||
67 | {{ output.html | indent }} |
|
67 | {{ output.html | indent }} | |
68 | {% endblock data_html %} |
|
68 | {% endblock data_html %} | |
69 |
|
69 | |||
70 | {% block markdowncell scoped %} |
|
70 | {% block markdowncell scoped %} | |
71 | {{ cell.source | markdown2rst }} |
|
71 | {{ cell.source | markdown2rst }} | |
72 | {% endblock markdowncell %} |
|
72 | {% endblock markdowncell %} | |
73 |
|
73 | |||
74 | {% block headingcell scoped %} |
|
74 | {% block headingcell scoped %} | |
75 | {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2rst }} |
|
75 | {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2rst }} | |
76 | {% endblock headingcell %} |
|
76 | {% endblock headingcell %} | |
77 |
|
77 | |||
78 | {% block rawcell scoped %} |
|
|||
79 | {{ cell.source }} |
|
|||
80 | {% endblock rawcell %} |
|
|||
81 |
|
||||
82 | {% block unknowncell scoped %} |
|
78 | {% block unknowncell scoped %} | |
83 | unknown type {{cell.type}} |
|
79 | unknown type {{cell.type}} | |
84 | {% endblock unknowncell %} |
|
80 | {% endblock unknowncell %} |
@@ -1,91 +1,94 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 | {%- endblock markdowncell -%} |
|
74 | {%- endblock markdowncell -%} | |
75 | {%- elif cell.cell_type in ['heading'] -%} |
|
75 | {%- elif cell.cell_type in ['heading'] -%} | |
76 | {%- block headingcell scoped-%} |
|
76 | {%- block headingcell scoped-%} | |
77 | {%- endblock headingcell -%} |
|
77 | {%- endblock headingcell -%} | |
78 | {%- elif cell.cell_type in ['raw'] -%} |
|
78 | {%- elif cell.cell_type in ['raw'] -%} | |
79 | {%- block rawcell scoped-%} |
|
79 | {%- block rawcell scoped -%} | |
|
80 | {% if cell.metadata.get('raw_format', resources.get('raw_format', '')).lower() in resources.get('raw_formats', ['']) %} | |||
|
81 | {{ cell.source }} | |||
|
82 | {% endif %} | |||
80 | {%- endblock rawcell -%} |
|
83 | {%- endblock rawcell -%} | |
81 | {%- else -%} |
|
84 | {%- else -%} | |
82 | {%- block unknowncell scoped-%} |
|
85 | {%- block unknowncell scoped-%} | |
83 | {%- endblock unknowncell -%} |
|
86 | {%- endblock unknowncell -%} | |
84 | {%- endif -%} |
|
87 | {%- endif -%} | |
85 | {%- endblock any_cell -%} |
|
88 | {%- endblock any_cell -%} | |
86 | {%- endfor -%} |
|
89 | {%- endfor -%} | |
87 | {%- endfor -%} |
|
90 | {%- endfor -%} | |
88 | {%- endblock body -%} |
|
91 | {%- endblock body -%} | |
89 |
|
92 | |||
90 | {%- block footer -%} |
|
93 | {%- block footer -%} | |
91 | {%- endblock footer -%} |
|
94 | {%- endblock footer -%} |
General Comments 0
You need to be logged in to leave comments.
Login now