Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add export_from_notebook #864

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nbconvert/exporters/asciidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def _template_file_default(self):
return 'asciidoc'

output_mimetype = 'text/asciidoc'
export_from_notebook = "asciidoc"

@default('raw_mimetypes')
def _raw_mimetypes_default(self):
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class LatexExporter(TemplateExporter):
'template_file' config option. Place your template in the special "/latex"
subfolder of the "../templates" folder.
"""
export_from_notebook = "latex"

@default('file_extension')
def _file_extension_default(self):
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class MarkdownExporter(TemplateExporter):
"""
Exports to a markdown document (.md)
"""
export_from_notebook = "markdown"

@default('file_extension')
def _file_extension_default(self):
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def _file_extension_default(self):
return '.ipynb'

output_mimetype = 'application/json'
export_from_notebook = "notebook"

def from_notebook_node(self, nb, resources=None, **kw):
nb_copy, resources = super(NotebookExporter, self).from_notebook_node(nb, resources, **kw)
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class PDFExporter(LatexExporter):
a temporary directory using the template machinery, and then runs LaTeX
to create a pdf.
"""
export_from_notebook="pdf"

latex_count = Integer(3,
help="How many times latex will be called."
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ def _template_file_default(self):
return 'python.tpl'

output_mimetype = 'text/x-python'
export_from_notebook = "python"
1 change: 1 addition & 0 deletions nbconvert/exporters/rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def _template_file_default(self):
return 'rst.tpl'

output_mimetype = 'text/restructuredtext'
export_from_notebook = "rst"

@property
def default_config(self):
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class ScriptExporter(TemplateExporter):
# Caches of already looked-up and instantiated exporters for delegation:
_exporters = Dict()
_lang_exporters = Dict()
export_form_notebook = "script"

@default('template_file')
def _template_file_default(self):
Expand Down
2 changes: 2 additions & 0 deletions nbconvert/exporters/slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def prepare(nb):
class SlidesExporter(HTMLExporter):
"""Exports HTML slides with reveal.js"""

export_from_notebook = "slides"

reveal_url_prefix = Unicode(
help="""The URL prefix for reveal.js (version 3.x).
This defaults to the reveal CDN, but can be any url pointing to a copy
Expand Down
2 changes: 2 additions & 0 deletions nbconvert/exporters/templateexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class TemplateExporter(Exporter):

_template_cached = None

export_from_notebook = "custom"

def _invalidate_template_cache(self, change=None):
self._template_cached = None

Expand Down