Notebook Viewing

view generates HTML from notebooks, and opens them in your browswer. It uses the nbconvert.HTMLExporter and in-lines embedded attachments to make them visible.

Result File Name

The resulting HTML for viewing notebook nb.ipynb is written to nb-view.html, unless the --inplace options is used, in which case it is written to nb.html.

The result name addition can be adjusted in the configuration file by setting view_result_name; see Configuration Files.

Options

The following options are supported by view:

-t NAME, --template NAME
                      template to use (default: classic)
-b, --browser, -B, --no-browser
                      open html in browser (default: True)
-w, --wait_delete, -W, --no-wait_delete
                      interactively wait for user confirmation to delete
                      html files (default: False)

Template File

The option template-file is deprecated, because nbconvert 6 has a template mechanism that uses directories instead of single template files.

Template

By default, view uses the classic template.

The template option can be used to select another template. For instance, nbconvert supports the basic template, without any CSS and JavaScript, and lab to give you a JypterLab look. Also see nbconvert documentation for HTML output.

Note that Jupyter notebook extensions provide additional templates, such as toc2.tpl for an enhanced Table of Contents. However, these templates can no longer be used, since they have not been converted to the nbconvert 6 style.

Browswer

By default, view opens the generated HTML in a new tab in your default browser.

The browser option can be used to override this behavior.

Wait-Delete

By default, view exits after generating HTML files, and opening them in your browser. The generated HTML files are not deleted.

The wait-delete option makes view wait after generating the HTML files, until the user confirms deletion of the HTML files:

$ nbtb view -w test.ipynb
Delete created html files ([y]/n)? y
Deleting: test-view.html