Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Markdown diffs for jupyter notebooks. Requires nbconvert package.
#!/usr/bin/env bash
# Step 1: put this file in your path and make executable
# Step 2: add the following to your .gitattributes file
# *.ipynb diff=nb2md
# Step 3: add the following to your .git/config
# [diff "nb2md"]
# textconv = nb2md
# or to it globally with
# git config --global diff.nb2md.textconv nb2md
jupyter nbconvert --to markdown $1 --stdout --log-level=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.