Show More
@@ -31,17 +31,11 b' class HTMLExporter(TemplateExporter):' | |||
|
31 | 31 | filters, just change the 'template_file' config option. |
|
32 | 32 | """ |
|
33 | 33 | |
|
34 |
|
|
|
35 | 'html', config=True, | |
|
36 | help="Extension of the file that should be written to disk" | |
|
37 | ) | |
|
34 | def _file_extension_default(self): | |
|
35 | return 'html' | |
|
38 | 36 | |
|
39 | mime_type = Unicode('text/html', config=True, | |
|
40 | help="MIME type of the result file, for HTTP response headers." | |
|
41 | ) | |
|
42 | ||
|
43 | default_template = Unicode('full', config=True, help="""Flavor of the data | |
|
44 | format to use. I.E. 'full' or 'basic'""") | |
|
37 | def _template_file_default(self): | |
|
38 | return 'html_full' | |
|
45 | 39 | |
|
46 | 40 | output_mimetype = 'text/html' |
|
47 | 41 |
@@ -35,14 +35,17 b' class LatexExporter(TemplateExporter):' | |||
|
35 | 35 | 'template_file' config option. Place your template in the special "/latex" |
|
36 | 36 | subfolder of the "../templates" folder. |
|
37 | 37 | """ |
|
38 | ||
|
39 | def _file_extension_default(self): | |
|
40 | return 'tex' | |
|
41 | ||
|
42 | def _template_file_default(self): | |
|
43 | return 'article' | |
|
38 | 44 | |
|
39 | 45 | file_extension = Unicode( |
|
40 | 46 | 'tex', config=True, |
|
41 | 47 | help="Extension of the file that should be written to disk") |
|
42 | 48 | |
|
43 | default_template = Unicode('article', config=True, help="""Template of the | |
|
44 | data format to use. I.E. 'article' or 'report'""") | |
|
45 | ||
|
46 | 49 | #Latex constants |
|
47 | 50 | default_template_path = Unicode( |
|
48 | 51 | os.path.join("..", "templates", "latex"), config=True, |
@@ -26,9 +26,11 b' class MarkdownExporter(TemplateExporter):' | |||
|
26 | 26 | Exports to a markdown document (.md) |
|
27 | 27 | """ |
|
28 | 28 | |
|
29 |
|
|
|
30 | 'md', config=True, | |
|
31 | help="Extension of the file that should be written to disk") | |
|
29 | def _file_extension_default(self): | |
|
30 | return 'md' | |
|
31 | ||
|
32 | def _template_file_default(self): | |
|
33 | return 'markdown' | |
|
32 | 34 | |
|
33 | 35 | output_mimetype = 'text/markdown' |
|
34 | 36 |
@@ -24,9 +24,10 b' class PythonExporter(TemplateExporter):' | |||
|
24 | 24 | """ |
|
25 | 25 | Exports a Python code file. |
|
26 | 26 | """ |
|
27 | ||
|
28 | file_extension = Unicode( | |
|
29 | 'py', config=True, | |
|
30 | help="Extension of the file that should be written to disk") | |
|
27 | def _file_extension_default(self): | |
|
28 | return 'py' | |
|
29 | ||
|
30 | def _template_file_default(self): | |
|
31 | return 'python' | |
|
31 | 32 | |
|
32 | 33 | output_mimetype = 'text/x-python' |
@@ -26,9 +26,11 b' class RSTExporter(TemplateExporter):' | |||
|
26 | 26 | Exports restructured text documents. |
|
27 | 27 | """ |
|
28 | 28 | |
|
29 |
|
|
|
30 | 'rst', config=True, | |
|
31 | help="Extension of the file that should be written to disk") | |
|
29 | def _file_extension_default(self): | |
|
30 | return 'rst' | |
|
31 | ||
|
32 | def _template_file_default(self): | |
|
33 | return 'rst' | |
|
32 | 34 | |
|
33 | 35 | output_mimetype = 'text/restructuredtext' |
|
34 | 36 |
@@ -26,15 +26,13 b' from .html import HTMLExporter' | |||
|
26 | 26 | class SlidesExporter(HTMLExporter): |
|
27 | 27 | """Exports HTML slides with reveal.js""" |
|
28 | 28 | |
|
29 |
|
|
|
30 |
'slides.html' |
|
|
31 | help="Extension of the file that should be written to disk" | |
|
32 | ) | |
|
29 | def _file_extension_default(self): | |
|
30 | return 'slides.html' | |
|
33 | 31 | |
|
34 | output_mimetype = 'text/html' | |
|
32 | def _template_file_default(self): | |
|
33 | return 'slides_reveal' | |
|
35 | 34 | |
|
36 | default_template = Unicode('reveal', config=True, help="""Template of the | |
|
37 | data format to use. I.E. 'reveal'""") | |
|
35 | output_mimetype = 'text/html' | |
|
38 | 36 | |
|
39 | 37 | @property |
|
40 | 38 | def default_config(self): |
@@ -173,15 +173,12 b' class TemplateExporter(Exporter):' | |||
|
173 | 173 | # template by name with extension added, then try loading the template |
|
174 | 174 | # as if the name is explicitly specified, then try the name as a |
|
175 | 175 | # 'flavor', and lastly just try to load the template by module name. |
|
176 | module_name = self.__module__.rsplit('.', 1)[-1] | |
|
177 | 176 | try_names = [] |
|
178 | 177 | if self.template_file: |
|
179 | 178 | try_names.extend([ |
|
180 | 179 | self.template_file + self.template_extension, |
|
181 | 180 | self.template_file, |
|
182 | module_name + '_' + self.template_file + self.template_extension, | |
|
183 | 181 | ]) |
|
184 | try_names.append(module_name + self.template_extension) | |
|
185 | 182 | for try_name in try_names: |
|
186 | 183 | self.log.debug("Attempting to load template %s", try_name) |
|
187 | 184 | try: |
|
1 | NO CONTENT: file renamed from IPython/nbconvert/templates/latex/latex_article.tplx to IPython/nbconvert/templates/latex/article.tplx |
|
1 | NO CONTENT: file renamed from IPython/nbconvert/templates/latex/latex_base.tplx to IPython/nbconvert/templates/latex/base.tplx |
|
1 | NO CONTENT: file renamed from IPython/nbconvert/templates/latex/latex_report.tplx to IPython/nbconvert/templates/latex/report.tplx |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | ((= Black&white ipython input/output style =)) |
|
2 | 2 | |
|
3 |
((*- extends ' |
|
|
3 | ((*- extends 'base.tplx' -*)) | |
|
4 | 4 | |
|
5 | 5 | %=============================================================================== |
|
6 | 6 | % Input |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | ((= Black&white Python input/output style =)) |
|
2 | 2 | |
|
3 |
((*- extends ' |
|
|
3 | ((*- extends 'base.tplx' -*)) | |
|
4 | 4 | |
|
5 | 5 | %=============================================================================== |
|
6 | 6 | % Input |
General Comments 0
You need to be logged in to leave comments.
Login now