Skip to content

Docs: document Jupyter Gallery configuration (config placement + exhibit tile icons) #218

Description

@viniciusdc

Context

We keep re-deriving Jupyter Gallery (jupyterlab-gallery) configuration from scratch, and there's nothing in the ds-pack docs about it. Two separate threads have now hit the same wall, so this issue gathers both and asks for a proper docs page.

  1. Where the config has to live - established in Cannot add contents to Jupyter Gallery #134. Setting c.GalleryManager.exhibits under jupyterhub.hub.extraConfig silently no-ops: GalleryManager only exists in the singleuser server, so hub-side config is never read. It has to be a jupyter_gallery_config.py on the singleuser jupyter config path, which in a z2jh chart means injecting it via singleuser.extraFiles.

  2. Broken exhibit tile images - raised internally. A tile (e.g. "JATIC Checkmaite Tutorial") renders the browser's broken-image glyph when its icon is a remote URL that times out on a locked-down deployment. The tile image is driven by the exhibit's "icon" key; when it points at a remote asset (e.g. a GitHub raw URL) the client fetch can fail, and there's no local fallback.

What to document

A Gallery page under docs/src/content/docs/ (plus a row in the configuration.md table), covering:

  • Config placement. Exhibits go in jupyter_gallery_config.py on the singleuser config path (one of jupyter --paths -> config), not hub.extraConfig. Include the verified z2jh snippet:

    singleuser:
      extraFiles:
        gallery-config:
          mountPath: /etc/jupyter/jupyter_gallery_config.py
          stringData: |
            c.GalleryManager.title = "Tutorials"
            c.GalleryManager.destination = "tutorials"
            c.GalleryManager.exhibits = [
                {"title": "Xarray", "git": "https://github.com/xarray-contrib/xarray-tutorial.git", "homepage": "https://github.com/xarray-contrib/xarray-tutorial"},
            ]
  • Exhibit schema. git, title, homepage, description, icon, branch, depth, and account/token for private repos (with the PAT-via-env-var note from the upstream README).

  • Tile icons / the broken-image trap. The "icon" key controls the tile image. Remote icons are fetched client-side and can time out on restricted-egress deployments, leaving a broken-image placeholder with no fallback. Recommend pointing icon at a locally-served asset rather than a remote URL on such deployments.

Related / forward-looking

  • From Cannot add contents to Jupyter Gallery #134: a first-class gallery.exhibits values key would remove the hand-rolled singleuser config file entirely. If that lands, the docs collapse to the values key - worth noting so the page doesn't ossify around the workaround.
  • Upstream config reference: jupyterlab-gallery README GalleryManager traitlets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Size

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions