This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: nbconvert.exporters.exporter

This module defines a base Exporter class. For Jinja template-based export, see templateexporter.py.

3 Classes

class IPython.nbconvert.exporters.exporter.ResourcesDict

Bases: collections.defaultdict

class IPython.nbconvert.exporters.exporter.FilenameExtension(default_value=<IPython.utils.traitlets.NoDefaultSpecified object>, allow_none=None, **metadata)

Bases: IPython.utils.traitlets.Unicode

A trait for filename extensions.

class IPython.nbconvert.exporters.exporter.Exporter(config=None, **kw)

Bases: IPython.config.configurable.LoggingConfigurable

Class containing methods that sequentially run a list of preprocessors on a NotebookNode object and then return the modified NotebookNode object and accompanying resources dict.

__init__(config=None, **kw)

Public constructor


config : config

User configuration instance.

from_file(file_stream, resources=None, **kw)

Convert a notebook from a notebook file.


file_stream : file-like object

Notebook file-like object to convert.

from_filename(filename, resources=None, **kw)

Convert a notebook from a notebook file.


filename : str

Full filename of the notebook file to open and convert.

from_notebook_node(nb, resources=None, **kw)

Convert a notebook from a notebook node instance.


nb : NotebookNode

Notebook node (dict-like with attr-access)

resources : dict

Additional resources that can be accessed read/write by preprocessors and filters.


Ignored (?)

register_preprocessor(preprocessor, enabled=False)

Register a preprocessor. Preprocessors are classes that act upon the notebook before it is passed into the Jinja templating engine. preprocessors are also capable of passing additional information to the Jinja templating engine.

Parameters:preprocessor : preprocessor