##// END OF EJS Templates
on("destroy",...) -> once("destroy",...) so we don't keep a reference to it, preventing gc...
on("destroy",...) -> once("destroy",...) so we don't keep a reference to it, preventing gc Thanks to Sylvain Corlay for the suggestion.

File last commit:

r16847:973a2f6d
r18058:c7253b21
Show More
notebook.py
21 lines | 640 B | text/x-python | PythonLexer
"""NotebookExporter class"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from .exporter import Exporter
from IPython.nbformat import current as nbformat
class NotebookExporter(Exporter):
"""
Exports an IPython notebook.
"""
def _file_extension_default(self):
return 'ipynb'
output_mimetype = 'application/json'
def from_notebook_node(self, nb, resources=None, **kw):
nb_copy, resources = super(NotebookExporter, self).from_notebook_node(nb, resources, **kw)
output = nbformat.writes_json(nb_copy)
return output, resources