##// END OF EJS Templates
share some global config state
Matthias BUSSONNIER -
Show More
@@ -0,0 +1,20 b''
1 from IPython.utils.traitlets import (Unicode, List, Bool)
2 from IPython.config.configurable import Configurable
3
4 class GlobalConfigurable(Configurable):
5 """Global configurable class for shared config
6
7 Usefull for display data priority that might be use by many trasnformers
8 """
9
10 display_data_priority = List(['html', 'pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'],
11 config=True,
12 help= """
13 An ordered list of prefered output type, the first
14 encounterd will usually be used when converting discarding
15 the others.
16 """
17 )
18
19 def __init__(self, config=None, **kw):
20 super(GlobalConfigurable, self).__init__( config=config, **kw)
@@ -17,6 +17,8 b' from .utils import remove_ansi'
17 17 from .utils import highlight, ansi2html
18 18 from .utils import markdown2latex
19 19
20 from converters.config import GlobalConfigurable
21
20 22 from IPython.config.configurable import Configurable
21 23 from IPython.utils.traitlets import List
22 24
@@ -24,24 +26,6 b' from IPython.utils.traitlets import List'
24 26 # Class declarations
25 27 #-----------------------------------------------------------------------------
26 28
27 class GlobalConfigurable(Configurable):
28 """Global configurable class for shared config
29
30 Usefull for display data priority that might be use by many trasnformers
31 """
32
33 display_data_priority = List(['html', 'pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'],
34 config=True,
35 help= """
36 An ordered list of prefered output type, the first
37 encounterd will usually be used when converting discarding
38 the others.
39 """
40 )
41
42 def __init__(self, config=None, **kw):
43 super(GlobalConfigurable, self).__init__( config=config, **kw)
44
45 29 class ConfigurableFilter(GlobalConfigurable):
46 30 """Configurable Jinja Filter"""
47 31
@@ -42,7 +42,7 b' from converters.jinja_filters import (python_comment, indent,'
42 42 ansi2html, markdown2latex, escape_tex, FilterDataType)
43 43
44 44 from converters.utils import markdown2rst
45
45 from converters.config import GlobalConfigurable
46 46
47 47
48 48
@@ -11,7 +11,9 b' from __future__ import print_function'
11 11 from IPython.config.configurable import Configurable
12 12 from IPython.utils.traitlets import Unicode, Bool, Dict, List
13 13
14 class ConfigurableTransformers(Configurable):
14 from converters.config import GlobalConfigurable
15
16 class ConfigurableTransformers(GlobalConfigurable):
15 17 """ A configurable transformer
16 18
17 19 Inherit from this class if you wish to have configurability for your
@@ -145,14 +147,6 b' class ExtractFigureTransformer(ActivatableTransformer):'
145 147 Usefull for latex where svg will be converted to pdf before inclusion
146 148 """
147 149 )
148 display_data_priority = List(['html', 'pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'],
149 config=True,
150 help= """
151 An ordered list of prefered output type, the first
152 encounterd will usually be used when converting discarding
153 the others.
154 """
155 )
156 150
157 151 key_format_map = Dict({},
158 152 config=True,
@@ -30,7 +30,7 b' from IPython.utils.traitlets import Unicode, Bool'
30 30
31 31 from converters.transformers import (ExtractFigureTransformer)
32 32
33 from converters.jinja_filters import GlobalConfigurable
33 from converters.config import GlobalConfigurable
34 34
35 35
36 36 class NbconvertApp(Application):
General Comments 0
You need to be logged in to leave comments. Login now