How can I change the sort order of files in the notebook list? I would like it to be alphabetical for all file types and not case sensitive. Directories can appear before files or within the files.
Currently my list is sorted as follows: - Directories (starting with upper case) - directories (starting with lower case) - IPython notebooks (starting with upper case) - ipython noteooks (starting with lower case) - Other files (starting with upper case) - other files (staring with lower case)
I'm using Jupyter 3.0.0-f75fda4
just as an addition to the previous post:
edit ..\Anaconda\Lib\site-packages\notebook\static\tree\js\notebooklist.js
for instance to sort last modified first:
this.sort_function = modified_sorter(0); // inserted
this.sort_id = 'last-modified'; // inserted
this.sort_direction = 0; // inserted
//this.sort_function = name_sorter(1);
// 0 => descending, 1 => ascending
//this.sort_id = 'sort-name';
//this.sort_direction = 1;
You will have to make the same changes to main.min.js
in the same directory. Naturally, with every update of jupyter notebook this will be lost. Also, no guarantees as this is a quick and dirty fix.
EDIT: in case you have already created a virtual env make sure to do the same for ..\Anaconda\envs<venv>..
If you are handy with jQuery, you can edit IPython's static files and customize the "tree" page you are referring to.
On my Ubuntu machine I could manipulate the page by editing the file /usr/local/lib/python2.7/dist-packages/IPython/html/static/tree/js/notebooklist.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With