Notebook: Sort (sorting) order of files in notebook list (enhancement/feature request)

Created on 2 Jul 2015  路  12Comments  路  Source: jupyter/notebook

It would be helpful to be able to 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.

(Hope I got this in the correct place. Let me know if I didn't)
-Extra Info
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

Most helpful comment

sorting by modification date will be highly appreciated

All 12 comments

I'm using Jupyter 3.0.0-f75fda4

Upgrade to 3.2 which is an important security fix.

And yes we know that a better dashbord with filtering, ordering would be nice. We just need someone to write it.

Can I also add a feature request to be able to sort folder contents in reverse order. I name all my notebooks starting with a datestamp (e.g., 20151202_some_work.ipynb) and it would be most useful to have these sorted in reverse order because I usually reopen the most recent notebooks (e.g., to continue working on them). Currently I have to scroll all the way to the bottom to find my most recent notebooks.

sorting by modification date will be highly appreciated

This was implemented 1/16/16 by https://github.com/jupyter/notebook/pull/943 but it's marked for a 5.0 release, which may not happen for a few months. If you install notebook from master by following these directions, you can take advantage of the feature now.

Closing as this got implemented in #943.

This feature is not active in master?

I see it in master:

screencap

so sorry. had a clashing conda package that sneaked in and overruled the GH install.

so sorry. had a clashing conda package that sneaked in and overruled the GH install.

See https://github.com/fperez/conda-edev , relatively recent. Should avoid these kind of issues by providing pip-install as a conda "overlay".

I would highly appreciate the possibility to configure a default file sorting method and/or store a default method per directory. This is currently not possible, correct?

@slagtermaarten Hi, I'm not sure if you're still looking for a solution here. One thing I've tried is some jQuery in the custom.js folder. Per this documentation, that should be located in the following folder:

~/.jupyter/custom/custom.js

On Windows, that is something like:

C:\Users\%USERNAME%\.jupyter\custom\custom.js

For my purposes, I wanted to sort by last modified descending (newest to oldest). For that, I added a function to delay clicking the Last Modified button by ~1 second after the DOM finishes loading. You can adjust that if your system is faster/slower at loading things. The sort is retained for the session.

Anyway, at the bottom of the custom.js file, I added the following snippet:

$(function(){
  function change_order(){
    $("#last-modified").click(); // Click to sort ascending 
    $("#last-modified").click(); // Click again to sort descending
  };
  window.setTimeout( change_order, 1000 ); // 1 second delay after DOM ready
});

Clicking the button twice results in sorting by newest and the button looks like the following:

image

The IDs are found if you right-click on your button and select 'inspect element'. If you know some HTML, the id tag should be easy to find.

Hope this helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fonnesbeck picture fonnesbeck  路  3Comments

cmesro picture cmesro  路  3Comments

mmngreco picture mmngreco  路  3Comments

mowe96 picture mowe96  路  3Comments

harshinielath picture harshinielath  路  3Comments