mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Add support for index.ipynb
This commit is contained in:
parent
a3ef3109db
commit
45a8d046c8
@ -202,12 +202,16 @@ class FileNotebookManager(NotebookManager):
|
||||
"""
|
||||
path = path.strip('/')
|
||||
notebook_names = self.get_notebook_names(path)
|
||||
index = []
|
||||
notebooks = []
|
||||
for name in notebook_names:
|
||||
model = self.get_notebook_model(name, path, content=False)
|
||||
notebooks.append(model)
|
||||
if name.lower() == 'index.ipynb':
|
||||
index.append(model)
|
||||
else:
|
||||
notebooks.append(model)
|
||||
notebooks = sorted(notebooks, key=lambda item: item['name'])
|
||||
notebooks = self.list_dirs(path) + notebooks
|
||||
notebooks = index + self.list_dirs(path) + notebooks
|
||||
return notebooks
|
||||
|
||||
def get_notebook_model(self, name, path='', content=True):
|
||||
|
Loading…
Reference in New Issue
Block a user