Show More
@@ -1,7 +1,7 b'' | |||||
1 |
from .basichtml import BasicH |
|
1 | from .basichtml import BasicHTMLExporter | |
2 | from .export import * |
|
2 | from .export import * | |
3 | from .exporter import Exporter |
|
3 | from .exporter import Exporter | |
4 |
from .fullhtml import FullH |
|
4 | from .fullhtml import FullHTMLExporter | |
5 | from .latex import LatexExporter |
|
5 | from .latex import LatexExporter | |
6 | from .markdown import MarkdownExporter |
|
6 | from .markdown import MarkdownExporter | |
7 | from .python import PythonExporter |
|
7 | from .python import PythonExporter |
@@ -16,7 +16,7 b' Exporter that exports Basic HTML.' | |||||
16 |
|
16 | |||
17 | from IPython.utils.traitlets import Unicode |
|
17 | from IPython.utils.traitlets import Unicode | |
18 |
|
18 | |||
19 |
from ..transformers.csshtmlheader import CSSH |
|
19 | from ..transformers.csshtmlheader import CSSHTMLHeaderTransformer | |
20 |
|
20 | |||
21 | from .exporter import Exporter |
|
21 | from .exporter import Exporter | |
22 |
|
22 | |||
@@ -24,7 +24,7 b' from .exporter import Exporter' | |||||
24 | # Classes |
|
24 | # Classes | |
25 | #----------------------------------------------------------------------------- |
|
25 | #----------------------------------------------------------------------------- | |
26 |
|
26 | |||
27 |
class BasicH |
|
27 | class BasicHTMLExporter(Exporter): | |
28 | """ |
|
28 | """ | |
29 | Exports a basic HTML document. This exporter assists with the export of |
|
29 | Exports a basic HTML document. This exporter assists with the export of | |
30 | HTML. Inherit from it if you are writing your own HTML template and need |
|
30 | HTML. Inherit from it if you are writing your own HTML template and need | |
@@ -48,8 +48,8 b' class BasicHtmlExporter(Exporter):' | |||||
48 | """ |
|
48 | """ | |
49 |
|
49 | |||
50 | #Register the transformers of the base class. |
|
50 | #Register the transformers of the base class. | |
51 |
super(BasicH |
|
51 | super(BasicHTMLExporter, self)._register_transformers() | |
52 |
|
52 | |||
53 |
#Register CSSH |
|
53 | #Register CSSHTMLHeaderTransformer transformer | |
54 |
self.register_transformer(CSSH |
|
54 | self.register_transformer(CSSHTMLHeaderTransformer) | |
55 |
|
55 |
@@ -18,8 +18,8 b' from functools import wraps' | |||||
18 | from IPython.nbformat.v3.nbbase import NotebookNode |
|
18 | from IPython.nbformat.v3.nbbase import NotebookNode | |
19 |
|
19 | |||
20 | from .exporter import Exporter |
|
20 | from .exporter import Exporter | |
21 |
from .basichtml import BasicH |
|
21 | from .basichtml import BasicHTMLExporter | |
22 |
from .fullhtml import FullH |
|
22 | from .fullhtml import FullHTMLExporter | |
23 | from .latex import LatexExporter |
|
23 | from .latex import LatexExporter | |
24 | from .markdown import MarkdownExporter |
|
24 | from .markdown import MarkdownExporter | |
25 | from .python import PythonExporter |
|
25 | from .python import PythonExporter | |
@@ -146,7 +146,7 b' def export_basic_html(nb, config=None, transformers=None, filters=None):' | |||||
146 | """ |
|
146 | """ | |
147 | Export a notebook object to Basic HTML |
|
147 | Export a notebook object to Basic HTML | |
148 | """ |
|
148 | """ | |
149 |
return export(BasicH |
|
149 | return export(BasicHTMLExporter, nb, config, transformers, filters) | |
150 |
|
150 | |||
151 |
|
151 | |||
152 | @DocDecorator |
|
152 | @DocDecorator | |
@@ -154,7 +154,7 b' def export_full_html(nb, config=None, transformers=None, filters=None):' | |||||
154 | """ |
|
154 | """ | |
155 | Export a notebook object to Full HTML |
|
155 | Export a notebook object to Full HTML | |
156 | """ |
|
156 | """ | |
157 |
return export(FullH |
|
157 | return export(FullHTMLExporter, nb, config, transformers, filters) | |
158 |
|
158 | |||
159 |
|
159 | |||
160 | @DocDecorator |
|
160 | @DocDecorator |
@@ -16,14 +16,14 b' Exporter for exporting full HTML documents.' | |||||
16 |
|
16 | |||
17 | from IPython.utils.traitlets import Unicode |
|
17 | from IPython.utils.traitlets import Unicode | |
18 |
|
18 | |||
19 |
from .basichtml import BasicH |
|
19 | from .basichtml import BasicHTMLExporter | |
20 | from IPython.config import Config |
|
20 | from IPython.config import Config | |
21 |
|
21 | |||
22 | #----------------------------------------------------------------------------- |
|
22 | #----------------------------------------------------------------------------- | |
23 | # Classes |
|
23 | # Classes | |
24 | #----------------------------------------------------------------------------- |
|
24 | #----------------------------------------------------------------------------- | |
25 |
|
25 | |||
26 |
class FullH |
|
26 | class FullHTMLExporter(BasicHTMLExporter): | |
27 | """ |
|
27 | """ | |
28 | Exports a full HTML document. |
|
28 | Exports a full HTML document. | |
29 | """ |
|
29 | """ | |
@@ -34,6 +34,6 b' class FullHtmlExporter(BasicHtmlExporter):' | |||||
34 |
|
34 | |||
35 | @property |
|
35 | @property | |
36 | def default_config(self): |
|
36 | def default_config(self): | |
37 |
c = Config({'CSSH |
|
37 | c = Config({'CSSHTMLHeaderTransformer':{'enabled':True}}) | |
38 |
c.merge(super(FullH |
|
38 | c.merge(super(FullHTMLExporter,self).default_config) | |
39 | return c |
|
39 | return c |
@@ -16,14 +16,14 b' Reveal slide show exporter.' | |||||
16 | from IPython.utils.traitlets import Unicode |
|
16 | from IPython.utils.traitlets import Unicode | |
17 | from IPython.config import Config |
|
17 | from IPython.config import Config | |
18 |
|
18 | |||
19 |
from .basichtml import BasicH |
|
19 | from .basichtml import BasicHTMLExporter | |
20 | from IPython.nbconvert import transformers |
|
20 | from IPython.nbconvert import transformers | |
21 |
|
21 | |||
22 | #----------------------------------------------------------------------------- |
|
22 | #----------------------------------------------------------------------------- | |
23 | # Classes |
|
23 | # Classes | |
24 | #----------------------------------------------------------------------------- |
|
24 | #----------------------------------------------------------------------------- | |
25 |
|
25 | |||
26 |
class RevealExporter(BasicH |
|
26 | class RevealExporter(BasicHTMLExporter): | |
27 | """ |
|
27 | """ | |
28 | Exports a Reveal slide show (.HTML) which may be rendered in a web browser. |
|
28 | Exports a Reveal slide show (.HTML) which may be rendered in a web browser. | |
29 | """ |
|
29 | """ | |
@@ -49,6 +49,6 b' class RevealExporter(BasicHtmlExporter):' | |||||
49 |
|
49 | |||
50 | @property |
|
50 | @property | |
51 | def default_config(self): |
|
51 | def default_config(self): | |
52 |
c = Config({'CSSH |
|
52 | c = Config({'CSSHTMLHeaderTransformer':{'enabled':True}}) | |
53 | c.merge(super(RevealExporter,self).default_config) |
|
53 | c.merge(super(RevealExporter,self).default_config) | |
54 | return c |
|
54 | return c |
@@ -25,7 +25,7 b' from .activatable import ActivatableTransformer' | |||||
25 | # Classes and functions |
|
25 | # Classes and functions | |
26 | #----------------------------------------------------------------------------- |
|
26 | #----------------------------------------------------------------------------- | |
27 |
|
27 | |||
28 |
class CSSH |
|
28 | class CSSHTMLHeaderTransformer(ActivatableTransformer): | |
29 | """ |
|
29 | """ | |
30 | Transformer used to pre-process notebook for HTML output. Adds IPython notebook |
|
30 | Transformer used to pre-process notebook for HTML output. Adds IPython notebook | |
31 | front-end CSS and Pygments CSS to HTML output. |
|
31 | front-end CSS and Pygments CSS to HTML output. | |
@@ -45,7 +45,7 b' class CSSHtmlHeaderTransformer(ActivatableTransformer):' | |||||
45 | Additional arguments |
|
45 | Additional arguments | |
46 | """ |
|
46 | """ | |
47 |
|
47 | |||
48 |
super(CSSH |
|
48 | super(CSSHTMLHeaderTransformer, self).__init__(config=config, **kw) | |
49 |
|
49 | |||
50 | if self.enabled : |
|
50 | if self.enabled : | |
51 | self._regen_header() |
|
51 | self._regen_header() |
General Comments 0
You need to be logged in to leave comments.
Login now