Install with:
jupyter nbextension install ./nbdiffex/
jupyter nbextension enable nbdiffex/main
systemctl restart jupyter
Notes on possible use here: Pondering a Jupyter Notebook “Diff”er Extension and Its Use as a Marking Tool.
Install with:
jupyter nbextension install ./nbdiffex/
jupyter nbextension enable nbdiffex/main
systemctl restart jupyter
Notes on possible use here: Pondering a Jupyter Notebook “Diff”er Extension and Its Use as a Marking Tool.
// call "nbdime" and compare current version with new version in new tab | |
define([ | |
'base/js/namespace', | |
'jquery', | |
'base/js/events', | |
'base/js/utils' | |
], function(IPython, $, events, utils) { | |
"use strict"; | |
/** | |
* Call nbdiff-web with current notebook against checkpointed version | |
* | |
*/ | |
var nbCheckpointDiffView = function () { | |
var kernel = IPython.notebook.kernel; | |
var name = IPython.notebook.notebook_name; | |
var path= IPython.notebook.notebook_path | |
var base_url=window.location.protocol + '//' +window.location.hostname | |
var abspath='/vagrant/notebooks' | |
var hostport='35101' | |
var guestport='8899' | |
var url = base_url+':'+hostport+'?remote='+abspath+'/.ipynb_checkpoints/'+utils.splitext(name)[0]+'-checkpoint.ipynb&base='+abspath+'/'+path; | |
var command = 'import subprocess; subprocess.run(\'nbdiff-web --port='+guestport+' --ip=* \', shell=True)'; | |
kernel.execute(command); | |
window.open(url); | |
$('#doCheckpointDiffView').blur(); | |
}; | |
var load_ipython_extension = function() { | |
IPython.toolbar.add_buttons_group([ | |
{ | |
id: 'doCheckpointDiffView', | |
label: 'Display nbdiff to checkpointed version', | |
icon: 'fa-list-alt', | |
callback: nbCheckpointDiffView | |
} | |
]); | |
}; | |
return { | |
load_ipython_extension : load_ipython_extension | |
}; | |
}); |
Type: IPython Notebook Extension | |
Name: Checkpointdiffer | |
Description: Calls nbdiff with current notebook and checkpointed version | |
Link: readme.md | |
Compatibility: 4.x |