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

⤵️ Local download links #162

Merged
merged 2 commits into from
Jun 29, 2023
Merged

⤵️ Local download links #162

merged 2 commits into from
Jun 29, 2023

Conversation

rowanc1
Copy link
Member

@rowanc1 rowanc1 commented Jun 24, 2023

Updates to allow for download links.

See #158

download-role

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch executablebooks/jupyterlab-myst/feat/downloads

@rowanc1 rowanc1 added the enhancement New feature or request label Jun 24, 2023
Comment on lines +101 to +106
if ((link as any).static) {
// TODO: remove hash
const urlPath = await resolver.resolveUrl(href);
const url = await resolver.getDownloadUrl(urlPath);
(link as any).urlSource = href;
link.url = url;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is now an async function, and if the link is static we update the URL directly, otherwise we let Jupyter take care of it in the renderer.

@rowanc1
Copy link
Member Author

rowanc1 commented Jun 28, 2023

@agoose77 could you take a look -- this is a pretty minor change, making the link code async and lifting up some of the URL changes that used to happen in the renderer.

This enables the {download} role asked for in #158.

@rowanc1 rowanc1 merged commit dedbb1d into main Jun 29, 2023
9 checks passed
@rowanc1 rowanc1 deleted the feat/downloads branch June 29, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants