Package: jupyterlab-multicontents-templates
jupyterlab_multicontents_templatesInspired byJupyterlab-templatesbut added extra functions:Allow templates from any location, including S3, GCS, psql, etc., just installed the required jupyter contents manager.Preview notebook before import the templateDirectly publish notebook as templates into the selected folder with nameShare Template URL and directly opened previewThis extension is composed of a Python package namedjupyterlab_multicontents_templatesfor the server extension and a NPM package namedjupyterlab_multicontents_templatesfor the frontend extension.ScreenshotsUse Template with previewPublish notebook to TemplatesShare TemplatesRequirementsJupyterLab >= 3.0Installpipinstalljupyterlab_multicontents_templatesConfigconfigurejupyter_notebook_config.pywith the following settings:importosfromIPython.html.services.contents.filemanagerimportFileContentsManagerfroms3contentsimportS3ContentsManagerc.JupyterLabMultiContentsTemplates.template_folders={"templates from Local File":{"manager_class":FileContentsManager,"kwargs":{"root_dir":os.environ["HOME"]},},"templates from S3 prefix1":{"manager_class":S3ContentsManager,"kwargs":{"bucket":"example-bucket","prefix":"path/to/notebooks",},},"templates from S3 prefix2":{"manager_class":S3ContentsManager,"kwargs":{"bucket":"another-example-bucket","prefix":"path/to/notebooks",},},}# If you're using jupyterhub please set this value to True to enable sharing:c.JupyterLabMultiContentsTemplates.append_hub_user_redirect=TrueTroubleshootIf you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:jupyterserverextensionlistIf the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:jupyterlabextensionlistContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab_multicontents_templates directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmrunbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm run buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseUninstallpipuninstalljupyterlab_multicontents_templates