##// END OF EJS Templates
comit from home
comit from home

File last commit:

r10872:6b2a1477
r10872:6b2a1477
Show More
rst.py
52 lines | 1.7 KiB | text/x-python | PythonLexer
Jonathan Frederic
Finished a rough draft of the exporters.
r10588 """
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 Exporter for exporting notebooks to restructured text.
"""
Jonathan Frederic
Finished a rough draft of the exporters.
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
#-----------------------------------------------------------------------------
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 from IPython.utils.traitlets import Unicode
Matthias BUSSONNIER
start tinkerign with config system
r10862 from IPython.config import Config
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677
Jonathan Frederic
Finished a rough draft of the exporters.
r10588 # local import
import exporter
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 class RstExporter(exporter.Exporter):
"""
Exports restructured text documents.
"""
Jonathan Frederic
Fixed all broken references, refactored some stuff here and there,...
r10624 file_extension = Unicode(
'rst', config=True,
help="Extension of the file that should be written to disk")
Jonathan Frederic
Finished a rough draft of the exporters.
r10588
Jonathan Frederic
Fixed all broken references, refactored some stuff here and there,...
r10624 template_file = Unicode(
'rst', config=True,
help="Name of the template file to use")
Matthias BUSSONNIER
start tinkerign with config system
r10862
_default_config = Config({'ExtractFigureTransformer':{'enabled':True}})
def __init__(self, transformers=None, filters=None, config=None, **kw):
c = self.default_config
if config :
Matthias BUSSONNIER
comit from home
r10872 c._merge(config)
Matthias BUSSONNIER
start tinkerign with config system
r10862
super(RstExporter, self).__init__(transformers=transformers,
filters=filters,
config=c,
**kw)