{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/notebook/issues/457","labels_url":"https://api.github.com/repos/jupyter/notebook/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/notebook/issues/457/comments","events_url":"https://api.github.com/repos/jupyter/notebook/issues/457/events","html_url":"https://github.com/jupyter/notebook/issues/457","id":107121203,"number":457,"title":"Document how to customize cell code indentation","user":{"login":"willingc","id":2680980,"avatar_url":"https://avatars.githubusercontent.com/u/2680980?v=3","gravatar_id":"","url":"https://api.github.com/users/willingc","html_url":"https://github.com/willingc","followers_url":"https://api.github.com/users/willingc/followers","following_url":"https://api.github.com/users/willingc/following{/other_user}","gists_url":"https://api.github.com/users/willingc/gists{/gist_id}","starred_url":"https://api.github.com/users/willingc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willingc/subscriptions","organizations_url":"https://api.github.com/users/willingc/orgs","repos_url":"https://api.github.com/users/willingc/repos","events_url":"https://api.github.com/users/willingc/events{/privacy}","received_events_url":"https://api.github.com/users/willingc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jupyter/notebook/labels/docs","name":"docs","color":"ffffff"}],"state":"closed","locked":false,"assignee":{"login":"willingc","id":2680980,"avatar_url":"https://avatars.githubusercontent.com/u/2680980?v=3","gravatar_id":"","url":"https://api.github.com/users/willingc","html_url":"https://github.com/willingc","followers_url":"https://api.github.com/users/willingc/followers","following_url":"https://api.github.com/users/willingc/following{/other_user}","gists_url":"https://api.github.com/users/willingc/gists{/gist_id}","starred_url":"https://api.github.com/users/willingc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willingc/subscriptions","organizations_url":"https://api.github.com/users/willingc/orgs","repos_url":"https://api.github.com/users/willingc/repos","events_url":"https://api.github.com/users/willingc/events{/privacy}","received_events_url":"https://api.github.com/users/willingc/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jupyter/notebook/milestones/4","html_url":"https://github.com/jupyter/notebook/milestones/4.1","labels_url":"https://api.github.com/repos/jupyter/notebook/milestones/4/labels","id":1204376,"number":4,"title":"4.1","description":null,"creator":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":122,"state":"open","created_at":"2015-07-13T02:35:55Z","updated_at":"2015-10-06T16:55:26Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-09-18T02:42:48Z","updated_at":"2015-10-06T16:55:26Z","closed_at":"2015-10-06T16:55:26Z","body":"From Google Group discussion (9/15/2015) between @Carreau and Ugo:\r\n\r\nIn recent version you shouldn’t even need to do all that. \r\nJust issue the following once in the javascript console of your browser:\r\n\r\n``Jupyter.notebook.get_selected_cell().config.update({CodeCell:{cm_config:{indentUnit :2}}})``\r\n\r\n\r\nReload your notebook. \r\n\r\nit works. \r\n\r\nI'm a bit lost with respect to what are the directories that jupyter actually searches, and I was not able to get custom.js to be loaded.\r\n\r\nThen I've tried to start from the instructions at https://carreau.gitbooks.io/jupyter-book/content/Jsextensions.html, and succeded at creating a simple extension:\r\n\r\ndefine(function(){\r\n  return {\r\n    load_ipython_extension: function(){\r\n      console.log('Loading ugos custom.js');\r\n      require([\"notebook/js/codecell\"], function(result) {\r\n        result.CodeCell.options_default.cm_config.indentUnit = 2;\r\n        console.log('Loaded ugos custom.js');\r\n      });\r\n    }\r\n  };\r\n});\r\n\r\nIf I explicitly run a cell:\r\n%%javascript\r\nrequire(['base/js/utils'], function(utils) { utils.load_extensions('ugo'); });\r\nin my notebook, then new cells do have 2 spaces indents.\r\n\r\nBut now I don't know how to get ipython to load the extension automatically, so that all the cells do get the same indentUnit.\r\n\r\nYou need to issue the \r\n\r\n > Jupyter.notebook.config.update({\"load_extensions\":{\"my_ext\":true}})\r\n\r\nThat will load your extension every tim, "},"comment":{"url":"https://api.github.com/repos/jupyter/notebook/issues/comments/145926648","html_url":"https://github.com/jupyter/notebook/issues/457#issuecomment-145926648","issue_url":"https://api.github.com/repos/jupyter/notebook/issues/457","id":145926648,"user":{"login":"ellisonbg","id":27600,"avatar_url":"https://avatars.githubusercontent.com/u/27600?v=3","gravatar_id":"","url":"https://api.github.com/users/ellisonbg","html_url":"https://github.com/ellisonbg","followers_url":"https://api.github.com/users/ellisonbg/followers","following_url":"https://api.github.com/users/ellisonbg/following{/other_user}","gists_url":"https://api.github.com/users/ellisonbg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisonbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisonbg/subscriptions","organizations_url":"https://api.github.com/users/ellisonbg/orgs","repos_url":"https://api.github.com/users/ellisonbg/repos","events_url":"https://api.github.com/users/ellisonbg/events{/privacy}","received_events_url":"https://api.github.com/users/ellisonbg/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T16:55:26Z","updated_at":"2015-10-06T16:55:26Z","body":"@willingc looks like your PR was merged, closing this."}}