JupyterLab can be extended in two ways via:
For this section, the term, 'document', refers to any visual thing that is backed by a file stored on disk (i.e. uses Contents API).
The Document Manager uses the Document Registry to create models and widgets for documents.
The File Browser uses the Document Manager when creating and opening files.
The Document Registry is the default mechanism for interacting with files in JupyterLab.
Document widget extensions in the JupyterLab application can register:
Create a widget for a given file.
Example
Create a model for a given file.
Models are generally differentiated by the contents options used to fetch the model (e.g. text, base64, notebook).
Add additional functionality to a widget type. An extension instance is created for each widget instance.
Examples
Intended to be used in a "Create New" dialog, providing a list of known file types.
Intended for create quick launch file creators.
The default use will be for the "create new" dropdown in the file browser, giving list of items that can be created with default options (e.g. "Python 3 Notebook").
The Document Manager handles:
for documents and manages their life cycle.
Created by the model factories and passed to widget factories and widget extensions.
Created by the Document Manager and passed to widget factories and widget extensions.
They are used to provide an abstracted interface to the session and contents API from jupyter-js-services for the given model. They are tied to a model and can be shared between widgets.
The reason for a separate context and model is so that it is easy to create model factories and the heavy lifting of the context is left to the Document Manager.