Skip to main content

A JupyterLab Extension for showing cell (git) diffs.

Project description

jupyterlab-cell-diff

Github Actions Status

A JupyterLab extension for showing cell diffs with multiple diffing strategies.

Requirements

  • JupyterLab >= 4.0.0

Installation

PyPI Installation

pip install jupyterlab_cell_diff

Development Installation

# Clone the repository
git clone https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff.git
cd jupyterlab-cell-diff

# Install the extension in development mode
pip install -e .
jupyter labextension develop . --overwrite

Usage

Commands

The extension provides a command to show cell diffs:

  • jupyterlab-cell-diff:show-codemirror - Show diff using @codemirror/merge

https://github.com/user-attachments/assets/0dacd7f0-5963-4ebe-81da-2958f0117071

Programmatic Usage

app.commands.execute('jupyterlab-cell-diff:show-codemirror', {
  cellId: 'cell-id',
  originalSource: 'print("Hello")',
  newSource: 'print("Hello, World!")'
});

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_cell_diff

Troubleshoot

To check the frontend extension is installed:

jupyter labextension list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterlab_cell_diff-0.5.0.tar.gz (158.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyterlab_cell_diff-0.5.0-py3-none-any.whl (91.2 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlab_cell_diff-0.5.0.tar.gz.

File metadata

  • Download URL: jupyterlab_cell_diff-0.5.0.tar.gz
  • Upload date:
  • Size: 158.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for jupyterlab_cell_diff-0.5.0.tar.gz
Algorithm Hash digest
SHA256 e888f8cf4bdaa68f2f99400ac4936a06b1f981a063d57b27d397aa7971479b17
MD5 1f261c77f68bc1fa7ba301bb99db2f69
BLAKE2b-256 19851c6fdc4e0220eb434ed024e01923b72564ae81d2ea245b722afa43bdfd5c

See more details on using hashes here.

File details

Details for the file jupyterlab_cell_diff-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_cell_diff-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18cbf46993ef8bd333e78f5d17739980c75c323b44abfb4478a1872b344f54e8
MD5 fb095bc44216e83dd7932ad7465ed85f
BLAKE2b-256 4ab891e28a72157838737322d2e220405ae003cf854cbe3f9eb159e2f0d85e32

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page