Prerequisites and Installation Steps¶
This plugin requires JupyterLab installed under a Python3.6+ environment.
Black (one of the most popular formatter) requires Python3.6+.
Also this project uses typing, a 3.6+ feature.
Installation Step 1 (Installing the plugin itself)¶
Option 1) With Pip¶
jupyter labextension install @ryantam626/jupyterlab_code_formatter pip install jupyterlab_code_formatter jupyter serverextension enable --py jupyterlab_code_formatter
Option 2) With Conda¶
conda install nodejs jupyter labextension install @ryantam626/jupyterlab_code_formatter conda install -c conda-forge jupyterlab_code_formatter jupyter serverextension enable --py jupyterlab_code_formatter
You will also need to install a code formatter for this plugin to work. The default formatter for Python are
formatR for R. Installing these would be a good place to start.
Installation Step 2 (Installing a supported code formatter)¶
Python Code Formatters¶
Supported formatters are:
Install one of them via your favourite package management tool. For example, one of the following (these are not exhaustive!)
# Installing black and isort, the default python formatters of choice in this plugin # ONLY ONE OF THESE WILL DO!!!!!!!! pip install black isort conda install black isort
Installation Step 3 (Restarting Jupyterlab)¶
If you have been following the above steps while Jupyterlab is already running, you will need to restart it for the changes to fully take effect.