Package: jupyter-nbgallery
OverviewThis package provides several Jupyter extensions to enable integration withnbgallery.  More information is availableherein the nbgallery github project.InstallationThis package contains UI extensions (nbextensions) for NBClassic only.  The server extension was migrated to jupyterlab_nbgallery To install with pip:pip install jupyter_nbgalleryAs of version 2.0, the minimal set of extensions required for nbgallery integration will be automatically installed and enabled.  This includes thepost_hackserver extension, the nbgallery environment registration UI extension, and the Gallery menu UI extension.To enable the optional extensions:# Enable all extensions
jupyter nbclassic-extension enable --sys-prefix --py jupyter_nbgallery

# Enable individual extensions
jupyter nbclassic-extension enable --sys-prefix --section tree jupyter_nbgallery/autodownload/autodownload
jupyter nbclassic-extension enable --sys-prefix --section notebook jupyter_nbgallery/easy_buttons/easy_buttons
jupyter nbclassic-extension enable --sys-prefix --section notebook jupyter_nbgallery/instrumentation/instrumentationJupyter configurationOnce the extension is installed, you will also need to modify your Jupyter configuration to interact with your nbgallery server.First, your Jupyter instance needs to know about your nbgallery server in order to save notebooks, download preferences, etc.  This is configured innbconfig/common.jsonunderneath one of Jupyter'sconfiguration directories.  You can use the includedjupyter nbgalleryscript to set the location of your nbgallery, as well as the Jupyter client name that will appear in nbgallery's "Run in Jupyter" Environments page.# Set nbgallery server location:
# jupyter nbgallery [--user|--system|--sys-prefix] configure url <nbgallery server address>
# Example:
jupyter nbgallery --sys-prefix configure url http://localhost:3000

# Set nbgallery environment client name
# Example:
jupyter nbgallery --sys-prefix configure client.name my-jupyter-instanceAfter configuration,nbconfig/common.jsonshould look something like this (potentially with other unrelated sections):{
  "nbgallery": {
    "url": "http://localhost:3000",
    "client": {
      "name": "my-jupyter-instance"
    }
  }
}Second, in order for nbgallery's "Run in Jupyter" button to work, Jupyter must be configured to allow cross-site AJAX.Note these are security-relevant configuration settings.These can be set injupyter_notebook_config.py:c.NotebookApp.allow_origin = <URL of your nbgallery instance>`
c.NotebookApp.allow_credentials = True
c.NotebookApp.disable_check_xsrf = TrueThese can also be set on the command line when launching Jupyter; for example:jupyter notebook --NotebookApp.allow_origin='http://localhost:3000' --NotebookApp.allow_credentials=True --NotebookApp.disable_check_xsrf=TrueIf you are launchingjupyter labinstead ofjupyter notebook, be aware that as of Lab 3.0, these are nowServerAppsettings that can be set injupyter_server_config.py(see themigration guide).List of ExtensionsUI Extensions (nbextensions)Minimal Setenvironmentregisters this Jupyter instance with nbgallery so notebooks can be launched with the "Run in Jupyter" button.  It also downloads preferences stored in nbgallery.gallery_menuadds theGalleryandPreferencesmenus to the Notebook interface.  These are necessary for saving notebooks and preferences back to nbgallery.Optionalautodownloadwill downloadStarredandRecently Executednotebooks from nbgallery when you first visit the Jupyter tree page.easy_buttonsadds buttons to the active cell for commonly-used actions.instrumentationreports cell execution status back to nbgallery fornotebook health assessment.