markdown.py
49 lines
| 1.5 KiB
| text/x-python
|
PythonLexer
|
r13664 | """Markdown Exporter class""" | ||
|
r10588 | #----------------------------------------------------------------------------- | ||
# Copyright (c) 2013, the IPython Development Team. | ||||
# | ||||
# Distributed under the terms of the Modified BSD License. | ||||
# | ||||
# The full license is in the file COPYING.txt, distributed with this software. | ||||
#----------------------------------------------------------------------------- | ||||
#----------------------------------------------------------------------------- | ||||
# Imports | ||||
#----------------------------------------------------------------------------- | ||||
|
r12451 | from IPython.config import Config | ||
|
r10677 | |||
|
r12505 | from .templateexporter import TemplateExporter | ||
|
r10588 | |||
#----------------------------------------------------------------------------- | ||||
# Classes | ||||
#----------------------------------------------------------------------------- | ||||
|
r12500 | class MarkdownExporter(TemplateExporter): | ||
|
r10677 | """ | ||
Exports to a markdown document (.md) | ||||
""" | ||||
|
r13925 | def _file_extension_default(self): | ||
return 'md' | ||||
def _template_file_default(self): | ||||
return 'markdown' | ||||
|
r12451 | |||
|
r13834 | output_mimetype = 'text/markdown' | ||
|
r13664 | |||
|
r13678 | def _raw_mimetypes_default(self): | ||
|
r13832 | return ['text/markdown', 'text/html', ''] | ||
|
r13830 | |||
|
r12451 | @property | ||
def default_config(self): | ||||
|
r15529 | c = Config({ | ||
'NbConvertBase': { | ||||
'display_data_priority': ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'] | ||||
}, | ||||
'ExtractOutputPreprocessor': { | ||||
'enabled':True} | ||||
}) | ||||
|
r12451 | c.merge(super(MarkdownExporter,self).default_config) | ||
return c | ||||