Created
February 5, 2017 12:29
-
-
Save kingname/a29da3919317e37f0f205c380f2bdbac to your computer and use it in GitHub Desktop.
add line number for jupyter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*If you want line numbers only for code cells, there is a simpler approach. Select a code cell, open the Chrome/Firefox JavaScript console, type the following lines:*/ | |
```javascript | |
var cell = Jupyter.notebook.get_selected_cell(); | |
var config = cell.config; | |
var patch = { | |
CodeCell:{ | |
cm_config:{lineNumbers:true} | |
} | |
} | |
config.update(patch) | |
``` | |
/* | |
Then reload the page. These changes persist because Jupyter will create a json config file in .jupyter/nbconfig to store them. This method is from this page of the documentation, so read the docs for more config changes that you can make.*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment