Clone this.
Run jupyter notebook
in the directory.
It will list everything in $PREFIX/share/ipynb
.
import sys | |
import os | |
sys.path.append(os.path.dirname(__file__)) | |
import jupyter_shelf | |
c.NotebookApp.contents_manager_class = jupyter_shelf.ShelfContentsManager |
import sys | |
import os | |
from tornado.web import HTTPError | |
from notebook.services.contents.filemanager import FileContentsManager | |
from notebook.utils import ( | |
to_os_path, | |
) | |
ROOT = os.path.join(sys.prefix, "share", "ipynb") | |
class ShelfContentsManager(FileContentsManager): | |
def _get_os_path(self, path): | |
root = os.path.abspath(ROOT) | |
os_path = to_os_path(path, root) | |
if not (os.path.abspath(os_path) + os.path.sep).startswith(root): | |
raise HTTPError(404, | |
"%s is outside root contents directory" % path) | |
return os_path | |
def _save_file(self, *args, **kwargs): | |
pass | |
def _save_directory(self, *args, **kwargs): | |
pass |