Show More
@@ -166,6 +166,7 b' class ConverterTemplate(Configurable):' | |||||
166 | for fmt in self.display_data_priority: |
|
166 | for fmt in self.display_data_priority: | |
167 | if fmt in output: |
|
167 | if fmt in output: | |
168 | return [fmt] |
|
168 | return [fmt] | |
|
169 | raise Exception("did not found any format I can extract in output, shoudl at lest have one") | |||
169 |
|
170 | |||
170 | preprocessors = [] |
|
171 | preprocessors = [] | |
171 |
|
172 |
@@ -127,7 +127,6 b' class ExtractFigureTransformer(ConfigurableTransformers):' | |||||
127 | for type in self.display_data_priority: |
|
127 | for type in self.display_data_priority: | |
128 | if out.hasattr(type): |
|
128 | if out.hasattr(type): | |
129 | figname, key, data = self._new_figure(out[type], type, count) |
|
129 | figname, key, data = self._new_figure(out[type], type, count) | |
130 | cell.outputs[i][type] = figname |
|
|||
131 | out['key_'+type] = figname |
|
130 | out['key_'+type] = figname | |
132 | other['figures'][key] = data |
|
131 | other['figures'][key] = data | |
133 | count = count+1 |
|
132 | count = count+1 |
@@ -1,7 +1,13 b'' | |||||
1 | c = get_config() |
|
1 | c = get_config() | |
2 |
|
2 | |||
3 |
c.ConverterTemplate.extract_figures= |
|
3 | c.ConverterTemplate.extract_figures=True | |
4 | c.ConverterTemplate.template_file='rst' |
|
4 | c.ConverterTemplate.template_file='rst' | |
5 | c.ConverterTemplate.tex_environement=False |
|
5 | c.ConverterTemplate.tex_environement=False | |
6 |
|
6 | |||
7 | c.NbconvertApp.fileext='rst' |
|
7 | c.NbconvertApp.fileext='rst' | |
|
8 | c.ExtractFigureTransformer.enabled=True | |||
|
9 | ||||
|
10 | c.ExtractFigureTransformer.display_data_priority=['svg', 'png', 'latex', 'jpg', 'jpeg','text'] | |||
|
11 | c.ConverterTemplate.display_data_priority=['svg', 'png', 'latex', 'jpg', 'jpeg','text'] | |||
|
12 | ||||
|
13 |
@@ -1,5 +1,4 b'' | |||||
1 |
{%- extends ' |
|
1 | {%- extends 'display_priority.tpl' -%} | |
2 |
|
||||
3 | {% block in_prompt -%} |
|
2 | {% block in_prompt -%} | |
4 | In[{{cell.prompt_number if cell.prompt_number else ' '}}]: |
|
3 | In[{{cell.prompt_number if cell.prompt_number else ' '}}]: | |
5 |
|
4 | |||
@@ -7,25 +6,18 b" In[{{cell.prompt_number if cell.prompt_number else ' '}}]:" | |||||
7 |
|
6 | |||
8 | {% endblock in_prompt %} |
|
7 | {% endblock in_prompt %} | |
9 |
|
8 | |||
10 | {% block output_prompt %} |
|
9 | {% block output_prompt %}{% if cell.haspyout -%} | |
11 | Out[{{cell.prompt_number}}]:{% endblock output_prompt %} |
|
10 | Out[{{cell.prompt_number}}]:{% endif %}{% endblock output_prompt %} | |
12 |
|
11 | |||
13 | {% block input %}{{ cell.input | indent}} |
|
12 | {% block input %}{{ cell.input | indent}} | |
14 | {% endblock input %} |
|
|||
15 |
|
||||
16 |
|
13 | |||
17 | {# Those Two are for error displaying |
|
14 | {% endblock input %} | |
18 | even if the first one seem to do nothing, |
|
|||
19 | it introduces a new line |
|
|||
20 |
|
15 | |||
21 | #} |
|
|||
22 | {% block pyerr %}{{ super() }} |
|
16 | {% block pyerr %}{{ super() }} | |
23 | {% endblock pyerr %} |
|
17 | {% endblock pyerr %} | |
24 |
|
18 | |||
25 | {% block traceback_line %} |
|
19 | {% block traceback_line %} | |
26 | {{ line |indent| rm_ansi }}{% endblock traceback_line %} |
|
20 | {{ line |indent| rm_ansi }}{% endblock traceback_line %} | |
27 | {# .... #} |
|
|||
28 |
|
||||
29 |
|
21 | |||
30 | {% block pyout %} |
|
22 | {% block pyout %} | |
31 | .. parsed-literal:: |
|
23 | .. parsed-literal:: | |
@@ -42,12 +34,21 b' it introduces a new line' | |||||
42 |
|
34 | |||
43 |
|
35 | |||
44 |
|
36 | |||
45 | {% block display_data scoped %} |
|
37 | {% block data_svg %}.. image:: {{output.key_svg}} | |
46 | # image file: |
|
38 | ||
47 |
{% endblock |
|
39 | {% endblock data_svg %} | |
48 |
|
40 | |||
49 | {% block markdowncell scoped %} |
|
41 | {% block data_png %}.. image:: {{output.key_png}} | |
50 | {{ cell.source | markdown2rst }} |
|
42 | ||
|
43 | {% endblock data_png %} | |||
|
44 | ||||
|
45 | {% block data_text scoped %}.. parsed-literal:: | |||
|
46 | ||||
|
47 | {{output.text | indent}} | |||
|
48 | ||||
|
49 | {% endblock data_text %} | |||
|
50 | ||||
|
51 | {% block markdowncell scoped %}{{ cell.source | markdown2rst }} | |||
51 | {% endblock markdowncell %} |
|
52 | {% endblock markdowncell %} | |
52 |
|
53 | |||
53 | {% block headingcell scoped %} |
|
54 | {% block headingcell scoped %} | |
@@ -58,10 +59,10 b' it introduces a new line' | |||||
58 | {%- elif cell.level == 2 %} |
|
59 | {%- elif cell.level == 2 %} | |
59 | {{- '-' * len }} |
|
60 | {{- '-' * len }} | |
60 | {% endif %} |
|
61 | {% endif %} | |
|
62 | ||||
61 | {% endblock headingcell %} |
|
63 | {% endblock headingcell %} | |
62 |
|
64 | |||
63 | {% block rawcell scoped %} |
|
65 | {% block rawcell scoped %}{{ cell.source }} | |
64 | {{ cell.source }} |
|
|||
65 | {% endblock rawcell %} |
|
66 | {% endblock rawcell %} | |
66 |
|
67 | |||
67 | {% block unknowncell scoped %} |
|
68 | {% block unknowncell scoped %} |
General Comments 0
You need to be logged in to leave comments.
Login now