%%javascript IPython.toolbar.add_buttons_group([ { 'label' : 'Share Notebook', 'icon' : 'ui-icon-share', 'callback': function(){ IPython.notebook.insert_cell_at_bottom('code'); var code = 'lines = !jist -p ' + IPython.notebook.notebook_name + '.ipynb' + '\nprint lines[0].replace("https://gist.github.com", "http://nbviewer.ipython.org")'; IPython.notebook.get_cell(-1).set_text(code); IPython.notebook.get_cell(-1).execute(); } }]); lines = !jist -p SharingNotebooks.ipynb print lines[0].replace("https://gist.github.com", "http://nbviewer.ipython.org") %load_ext gist !mkdir -p $(ipython locate profile {get_ipython().profile})/static/js !curl https://raw.github.com/minrk/ipython_extensions/master/gist.js >> $(ipython locate profile {get_ipython().profile})/static/js/custom.js !cat $(ipython locate profile {get_ipython().profile})/static/js/custom.js