!date
Sat May 25 08:46:20 PDT 2013
Step 1, use nbconvert to turn ipynb files into html.
cd ../nbconvert/
/snfs2/HOME/abie/nbconvert
!./nbconvert.py --format html nbdt1.ipynb
====================================================== Warning, we are deprecating this version of nbconvert, please consider using the new version. ======================================================
!./nbconvert.py --format html nbdt2.ipynb
====================================================== Warning, we are deprecating this version of nbconvert, please consider using the new version. ======================================================
Step 2, use html diff.py to generate html diff
!wget http://www.aaronsw.com/2002/diff/diff.py
--2013-05-25 08:51:37-- http://www.aaronsw.com/2002/diff/diff.py Resolving www.aaronsw.com... 75.127.96.63 Connecting to www.aaronsw.com|75.127.96.63|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1916 (1.9K) [text/x-python] Saving to: “diff.py.1” 100%[======================================>] 1,916 --.-K/s in 0s 2013-05-25 08:51:37 (224 MB/s) - “diff.py.1” saved [1916/1916]
!python diff.py nbdt1.html nbdt2.html >nbdt_diff.html
from IPython.core.display import HTML
HTML(filename='nbdt_diff.html')
!date
This is a test of an nbconvert+html_diff approach to seeing what has changed in ipynb files.
1+1
sqrt(1718)
plot(rand(10))
!cd /homes/abie/nbconvert/; cp /homes/abie/notebook/*nb_diff_test.ipynb nbdt1.ipynb; ./nbconvert.py --format html nbdt1.ipynb
This could use a ton of work on the css, obviously, but it gets the job done for now.
E.g. adding the following makes the prompts not overlap the input cells as badly:
<style type="text/css">
div.prompt {width: 22ex;}
</style>