##// END OF EJS Templates
use traitlet for highlight_class
Jake Vanderplas -
Show More
@@ -20,6 +20,8 b' from pygments.formatters import HtmlFormatter'
20 20 from IPython.utils import path
21 21
22 22 from .activatable import ActivatableTransformer
23
24 from IPython.utils.traitlets import Unicode
23 25
24 26 #-----------------------------------------------------------------------------
25 27 # Classes and functions
@@ -33,6 +35,9 b' class CSSHtmlHeaderTransformer(ActivatableTransformer):'
33 35
34 36 header = []
35 37
38 highlight_class = Unicode('highlight', config=True,
39 help="CSS highlight class identifier")
40
36 41 def __init__(self, config=None, **kw):
37 42 """
38 43 Public constructor
@@ -97,8 +102,8 b' class CSSHtmlHeaderTransformer(ActivatableTransformer):'
97 102 pass
98 103
99 104 #Add pygments CSS
100 highlight_class = '.' + self.config.get('highlight_class', 'highlight')
101 pygments_css = HtmlFormatter().get_style_defs(highlight_class)
105 formatter = HtmlFormatter()
106 pygments_css = formatter.get_style_defs('.' + self.highlight_class)
102 107 header.append(pygments_css)
103 108
104 109 #Set header
General Comments 0
You need to be logged in to leave comments. Login now