Exporting

Some extensions require additional effort when exporting them to other formats using nbconvert.

Preprocessors

Generic documentation for preprocessors can be found at http://nbconvert.readthedocs.io/en/latest/api/preprocessors.html.

class jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor(**kw)

nbconvert Preprocessor for the code_folding nbextension.

Folds codecells as displayed in the notebook.

class jupyter_contrib_nbextensions.nbconvert_support.CollapsibleHeadingsPreprocessor(**kw)

nbconvert Preprocessor for collapsible_headings nbextension.

Hides (removes) cells from the notebook which are under collapsed headings.

class jupyter_contrib_nbextensions.nbconvert_support.HighlighterPreprocessor(**kw)

nbconvert Preprocessor for the highlighter nbextension.

The preprocessor replaces highlighter html tags in markdown with a “neutral” text version, which enables markdown conversion of text included in the data field, command or environment. Then the neutral text is translated into LaTeX/html output by the corresponding HighlighterPostProcessor.

For example the highlighter-created markdown

<span class="mark"> *text* </span>

is translated for html conversion into:

!oph!span class="mark"!clh! *text* !oph!/span!clh!

or for LaTeX conversion is translated into:

!sl!highlighta!op! *text* !cl!
class jupyter_contrib_nbextensions.nbconvert_support.PyMarkdownPreprocessor(**kw)

nbconvert Preprocessor for the python-markdown nbextension.

This Preprocessor replaces kernel code in markdown cells with the results stored in the cell metadata.

class jupyter_contrib_nbextensions.nbconvert_support.SVG2PDFPreprocessor(**kw)

Preprocessor to convert svg graphics embedded in notebook markdown to PDF.

Because LaTeX can’t use SVG graphics, they are converted to PDF using inkscape. This preprocessor is for SVG graphics in markdown only. For SVG outputs from codecells, there is already the nbconvert preprocessor nbconvert.preprocessors.SVG2PDFPreprocessor

Postprocessors

Generic documentation for postprocessors can be found here http://nbconvert.readthedocs.io/en/latest/api/postprocessors.html

class jupyter_contrib_nbextensions.nbconvert_support.HighlighterPostProcessor(**kw)

nbconvert PostProcessor for the highlighter nbextension.

Replaces the “neutral” text versions created by the HighlighterPreprocessor by the destination language tags.

e.g. the html example becomes

<span class="mark"> <em>text</em> </span>

(the data text have been correctly emphasized in html markup)

e.g. the LaTeX example becomes

\highlighta{\emph{text}}

(the data text have been correctly emphasized using LaTeX tags)

Exporters

Generic documentation for exporters can be found at http://nbconvert.readthedocs.io/en/latest/api/exporters.html

class jupyter_contrib_nbextensions.nbconvert_support.EmbedHTMLExporter(config=None, **kw)

nbconvert Exporter which embeds graphics as base64 into html.

Convert to HTML and embed graphics (pdf, svg and raster images) in the HTML file.

Example usage:

nbconvert --to html_embed mynotebook.ipynb
class jupyter_contrib_nbextensions.nbconvert_support.TocExporter(config=None, **kw)

nbconvert HTMLExporter which embeds the toc2 nbextension.

Export table of contents nbextension functionality to html. The idea is to link a relevant part of the javascript nbextension and the css, and add a small script in the html file.

Example usage:

jupyter nbconvert --to html_toc FILE.ipynb
class jupyter_contrib_nbextensions.nbconvert_support.LenvsHTMLExporter(config=None, **kw)

Exports to an html document, embedding latex_envs nbextension features.

Example usage:

jupyter nbconvert --to html_lenvs FILE.ipynb
class jupyter_contrib_nbextensions.nbconvert_support.LenvsLatexExporter(config=None, **kw)

Exports to a LaTeX document, embedding latex_envs nbextension features.

To export notebooks to plain and html while keeping all the features of the latex_envs notebook extension in the converted version. The LaTeX converter also exposes several conversion options (read the docs).

Example usage:

jupyter nbconvert --to latex_lenvs FILE.ipynb

Templates

Generic documentation on templates can be found at http://nbconvert.readthedocs.io/en/latest/customizing.html

jupyter_contrib_nbextensions.nbconvert_support.templates_directory()

Return path to the jupyter_contrib_nbextensions nbconvert templates.

highlighter
To be documented...
nbextensions
Template for notebook extensions hiding code cells, output, or text cells.
printviewlatex
Template for the printview extension converting the current notebook to LaTeX or PDF.
toc3
To be done.