Show More
@@ -1,56 +1,59 b'' | |||
|
1 | 1 | """HTML Exporter class""" |
|
2 | 2 | |
|
3 | 3 | #----------------------------------------------------------------------------- |
|
4 | 4 | # Copyright (c) 2013, the IPython Development Team. |
|
5 | 5 | # |
|
6 | 6 | # Distributed under the terms of the Modified BSD License. |
|
7 | 7 | # |
|
8 | 8 | # The full license is in the file COPYING.txt, distributed with this software. |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | 15 | import os |
|
16 | 16 | |
|
17 | 17 | from IPython.nbconvert import preprocessors |
|
18 | 18 | from IPython.config import Config |
|
19 | 19 | |
|
20 | 20 | from .templateexporter import TemplateExporter |
|
21 | 21 | |
|
22 | 22 | #----------------------------------------------------------------------------- |
|
23 | 23 | # Classes |
|
24 | 24 | #----------------------------------------------------------------------------- |
|
25 | 25 | |
|
26 | 26 | class HTMLExporter(TemplateExporter): |
|
27 | 27 | """ |
|
28 | 28 | Exports a basic HTML document. This exporter assists with the export of |
|
29 | 29 | HTML. Inherit from it if you are writing your own HTML template and need |
|
30 | 30 | custom preprocessors/filters. If you don't need custom preprocessors/ |
|
31 | 31 | filters, just change the 'template_file' config option. |
|
32 | 32 | """ |
|
33 | 33 | |
|
34 | 34 | def _file_extension_default(self): |
|
35 | 35 | return 'html' |
|
36 | 36 | |
|
37 | 37 | def _default_template_path_default(self): |
|
38 | 38 | return os.path.join("..", "templates", "html") |
|
39 | 39 | |
|
40 | 40 | def _template_file_default(self): |
|
41 | 41 | return 'full' |
|
42 | 42 | |
|
43 | 43 | output_mimetype = 'text/html' |
|
44 | 44 | |
|
45 | 45 | @property |
|
46 | 46 | def default_config(self): |
|
47 | 47 | c = Config({ |
|
48 | 'NbConvertBase': { | |
|
49 | 'display_data_priority' : ['javascript', 'html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'] | |
|
50 | }, | |
|
48 | 51 | 'CSSHTMLHeaderPreprocessor':{ |
|
49 | 52 | 'enabled':True |
|
50 | 53 | }, |
|
51 | 54 | 'HighlightMagicsPreprocessor': { |
|
52 | 55 | 'enabled':True |
|
53 | 56 | } |
|
54 | 57 | }) |
|
55 | 58 | c.merge(super(HTMLExporter,self).default_config) |
|
56 | 59 | return c |
General Comments 0
You need to be logged in to leave comments.
Login now