module helpgen.process_notebook_api

Short summary

module pyquickhelper.helpgen.process_notebook_api

Direct calls to IPython API without running a command line

source on GitHub

Functions

function

truncated documentation

get_exporter

Returns the IPython exporter associated to a format.

nb2html

Converts a notebook into HTML.

nb2rst

Converts a notebook into RST.

nb2slides

Converts a notebook into slides, it copies reveal.js if not present in the folder of the output.

Documentation

Direct calls to IPython API without running a command line

source on GitHub

pyquickhelper.helpgen.process_notebook_api.get_exporter(format, add_writer=False)[source]

Returns the IPython exporter associated to a format.

Parameters:
  • format – string (see below)

  • add_writer – add writer as well

Returns:

class

Available formats: slides, pdf, latex, markdown, html, rst, python, notebook, template.

source on GitHub

pyquickhelper.helpgen.process_notebook_api.nb2html(nb_file, outfile, exc=True)[source]

Converts a notebook into HTML.

Parameters:
  • nb_file – notebook file or a stream or a read_nb

  • outfile – output file (a string)

  • exc – raises an exception (True) or a warning (False)

Returns:

impacted files

source on GitHub

pyquickhelper.helpgen.process_notebook_api.nb2rst(nb_file, outfile, exc=True, post_process=True)[source]

Converts a notebook into RST.

Parameters:
  • nb_file – notebook file or a stream or a read_nb

  • outfile – output file (a string)

  • exc – raises an exception (True) or a warning (False)

  • post_process – calls post_process_rst_output

Returns:

impacted files

source on GitHub

pyquickhelper.helpgen.process_notebook_api.nb2slides(nb_file, outfile, add_tag=True)[source]

Converts a notebook into slides, it copies reveal.js if not present in the folder of the output.

Parameters:
  • nb_file – notebook file or a stream or a read_nb

  • outfile – output file (a string)

  • add_tag – call add_tag_slide

Returns:

impacted files

See How do I convert a IPython Notebook into a Python file via commandline?

Convert a notebook into slides

By default, the function automatically adds sections if there is none and it copies the javascript from reveal.js at the right place.

from pyquickhelper.helpgen import nb2slides
nb2slides("nb.ipynb", "convert.slides.html")

source on GitHub