{"action":"created","issue":{"url":"https://api.github.com/repos/minrk/ipython_extensions/issues/52","labels_url":"https://api.github.com/repos/minrk/ipython_extensions/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/minrk/ipython_extensions/issues/52/comments","events_url":"https://api.github.com/repos/minrk/ipython_extensions/issues/52/events","html_url":"https://github.com/minrk/ipython_extensions/issues/52","id":107589236,"number":52,"title":"Jupyter notebook 4 hangs with TOC extension","user":{"login":"tritemio","id":4156237,"avatar_url":"https://avatars.githubusercontent.com/u/4156237?v=3","gravatar_id":"","url":"https://api.github.com/users/tritemio","html_url":"https://github.com/tritemio","followers_url":"https://api.github.com/users/tritemio/followers","following_url":"https://api.github.com/users/tritemio/following{/other_user}","gists_url":"https://api.github.com/users/tritemio/gists{/gist_id}","starred_url":"https://api.github.com/users/tritemio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tritemio/subscriptions","organizations_url":"https://api.github.com/users/tritemio/orgs","repos_url":"https://api.github.com/users/tritemio/repos","events_url":"https://api.github.com/users/tritemio/events{/privacy}","received_events_url":"https://api.github.com/users/tritemio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-21T20:11:44Z","updated_at":"2015-09-23T09:32:40Z","closed_at":null,"body":"As in the title, in one machine (Win 7) with TOC extension installed has been migrated to jupyter 4.x. The extension caused the notebook to hang when opening a notebook (a new tab is opened, I see the Jupyter header but the notebook content is not loaded).\r\n\r\nUpon commenting the relevant line in `custom.js` the issue was solved.\r\n\r\nOn a second machine (OSX) with jupyter notebook 4.0.4 already installed, I downloaded toc.js/css with curl, then I tried installing the TOC extension by adding:\r\n\r\n```\r\n$([IPython.events]).on(\"app_initialized.NotebookApp\", function () {\r\n    IPython.load_extensions(\"toc\");\r\n});\r\n```\r\nto `.jupyter/custom/custom.js` (I had to create the custom folder and the custom.js file).\r\n\r\nAm I doing something wrong?\r\n\r\n**EDIT**: fix typos"},"comment":{"url":"https://api.github.com/repos/minrk/ipython_extensions/issues/comments/142545222","html_url":"https://github.com/minrk/ipython_extensions/issues/52#issuecomment-142545222","issue_url":"https://api.github.com/repos/minrk/ipython_extensions/issues/52","id":142545222,"user":{"login":"asteppke","id":5851636,"avatar_url":"https://avatars.githubusercontent.com/u/5851636?v=3","gravatar_id":"","url":"https://api.github.com/users/asteppke","html_url":"https://github.com/asteppke","followers_url":"https://api.github.com/users/asteppke/followers","following_url":"https://api.github.com/users/asteppke/following{/other_user}","gists_url":"https://api.github.com/users/asteppke/gists{/gist_id}","starred_url":"https://api.github.com/users/asteppke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asteppke/subscriptions","organizations_url":"https://api.github.com/users/asteppke/orgs","repos_url":"https://api.github.com/users/asteppke/repos","events_url":"https://api.github.com/users/asteppke/events{/privacy}","received_events_url":"https://api.github.com/users/asteppke/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T09:32:40Z","updated_at":"2015-09-23T09:32:40Z","body":"I looked into this again, so what I wrote worked here for the transition to ipython 3.x. This is not working for jupyter as you experienced. Until the toc extension is part of the official repository some hacking is still required. The javascript api has changed again so this is the configuration that worked here after upgrading from 3.x to jupyter:\r\n\r\nThe `toc.js` and `toc.css` should be located in the appropriate  directory, e.g. on Windows for a per user installation in `%AppData%\\Roaming\\jupyter\\nbextensions`. \r\n\r\nThis extension then needs to be loaded using a javascript snippet in your `custom.js`:\r\n\r\n    require(['base/js/utils'],\r\n    function(utils) {\r\n        utils.load_extensions('toc');\r\n    });\r\n\r\nTo test whether this file is executed at all you can use a simple alert function additionally:\r\n    \r\n    alert(\"hello world from custom.js\")\r\n\r\nHere the `custom.js` is located in `.jupyter\\custom\\`.\r\n"}}