Warning

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.

2 Classes

class IPython.nbconvert.exporters.exporter.ResourcesDict

Bases: collections.defaultdict

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

Parameters:

config : config

User configuration instance.

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

Convert a notebook from a notebook file.

Parameters:

file_stream : file-like object

Notebook file-like object to convert.

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

Convert a notebook from a notebook file.

Parameters:

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.

Parameters:

nb : NotebookNode

Notebook node

resources : dict

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

**kw

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