jupyterlab-jupytext
v1.4.3
Published
Save Jupyter Notebooks as Scripts or Markdown files that work well with version control & external text editors
Downloads
3,897
Maintainers
Readme
A JupyterLab extension for Jupytext
This extension adds a few Jupytext commands to the command palette. Use these to select the desired ipynb/text pairing for your notebook.
The latest version for this extension is .
Most users do not need to install this extension, since it is already included in the latest jupytext, both on and .
Installation
Please install Jupytext first. As mentioned above, both the pip
and conda
packages do include the latest version of the JupyterLab extension, so in most cases you don't need to specifically install this npm
package.
In case you're not using JupyterLab 4.x, you will have to install an older version of the extension that is compatible with your version. Please first install jupytext
using pip
or conda
, and then downgrade the extension to a version compatible with your version of Jupyter Lab with:
jupyter labextension install [email protected] # for JupyterLab 3.x
jupyter labextension install [email protected] # for JupyterLab 2.x
jupyter labextension install [email protected] # for JupyterLab 1.x
How to develop this extension
For fine-grained access to the jlpm
command and various build steps:
pip install -e '.[dev]'
cd jupyterlab/packages/jupyterlab-jupytext-extension
jlpm
jlpm install:extension # Symlink into `{sys.prefix}/share/jupyter/labextensions`
(see also the instructions at developing.md on how to create a Python environment with a recent version of nodejs
)
Watch the source directory and automatically rebuild the lib
folder:
cd jupyterlab/packages/jupyterlab-jupytext-extension
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
While running jlpm watch
, every saved change to a .ts
file will immediately be
built locally and available in your running Jupyter client. "Hard" refresh JupyterLab or Notebook
with CTRL-F5 or ⌘-F5 to load the change in your browser
(you may need to wait several seconds for the extension to be fully rebuilt).
Read more on this on the JupyterLab documentation.
How to publish a new version of the extension on npm
Please note that the main purpose of updating the extension on npm is to keep the npm documentation up-to-date, since the extension is made available within the Python package itself.
Make sure you have nodejs>=18
installed, bump the version in package.json
, and then:
cd jupyterlab/packages/jupyterlab-jupytext-extension
# Package the extension
npm pack
# Test the extension locally
jupyter labextension install jupyterlab-jupytext-xxx.tgz
# Publish the package on npm with
npm publish --access=public