## you can inspect the autosave code to see what it does. %autosave?? profile_dir = ! ipython locate profile_dir = profile_dir[0] profile_dir import os.path custom_js_path = os.path.join(profile_dir,'profile_default','static','custom','custom.js') # my custom js with open(custom_js_path) as f: for l in f: print l, %%javascript var CellToolbar = IPython.CellToolbar var toggle = function(div, cell) { var button_container = $(div) // let's create a button that show the current value of the metadata var button = $('