-
Notifications
You must be signed in to change notification settings - Fork 201
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 Lightning Studio Launch Button #851
base: master
Are you sure you want to change the base?
Changes from 4 commits
9663810
b63108d
c2bbaff
6c16d36
e232aff
7fe3b55
93853dc
c1c1696
1db2da0
a35accc
c58865c
7a841fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,7 @@ def add_launch_buttons( | |
binderhub_url = launch_buttons.get("binderhub_url", "").strip("/") | ||
colab_url = launch_buttons.get("colab_url", "").strip("/") | ||
deepnote_url = launch_buttons.get("deepnote_url", "").strip("/") | ||
lightning_studio_url = launch_buttons.get("lightning_studio_url", "").strip("/") | ||
|
||
# Loop through each provider and add a button for it if needed | ||
if binderhub_url: | ||
|
@@ -189,6 +190,22 @@ def add_launch_buttons( | |
} | ||
) | ||
|
||
if lightning_studio_url: | ||
if provider.lower() != "github": | ||
SPHINX_LOGGER.warning(f"Provider {provider} not supported on Lightning.") | ||
else: | ||
github_path = f"%2F{org}%2F{repo}%2Fblob%2F{branch}%2F{path_rel_repo}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we probably need to URL escape these. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @agoose77 is the latest commit what you were looking for? At least the tests seem to pass again. Let me know if I need to change something else. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @nilsleh not quite -- I'm worried about the case where Equally, it's something that the other launchers would need to worry about, so I'll just merge for now! |
||
url = f"{lightning_studio_url}/new?repo_url=https://github.com{github_path}" | ||
agoose77 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
launch_buttons_list.append( | ||
{ | ||
"type": "link", | ||
"text": "Lightning Studio", | ||
"tooltip": translation("Launch on") + " Lightning Studio", | ||
"icon": "_static/images/logo_lightning_studio.svg", | ||
"url": url, | ||
} | ||
) | ||
|
||
# Add thebe flag in context | ||
if launch_buttons.get("thebe", False): | ||
launch_buttons_list.append( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use https://lightning.ai/studios and call it Lightning Studios (plural) consistently throughout.