Skip to content

Latest commit

 

History

History
94 lines (70 loc) · 1.94 KB

File metadata and controls

94 lines (70 loc) · 1.94 KB
:hidden:

installation.md
usage.md
configuration.md
custom-formatter.md
faq.md
jupyterhub.md
changelog.md
dev.md
getting-help.md
your-support.md

JupyterLab Code Formatter

A JupyterLab plugin to facilitate invocation of code formatters.

Source Code: GitHub.

Demo

format-all

Requirements

  • Python 3.7+
  • JupyterLab >= 3.6.0 (if you are using JupyterLab>=3.0,<=3.5, pin this package to 2.0.0)
  • Any supported code formatters (you can also specify your own, see custom formatter).

:::{important} JupyterLab Code Formatter only provides an interface for invoking code formatters on Jupyter Server, and does not include any code formatter by default. :::

Quick Start

  1. Install the package
```bash
pip install jupyterlab-code-formatter
```
```bash
poetry add jupyterlab-code-formatter
```
```bash
pipenv install jupyterlab-code-formatter
```
  1. Install some supported formatters (isort+black are default for Python)
```bash
# NOTE: Install black and isort,
#       JL code formatter is configured to invoke isort and black by default
pip install black isort
```
```bash
# NOTE: Install black and isort,
#       JL code formatter is configured to invoke isort and black by default
poetry add black isort
```
```bash
# NOTE: Install black and isort,
#       JL code formatter is configured to invoke isort and black by default
pipenv install black isort
```
  1. Restart JupyterLab

This plugin includes a server plugin, as such you will need to restart JupyterLab if you have followed the above steps while it's running.

  1. Configure plugin

To configure which/how formatters are invoked, see configuration.