Skip to content

Instantly share code, notes, and snippets.

@iamlemec
Created September 27, 2015 17:52
Show Gist options
  • Save iamlemec/18bbe71f378553121ff5 to your computer and use it in GitHub Desktop.
Save iamlemec/18bbe71f378553121ff5 to your computer and use it in GitHub Desktop.
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