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

🪐 Launch binder for article theme #239

Merged
merged 22 commits into from
Oct 3, 2023
Merged

Conversation

stevejpurves
Copy link
Member

@stevejpurves stevejpurves commented Sep 27, 2023

  • uses a site's thebe/jupyter settings
  • add a "Launch Binder" button to the
  • once a binder server is available, "Launch Binder" will change to "Open in Binder" and clicking that will open a new tab, with a new instance of jupyterlab but with
  • removing binderbadge functionality in favor of the new launch binder controls

This is dependent on recent changes to thebe enabling different "providers" to be configured.

const thebe = useThebeOptions();
const canCompute = !!thebe && (article.frontmatter as any)?.thebe !== false;
// TODO in lieu of extended frontmatter or theme options
const enable_notebook_toolbar = false;
Copy link
Member Author

Choose a reason for hiding this comment

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

@rowanc1 do we have a way of bringing in theme options yet for the web theme? or any thoughts on where to do that?

I am wondering if there is already a mechanism there via the site config + template options?

@@ -27,7 +27,8 @@ function makeThebeOptions(
binderBadgeUrl,
);

const options = thebeFrontmatter ? optionsFromFrontmatter : undefined;
const options = optionsOverrideFn(thebeFrontmatter ? optionsFromFrontmatter : undefined);
Copy link
Member Author

Choose a reason for hiding this comment

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

a parent theme is able to fully manipulate the options, guarding against undesirable options (e..g connecting to a foreign binder) coming in from the myst site, or just being able to patch certain options appropriately for where there parent theme is used/deployed.

@stevejpurves
Copy link
Member Author

Confirmed also that from the book-theme when we hit the existing "Launch in Binder" link on the Notebook Toolbar, this successfully opens the jupyterlab on the server.

What we are missing in the book-theme experience is a place to add the Launch in Binder link.
We also don't have a location for the other downloadable assets.

Should we be considering adding something to the header section of the index article?
image

or some type of top level nav dropdown?

image

@rowanc1 rowanc1 changed the title launch binder for articles 🪐 Launch binder for article theme Oct 3, 2023
@rowanc1
Copy link
Member

rowanc1 commented Oct 3, 2023

Couldn't do the rebase well with so many conflicts. The merge I think is correct!

We should be sure to squash-merge this when ready.

@rowanc1 rowanc1 merged commit 0573aac into main Oct 3, 2023
2 checks passed
@rowanc1 rowanc1 deleted the feat/binder-for-articles branch October 3, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants