Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0802328

Browse files
Add export_from_notebook
I was working onjupyter/notebook#3879 and itlooks like the intended way to determine whether the exporter shouldshow up in the list generated by the notebook server was by checking`export_from_notebook`, but it isn't defined for any of the builtinexporters.The docs also say this specifies a friendly name for the exporter. Inthe PR mentioned above, I used the name defined by the entrypoint to keythe exporter. It sounds like maybe we should use the value in`export_from_notebook` instead, so I've made them match, but perhapsit's confusing to have a "name" for the entrypoint in two places.
1 parent1a7b848 commit0802328

File tree

10 files changed

+12
-0
lines changed

10 files changed

+12
-0
lines changed

‎nbconvert/exporters/asciidoc.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def _template_file_default(self):
2323
return'asciidoc'
2424

2525
output_mimetype='text/asciidoc'
26+
export_from_notebook="asciidoc"
2627

2728
@default('raw_mimetypes')
2829
def_raw_mimetypes_default(self):

‎nbconvert/exporters/latex.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class LatexExporter(TemplateExporter):
2121
'template_file' config option. Place your template in the special "/latex"
2222
subfolder of the "../templates" folder.
2323
"""
24+
export_from_notebook="latex"
2425

2526
@default('file_extension')
2627
def_file_extension_default(self):

‎nbconvert/exporters/markdown.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class MarkdownExporter(TemplateExporter):
1313
"""
1414
Exports to a markdown document (.md)
1515
"""
16+
export_from_notebook="markdown"
1617

1718
@default('file_extension')
1819
def_file_extension_default(self):

‎nbconvert/exporters/notebook.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def _file_extension_default(self):
2626
return'.ipynb'
2727

2828
output_mimetype='application/json'
29+
export_from_notebook="notebook"
2930

3031
deffrom_notebook_node(self,nb,resources=None,**kw):
3132
nb_copy,resources=super(NotebookExporter,self).from_notebook_node(nb,resources,**kw)

‎nbconvert/exporters/pdf.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class PDFExporter(LatexExporter):
4444
a temporary directory using the template machinery, and then runs LaTeX
4545
to create a pdf.
4646
"""
47+
export_from_notebook="pdf"
4748

4849
latex_count=Integer(3,
4950
help="How many times latex will be called."

‎nbconvert/exporters/python.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ def _template_file_default(self):
2121
return'python.tpl'
2222

2323
output_mimetype='text/x-python'
24+
export_from_notebook="python"

‎nbconvert/exporters/rst.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def _template_file_default(self):
2323
return'rst.tpl'
2424

2525
output_mimetype='text/restructuredtext'
26+
export_from_notebook="rst"
2627

2728
@property
2829
defdefault_config(self):

‎nbconvert/exporters/script.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ScriptExporter(TemplateExporter):
1414
# Caches of already looked-up and instantiated exporters for delegation:
1515
_exporters=Dict()
1616
_lang_exporters=Dict()
17+
export_form_notebook="script"
1718

1819
@default('template_file')
1920
def_template_file_default(self):

‎nbconvert/exporters/slides.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def prepare(nb):
7575
classSlidesExporter(HTMLExporter):
7676
"""Exports HTML slides with reveal.js"""
7777

78+
export_from_notebook="slides"
79+
7880
reveal_url_prefix=Unicode(
7981
help="""The URL prefix for reveal.js (version 3.x).
8082
This defaults to the reveal CDN, but can be any url pointing to a copy

‎nbconvert/exporters/templateexporter.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class TemplateExporter(Exporter):
102102

103103
_template_cached=None
104104

105+
export_from_notebook="custom"
106+
105107
def_invalidate_template_cache(self,change=None):
106108
self._template_cached=None
107109

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp