6 Authoring Extensions
In this section, we will review a range of Jupyer extensions that can be used to specifically support the authoring process.
These include extensions that enhance or extend the authoring environment as well as extensions that support quality related activity such as might be completed by authors or editors.
6.1 Editing Environment Extensions
By “editing environment extensions”, we mean extensions that can be used to extend the editing environment to improve the experience of writing.
6.1.1 Live markdown Preview
The jupyter-contrib-nbextensions
packaged live markdown preview extension will provide a live preview of text currently being edited in a markdown cell. A notebook extensions configurator panel allows the user to select whether the preview appears directly below the cell being edited (the default behaviour) or to the side.
Note that the highlighted spellchecking as text is entered comes from the spellchecker
extension.
6.1.2 Python Output in Markdown Cells
The jupyter-contrib-nbextensions
packaged Python Markdown extension allows you to include Python variables in your markdown cell content. This allows values to be set in code and then rendered from the markdown cell.
6.2 Quality Process Extensions
By “quality process extensions”, we mean extensions that can be used to support the production of text free of error or poor layout.
6.2.1 autopep8
The autopep8
extension provides a toolbar button that allows you to style one of more selected code cells in accordance with Python PEP8 style guidelines using the autopep8
Python package.
6.2.2 pycodestyle_magic
/ flake8_magic
The pycodestyle_magic
provides two magics for linting code: %%pycodestyle
(using pycodestyle
) and %%flake
(using flake8
and any installed flake8
extensions).
A provided line magic can also be used to enable either linter to run automatically against each code cell whenever the code cell is run.
6.2.3 Spellchecking
The jupyter-contrib-nbextensions
packaged spellchecker extension will highlight unrecognised words in markdown cells that are in edit mode.
The configurator can be used to display a toolbar button to toggle the operation of the spellchecker; the dictionary used for spellcheck lookups can also be specified.
The extension will also offer a live preview as you type:
Note that the live rendered markdown preview is provided by the live markdown preview extension.
The configurator allows to the live markdown preview to be automatically applied enabled in each opened notebook.