From 2cfee8d66f1708204c9b703d2947c0f7ec16cbd8 2013-07-03 18:12:06 From: Matthias Bussonnier Date: 2013-07-03 18:12:06 Subject: [PATCH] Merge pull request #3516 from jakevdp/configurable_highlight make css highlight style configurable --- diff --git a/IPython/nbconvert/transformers/csshtmlheader.py b/IPython/nbconvert/transformers/csshtmlheader.py index 89a1e22..0c76e93 100755 --- a/IPython/nbconvert/transformers/csshtmlheader.py +++ b/IPython/nbconvert/transformers/csshtmlheader.py @@ -20,6 +20,8 @@ from pygments.formatters import HtmlFormatter from IPython.utils import path from .activatable import ActivatableTransformer + +from IPython.utils.traitlets import Unicode #----------------------------------------------------------------------------- # Classes and functions @@ -33,6 +35,9 @@ class CSSHTMLHeaderTransformer(ActivatableTransformer): header = [] + highlight_class = Unicode('.highlight', config=True, + help="CSS highlight class identifier") + def __init__(self, config=None, **kw): """ Public constructor @@ -97,7 +102,8 @@ class CSSHTMLHeaderTransformer(ActivatableTransformer): pass #Add pygments CSS - pygments_css = HtmlFormatter().get_style_defs('.highlight') + formatter = HtmlFormatter() + pygments_css = formatter.get_style_defs(self.highlight_class) header.append(pygments_css) #Set header