Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc on jupyterlab-gallery #528

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add doc on jupyterlab-gallery #528

wants to merge 4 commits into from

Conversation

kcpevey
Copy link
Contributor

@kcpevey kcpevey commented Sep 24, 2024

We've had several requests for a formalized walkthrough of JupyterLab-Gallery. This PR adds a how to explaining things to users.

Reference Issues or PRs

What does this implement/fix?

Put a x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features not to work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

  • Did you test the pull request locally?
  • Did you add new tests?

Documentation

Access-centered content checklist

Text styling

  • The content is written with plain language (where relevant).
  • If there are headers, they use the proper header tags (with only one level-one header: H1 or # in markdown).
  • All links describe where they link to (for example, check the Nebari website).
  • This content adheres to the Nebari style guides.

Non-text content

  • All content is represented as text (for example, images need alt text, and videos need captions or descriptive transcripts).
  • If there are emojis, there are not more than three in a row.
  • Don't use flashing GIFs or videos.
  • If the content were to be read as plain text, it still makes sense, and no information is missing.

Any other comments?

Copy link

netlify bot commented Sep 24, 2024

Deploy Preview for nebari-docs ready!

Name Link
🔨 Latest commit eab3757
🔍 Latest deploy log https://app.netlify.com/sites/nebari-docs/deploys/66f45d530067570008e40979
😎 Deploy Preview https://deploy-preview-528--nebari-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kcpevey kcpevey requested a review from krassowski September 24, 2024 19:41
| ----------- | ---------------------------------------------------------------------------- |
| title | Title on the gallery tile |
| git | URL of the git repository |
| homepage | (Optional) |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be used as a link to the examples repository. The idea is to separate the git URL which might contain token (discouraged) from the link shown in the UI (if any).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also used to generate fallback icon from GitHub social cards

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be used as a link to the examples repository.

As far as I can tell, the UI doesn't link to the repository in any way. If I hover the gallery tile, I just have the options to download or go to the folder. Is this link provided to the users somewhere else?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, it is not available in the UI. For god security practice the git URL is separated from user facing URL even though it is not currently in the UI. My plan was to add a new button with link icon but I guess it is low priority. It would be rather low effort too though.

| homepage | (Optional) |
| description | Description of the repository to appear on the gallery tile (Optional) |
| icon | base64 encoded image to use an icon to appear on the gallery tile (Optional) |
| account | (Optional) |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you log in using token you need to also pass account. Depending on whether it is GitHub or GitLab it should be a pre-defined string, or any string.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is defined in https://github.com/nebari-dev/jupyterlab-gallery/blob/ef56fc616bae4ec8305c01e3341b773ca4cfd48f/jupyterlab_gallery/manager.py#L30-L82

You can access the documentation via jupyterlab-gallery --help-all. I will add it to the README.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krassowski for account, what does that look like in a github and gitlab url?

For example, if I go to "clone from https" on the nebari-dev repo, it gives this url: https://github.com/nebari-dev/nebari.git . Would the account be nebari-dev or is that my username associate with the token?

For gitlab the "clone from https" could looks like this: https://gitlab.<domain>.net/<projectname>/<teamname>/gradient.git. What is the account here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a part of the URL. It is used during login sequence, the same way as you would login via CLI when issuing say git push on a new machine (by providing a user name and password). Of course you would not because everyone has an SSH key configured instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we do with https://www.nebari.dev/docs/explanations/custom-overrides-configuration#jupyterlab? It includes some important warnings about the PAT/token usage, and feels like a right place to at least keep a mention of gallery_settings. Should it link to this how-to?


[JupyterLab-Gallery ](https://github.com/nebari-dev/jupyterlab-gallery) is a JupyterLab plugin
that allows users to share a Git Repository. JupyterLab users are presented with a tile in
the JupyterLab launch screen. Users can choose to download the Gallery.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the JupyterLab launch screen. Users can choose to download the Gallery.
the JupyterLab launch screen. Users can choose to download the Exhibit.

No strong opinions, I am just using the wording of "gallery composed of multiple exhibits" in jupyterlab-gallery and it seems to make more sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I struggled with this wording - that is perfect!

Comment on lines +31 to +32
level settings are defined for each repository. The descriptions of each section are described
below.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
level settings are defined for each repository. The descriptions of each section are described
below.
level settings are defined for each repository. The settings in each section are described
below.

Not a strong opinion here either

Comment on lines +25 to +27
Several repositories can be configured to display as individual gallery tiles. Under the `exhibits`
section, each repository must have a `title` and a `git` location. There are also several other
optional config options.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: currently the tiles are designed so that they are most beautiful when there is a description. I would personally say that adding description is recommended, but do not want to push it either.

| git | URL of the git repository |
| homepage | (Optional) |
| description | Description of the repository to appear on the gallery tile (Optional) |
| icon | base64 encoded image to use an icon to appear on the gallery tile (Optional) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, this can be an URL.

Suggested change
| icon | base64 encoded image to use an icon to appear on the gallery tile (Optional) |
| icon | URL or base64 encoded image to use an icon to appear on the gallery tile (Optional) |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though base64 encoding the image is probably best practice as it ensures that it will never break.

@viniciusdc
Copy link
Contributor

viniciusdc commented Nov 1, 2024

@kcpevey @krassowski what's the current status on this? I recently needed this information and relied on the preview here hshshs. Is there anything I can help with? Also, I think the part regarding the use of tokens needs a bit more explanation I primarily relied on the repo readme, the discussions above and actual deployments to grasp what was happening in terms of auth fully.

Also, I note that how the extension identifies new commits would be helpful since I was not sure how it would update the clones until I tested it myself. Overall, this tool is fantastic! Huge shout out @krassowski !

### Sample configuration

Below is an example of the Gallery settings from the `nebari-config.yaml`. Note that \<encoding\>
and \<PAT\> should be replaced with the actual encoding an Private Access Token, respectively.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and \<PAT\> should be replaced with the actual encoding an Private Access Token, respectively.
and \<PAT\> should be replaced with the actual encoding and Private Access Token, respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo 📬
Development

Successfully merging this pull request may close these issues.

3 participants