Jupyter Markdown Shortcut



TypeScript DocumentManager - 12 examples found. These are the top rated real world TypeScript examples of jupyter-js-ui/lib/docmanager.DocumentManager extracted from open source projects. “Starting with Jupyter Notebook 5.0, you can customize the command mode shortcuts from within the Notebook Application. This shortcut is overridden.

Here, I present ipymd, a plugin for jupyter that allows to read and write R Notebook format. The package is freely available from github.

This screenshot shows the same notebook, opened with jupyter, vi and the .nb.html file opened in chrome:


Motivation

Working in Data Science with both R and Python I use both Jupyter notebooks and R Markdown/R Notebooks on a daily basis, depending on the project.

While I usually prefer to work with Python, I have always been envying the R community for the R markdown format due to the following reasons:

  • As output is separated from the source, it works well under version control
  • The source code can be edited in a text-only editor such as vi.
  • The chunk options of R markdown allow to hide certain parts of the document, or to add figure captions, allowing to generate publication-quality reports.

To obtain the best of two worlds, I implemented R markdown (or should it be called Pymarkdown?) support for jupyter.

Jupyter

When it comes to generating publication quality reports, the R markdown/Pymarkdown documents can be fed into Tom Augspurger’s pystitch to obtain a rendered html or pdf report.

How it works

The jupyter plugin is based on rossant/ipymd, an excellent library for converting jupyter notebooks to various formats. ipymd is a python package that converts on-the-fly between the jupyter notebook-format and the R notebook format. It hooks into jupyter as content-manager, automatically performing such a conversion every time jupyter reads or writes a file, which allows to edit the supported formats directly in jupyter.

Jupyter Shortcut Markdown Cell

The classical jupyter ipynb format is a json-based list of cells, which looks roughly like this:

Jupyter Markdown Hotkey

Jupyter Markdown Shortcut

In RMarkdown, source and output are separated into a .Rmd and .nb.html file respectively. The former is plain markdown consisting of code chunks:

Jupyter Markdown Shortcuts

The latter is a html file that can readily be viewed in the browser to view the report. All output is contained in this html document and can be read back by ipymd or RStudio.





Comments are closed.