Show More
@@ -2,41 +2,23 b'' | |||
|
2 | 2 | Module containing filter functions that allow code to be highlighted |
|
3 | 3 | from within Jinja templates. |
|
4 | 4 | """ |
|
5 | #----------------------------------------------------------------------------- | |
|
6 | # Copyright (c) the IPython Development Team. | |
|
7 | # | |
|
8 | # Distributed under the terms of the Modified BSD License. | |
|
9 | # | |
|
10 | # The full license is in the file COPYING.txt, distributed with this software. | |
|
11 | #----------------------------------------------------------------------------- | |
|
12 | 5 | |
|
13 | #----------------------------------------------------------------------------- | |
|
14 | # Imports | |
|
15 | #----------------------------------------------------------------------------- | |
|
6 | # Copyright (c) IPython Development Team. | |
|
7 | # Distributed under the terms of the Modified BSD License. | |
|
16 | 8 | |
|
17 | 9 | # pygments must not be imported at the module level |
|
18 | 10 | # because errors should be raised at runtime if it's actually needed, |
|
19 | 11 | # not import time, when it may not be needed. |
|
20 | 12 | |
|
21 | # Our own imports | |
|
22 | 13 | from IPython.nbconvert.utils.base import NbConvertBase |
|
23 | 14 | |
|
24 | #----------------------------------------------------------------------------- | |
|
25 | # Globals and constants | |
|
26 | #----------------------------------------------------------------------------- | |
|
27 | ||
|
28 | 15 | MULTILINE_OUTPUTS = ['text', 'html', 'svg', 'latex', 'javascript', 'json'] |
|
29 | 16 | |
|
30 | #----------------------------------------------------------------------------- | |
|
31 | # Utility functions | |
|
32 | #----------------------------------------------------------------------------- | |
|
33 | ||
|
34 | 17 | __all__ = [ |
|
35 | 18 | 'Highlight2HTML', |
|
36 | 19 | 'Highlight2Latex' |
|
37 | 20 | ] |
|
38 | 21 | |
|
39 | ||
|
40 | 22 | class Highlight2HTML(NbConvertBase): |
|
41 | 23 | |
|
42 | 24 | def __call__(self, source, language=None, metadata=None): |
@@ -58,7 +40,7 b' class Highlight2HTML(NbConvertBase):' | |||
|
58 | 40 | |
|
59 | 41 | return _pygments_highlight(source if len(source) > 0 else ' ', |
|
60 | 42 | # needed to help post processors: |
|
61 |
HtmlFormatter(cssclass="hl-"+language), |
|
|
43 | HtmlFormatter(cssclass=" highlight hl-"+language), | |
|
62 | 44 | language, metadata) |
|
63 | 45 | |
|
64 | 46 |
General Comments 0
You need to be logged in to leave comments.
Login now