Show More
@@ -93,7 +93,7 b' class LatexExporter(Exporter):' | |||
|
93 | 93 | @property |
|
94 | 94 | def default_config(self): |
|
95 | 95 | c = Config({ |
|
96 |
' |
|
|
96 | 'NbConvertBase': { | |
|
97 | 97 | 'display_data_priority' : ['latex', 'png', 'jpg', 'svg', 'jpeg', 'text'] |
|
98 | 98 | }, |
|
99 | 99 | 'ExtractFigureTransformer': { |
@@ -3,7 +3,7 b'' | |||
|
3 | 3 | The filter contained in the file allows the converter templates to select |
|
4 | 4 | the output format that is most valuable to the active export format. The |
|
5 | 5 | value of the different formats is set via |
|
6 |
|
|
|
6 | NbConvertBase.display_data_priority | |
|
7 | 7 | """ |
|
8 | 8 | #----------------------------------------------------------------------------- |
|
9 | 9 | # Copyright (c) 2013, the IPython Development Team. |
@@ -17,11 +17,11 b' GlobalConfigurable.display_data_priority' | |||
|
17 | 17 | # Classes and functions |
|
18 | 18 | #----------------------------------------------------------------------------- |
|
19 | 19 | |
|
20 |
from ..utils.config import |
|
|
20 | from ..utils.config import NbConvertBase | |
|
21 | 21 | |
|
22 | 22 | __all__ = ['DataTypeFilter'] |
|
23 | 23 | |
|
24 |
class DataTypeFilter( |
|
|
24 | class DataTypeFilter(NbConvertBase): | |
|
25 | 25 | """ Returns the preferred display format """ |
|
26 | 26 | |
|
27 | 27 | def __call__(self, output): |
@@ -31,7 +31,7 b' from IPython.utils.importstring import import_item' | |||
|
31 | 31 | from .exporters.export import export_by_name, get_export_names, ExporterNameError |
|
32 | 32 | from .exporters.exporter import Exporter |
|
33 | 33 | from .writers.base import WriterBase |
|
34 |
from .utils.config import |
|
|
34 | from .utils.config import NbConvertBase | |
|
35 | 35 | |
|
36 | 36 | #----------------------------------------------------------------------------- |
|
37 | 37 | #Classes and functions |
@@ -100,7 +100,7 b' class NbConvertApp(BaseIPythonApplication):' | |||
|
100 | 100 | #Register class here to have help with help all |
|
101 | 101 | self.classes.insert(0, Exporter) |
|
102 | 102 | self.classes.insert(0, WriterBase) |
|
103 |
self.classes.insert(0, |
|
|
103 | self.classes.insert(0, NbConvertBase) | |
|
104 | 104 | |
|
105 | 105 | #Init |
|
106 | 106 | self.init_config(self.extra_args) |
@@ -16,14 +16,14 b' It exposes a convenient class to inherit from to access configurability.' | |||
|
16 | 16 | # Imports |
|
17 | 17 | #----------------------------------------------------------------------------- |
|
18 | 18 | |
|
19 |
from ..utils.config import |
|
|
19 | from ..utils.config import NbConvertBase | |
|
20 | 20 | from IPython.utils.traitlets import Bool |
|
21 | 21 | |
|
22 | 22 | #----------------------------------------------------------------------------- |
|
23 | 23 | # Classes and Functions |
|
24 | 24 | #----------------------------------------------------------------------------- |
|
25 | 25 | |
|
26 |
class ConfigurableTransformer( |
|
|
26 | class ConfigurableTransformer(NbConvertBase): | |
|
27 | 27 | """ A configurable transformer |
|
28 | 28 | |
|
29 | 29 | Inherit from this class if you wish to have configurability for your |
@@ -18,7 +18,7 b' from IPython.config.configurable import Configurable' | |||
|
18 | 18 | # Classes and functions |
|
19 | 19 | #----------------------------------------------------------------------------- |
|
20 | 20 | |
|
21 |
class |
|
|
21 | class NbConvertBase(Configurable): | |
|
22 | 22 | """Global configurable class for shared config |
|
23 | 23 | |
|
24 | 24 | Usefull for display data priority that might be use by many trasnformers |
@@ -34,4 +34,4 b' class GlobalConfigurable(Configurable):' | |||
|
34 | 34 | ) |
|
35 | 35 | |
|
36 | 36 | def __init__(self, **kw): |
|
37 |
super( |
|
|
37 | super(NbConvertBase, self).__init__(**kw) |
@@ -16,13 +16,13 b' Contains writer base class.' | |||
|
16 | 16 | |
|
17 | 17 | from IPython.utils.traitlets import List |
|
18 | 18 | |
|
19 |
from ..utils.config import |
|
|
19 | from ..utils.config import NbConvertBase | |
|
20 | 20 | |
|
21 | 21 | #----------------------------------------------------------------------------- |
|
22 | 22 | # Classes |
|
23 | 23 | #----------------------------------------------------------------------------- |
|
24 | 24 | |
|
25 |
class WriterBase( |
|
|
25 | class WriterBase(NbConvertBase): | |
|
26 | 26 | """Consumes output from nbconvert export...() methods and writes to a |
|
27 | 27 | useful location. """ |
|
28 | 28 |
General Comments 0
You need to be logged in to leave comments.
Login now