Show More
@@ -101,6 +101,15 b' class ConverterTemplate(Configurable):' | |||||
101 | shoudl be mostly configurable |
|
101 | shoudl be mostly configurable | |
102 | """ |
|
102 | """ | |
103 |
|
103 | |||
|
104 | display_data_priority = List(['html', 'pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'], | |||
|
105 | config=True, | |||
|
106 | help= """ | |||
|
107 | An ordered list of prefered output type, the first | |||
|
108 | encounterd will usually be used when converting discarding | |||
|
109 | the others. | |||
|
110 | """ | |||
|
111 | ) | |||
|
112 | ||||
104 | pre_transformer_order = List(['haspyout_transformer'], |
|
113 | pre_transformer_order = List(['haspyout_transformer'], | |
105 | config=True, |
|
114 | config=True, | |
106 | help= """ |
|
115 | help= """ | |
@@ -109,6 +118,14 b' class ConverterTemplate(Configurable):' | |||||
109 | """ |
|
118 | """ | |
110 | ) |
|
119 | ) | |
111 |
|
120 | |||
|
121 | extract_figures = Bool(False, | |||
|
122 | config=True, | |||
|
123 | help= """ | |||
|
124 | wether to remove figure data from ipynb and store them in auxiliary | |||
|
125 | dictionnary | |||
|
126 | """ | |||
|
127 | ) | |||
|
128 | ||||
112 | tex_environement = Bool(False, |
|
129 | tex_environement = Bool(False, | |
113 | config=True, |
|
130 | config=True, | |
114 | help=""" is this a tex environment or not """) |
|
131 | help=""" is this a tex environment or not """) | |
@@ -120,13 +137,23 b' class ConverterTemplate(Configurable):' | |||||
120 | # Instance-level attributes that are set in the constructor for this |
|
137 | # Instance-level attributes that are set in the constructor for this | |
121 | # class. |
|
138 | # class. | |
122 | #------------------------------------------------------------------------- |
|
139 | #------------------------------------------------------------------------- | |
|
140 | infile = Any() | |||
|
141 | ||||
123 |
|
142 | |||
|
143 | infile_dir = Unicode() | |||
|
144 | ||||
|
145 | #todo: move to filter | |||
|
146 | def filter_data_type(self, output): | |||
|
147 | """ return the first availlable format in priority """ | |||
|
148 | for fmt in self.display_data_priority: | |||
|
149 | if fmt in output: | |||
|
150 | return [fmt] | |||
|
151 | raise Exception("did not found any format I can extract in output, shoudl at lest have one") | |||
124 |
|
152 | |||
125 | preprocessors = [] |
|
153 | preprocessors = [] | |
126 |
|
154 | |||
127 | def __init__(self, preprocessors={}, jinja_filters={}, config=None, **kw): |
|
155 | def __init__(self, preprocessors={}, jinja_filters={}, config=None, **kw): | |
128 | """ Init a new converter. |
|
156 | """ | |
129 |
|
||||
130 | config: the Configurable config object to pass around. |
|
157 | config: the Configurable config object to pass around. | |
131 |
|
158 | |||
132 | preprocessors: dict of **availlable** key/value function to run on |
|
159 | preprocessors: dict of **availlable** key/value function to run on |
General Comments 0
You need to be logged in to leave comments.
Login now