Show More
@@ -46,13 +46,11 b' class ResourcesDict(collections.defaultdict):' | |||
|
46 | 46 | |
|
47 | 47 | class Exporter(LoggingConfigurable): |
|
48 | 48 | """ |
|
49 | Exporter class that only converts from notebook to notebook | |
|
50 | by applying the preprocessors and providing basic methods for | |
|
51 | reading a notebook from different sources. | |
|
49 | Class containing methods that sequentially run a list of preprocessors on a | |
|
50 | NotebookNode object and then return the modified NotebookNode object and | |
|
51 | accompanying resources dict. | |
|
52 | 52 | """ |
|
53 | 53 | |
|
54 | # finish the docstring | |
|
55 | ||
|
56 | 54 | file_extension = Unicode( |
|
57 | 55 | 'txt', config=True, |
|
58 | 56 | help="Extension of the file that should be written to disk" |
@@ -108,7 +106,7 b' class Exporter(LoggingConfigurable):' | |||
|
108 | 106 | super(Exporter, self)._config_changed(name, old, c) |
|
109 | 107 | |
|
110 | 108 | |
|
111 | def from_notebook_node(self, nb, resources=None): | |
|
109 | def from_notebook_node(self, nb, resources=None, **kw): | |
|
112 | 110 | """ |
|
113 | 111 | Convert a notebook from a notebook node instance. |
|
114 | 112 | |
@@ -123,7 +121,7 b' class Exporter(LoggingConfigurable):' | |||
|
123 | 121 | resources = self._init_resources(resources) |
|
124 | 122 | |
|
125 | 123 | # Preprocess |
|
126 |
nb_copy, resources = self._ |
|
|
124 | nb_copy, resources = self._preprocess(nb_copy, resources) | |
|
127 | 125 | |
|
128 | 126 | return nb_copy, resources |
|
129 | 127 | |
@@ -169,7 +167,7 b' class Exporter(LoggingConfigurable):' | |||
|
169 | 167 | def register_preprocessor(self, preprocessor, enabled=False): |
|
170 | 168 | """ |
|
171 | 169 | Register a preprocessor. |
|
172 |
|
|
|
170 | Preprocessors are classes that act upon the notebook before it is | |
|
173 | 171 | passed into the Jinja templating engine. preprocessors are also |
|
174 | 172 | capable of passing additional information to the Jinja |
|
175 | 173 | templating engine. |
@@ -256,7 +254,7 b' class Exporter(LoggingConfigurable):' | |||
|
256 | 254 | return resources |
|
257 | 255 | |
|
258 | 256 | |
|
259 |
def _ |
|
|
257 | def _preprocess(self, nb, resources): | |
|
260 | 258 | """ |
|
261 | 259 | Preprocess the notebook before passing it into the Jinja engine. |
|
262 | 260 | To preprocess the notebook is to apply all of the |
General Comments 0
You need to be logged in to leave comments.
Login now