Show More
@@ -104,45 +104,28 b' class Exporter(Configurable):' | |||||
104 | #constructor for this class. |
|
104 | #constructor for this class. | |
105 | preprocessors = [] |
|
105 | preprocessors = [] | |
106 |
|
106 | |||
107 |
def __init__(self, preprocessors=None, jinja_filters=None, config=None, |
|
107 | def __init__(self, preprocessors=None, jinja_filters=None, config=None, **kw): | |
108 | """ Init a new converter. |
|
108 | """ Init a new converter. | |
109 |
|
109 | |||
110 | config: the Configurable config object to pass around. |
|
110 | config: the Configurable config object to pass around. | |
111 |
|
111 | |||
112 |
preprocessors: dict of **avail |
|
112 | preprocessors: dict of **available** key/value function to run on | |
113 | ipynb json data before conversion to extract/inline file. |
|
113 | ipynb json data before conversion to extract/in-line file. | |
114 | See `transformer.py` and `ConfigurableTransformers` |
|
114 | See `transformer.py` and `ConfigurableTransformers` | |
115 |
|
115 | |||
116 | set the order in which the transformers should apply |
|
116 | set the order in which the transformers should apply | |
117 | with the `pre_transformer_order` trait of this class |
|
117 | with the `pre_transformer_order` trait of this class | |
118 |
|
118 | |||
119 | transformers registerd by this key will take precedence on |
|
119 | transformers registered by this key will take precedence on | |
120 | default one. |
|
120 | default one. | |
121 |
|
121 | |||
122 | jinja_filters: dict of supplementary jinja filter that should be made |
|
122 | jinja_filters: dict of supplementary jinja filter that should be made | |
123 |
avail |
|
123 | available in template. If those are of Configurable Class type, | |
124 | they will be instanciated with the config object as argument. |
|
124 | they will be instanciated with the config object as argument. | |
125 |
|
125 | |||
126 |
user defined filter will overwrite the one avail |
|
126 | user defined filter will overwrite the one available by default. | |
127 | """ |
|
127 | """ | |
128 |
|
128 | |||
129 | #Set the default options for the exporter. |
|
|||
130 | default_config = self.config |
|
|||
131 |
|
||||
132 | #Set properties that must be set in the config class in order to |
|
|||
133 | #propagate to other classes. |
|
|||
134 | default_config.GlobalConfigurable.display_data_priority =['svg', 'png', 'latex', 'jpg', 'jpeg','text'] |
|
|||
135 | default_config.ExtractFigureTransformer.display_data_priority=['svg', 'png', 'latex', 'jpg', 'jpeg','text'] |
|
|||
136 |
|
||||
137 | #Set default properties of the exporter. |
|
|||
138 | #For most (or all cases), the template file name matches the format name. |
|
|||
139 | self.display_data_priority= ['svg', 'png', 'latex', 'jpg', 'jpeg','text'] |
|
|||
140 | self.template_file = export_format |
|
|||
141 |
|
||||
142 | if not config == None: |
|
|||
143 | default_config._merge(config) |
|
|||
144 | config = default_config |
|
|||
145 |
|
||||
146 | #Call the base class constructor |
|
129 | #Call the base class constructor | |
147 | super(Exporter, self).__init__(config=config, **kw) |
|
130 | super(Exporter, self).__init__(config=config, **kw) | |
148 |
|
131 |
General Comments 0
You need to be logged in to leave comments.
Login now