##// END OF EJS Templates
rename call methods to transform and postprocess...
Paul Ivanov -
Show More
@@ -32,7 +32,7 b' class CheeseTransformer(Transformer):'
32 32 super(CheeseTransformer, self).__init__(**kw)
33 33
34 34
35 def call(self, nb, resources):
35 def transform(self, nb, resources):
36 36 """
37 37 Sphinx transformation to apply on each notebook.
38 38
@@ -23,13 +23,13 b' class PostProcessorBase(NbConvertBase):'
23 23
24 24 def __call__(self, input):
25 25 """
26 See def call() ...
26 See def postprocess() ...
27 27 """
28 self.call(input)
28 self.postprocess(input)
29 29
30 30
31 def call(self, input):
31 def postprocess(self, input):
32 32 """
33 33 Post-process output from a writer.
34 34 """
35 raise NotImplementedError('call')
35 raise NotImplementedError('postprocess')
@@ -37,7 +37,7 b' class PDFPostProcessor(PostProcessorBase):'
37 37 Whether or not to display the output of the compile call.
38 38 """)
39 39
40 def call(self, input):
40 def postprocess(self, input):
41 41 """
42 42 Consume and write Jinja output a PDF.
43 43 See files.py for more...
@@ -34,7 +34,7 b' class ServePostProcessor(PostProcessorBase):'
34 34 help="""Set to False to deactivate
35 35 the opening of the browser""")
36 36
37 def call(self, input):
37 def postprocess(self, input):
38 38 """
39 39 Simple implementation to serve the build directory.
40 40 """
@@ -33,7 +33,7 b' class Transformer(NbConvertBase):'
33 33 using c.SubClassName.atribute=value
34 34
35 35 you can overwrite :meth:`transform_cell` to apply a transformation independently on each cell
36 or :meth:`call` if you prefer your own logic. See corresponding docstring for informations.
36 or :meth:`transform` if you prefer your own logic. See corresponding docstring for informations.
37 37
38 38 Disabled by default and can be enabled via the config by
39 39 'c.YourTransformerName.enabled = True'
@@ -58,12 +58,12 b' class Transformer(NbConvertBase):'
58 58
59 59 def __call__(self, nb, resources):
60 60 if self.enabled:
61 return self.call(nb,resources)
61 return self.transform(nb,resources)
62 62 else:
63 63 return nb, resources
64 64
65 65
66 def call(self, nb, resources):
66 def transform(self, nb, resources):
67 67 """
68 68 Transformation to apply on each notebook.
69 69
@@ -56,7 +56,7 b' class CSSHTMLHeaderTransformer(Transformer):'
56 56 self._regen_header()
57 57
58 58
59 def call(self, nb, resources):
59 def transform(self, nb, resources):
60 60 """Fetch and add CSS to the resource dictionary
61 61
62 62 Fetch CSS from IPython and Pygments to add at the beginning
@@ -34,7 +34,7 b' class RevealHelpTransformer(Transformer):'
34 34 help="""If you want to use the speaker notes
35 35 set this to True.""")
36 36
37 def call(self, nb, resources):
37 def transform(self, nb, resources):
38 38 """
39 39 Called once to 'transform' contents of the notebook.
40 40
@@ -109,7 +109,7 b' class SphinxTransformer(Transformer):'
109 109 overridetitle = Unicode("", config=True, help="")
110 110
111 111
112 def call(self, nb, resources):
112 def transform(self, nb, resources):
113 113 """
114 114 Sphinx transformation to apply on each notebook.
115 115
@@ -10,3 +10,7 b' Backwards incompatible changes'
10 10
11 11 * Python 2.6 and 3.2 are no longer supported: the minimum required
12 12 Python versions are now 2.7 and 3.3.
13 * The `call` methods for nbconvert transformers has been renamed to
14 `transform`.
15 * The `call` methods of nbconvert post-processsors have been renamed to
16 `postprocess`.
General Comments 0
You need to be logged in to leave comments. Login now