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

⤵️ Implement {download} role #158

Closed
parmentelat opened this issue Jun 17, 2023 · 8 comments
Closed

⤵️ Implement {download} role #158

parmentelat opened this issue Jun 17, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@parmentelat
Copy link

Description

some MyST constructions do not render properly within jlab4


hiya folks

actually this is just a question about the intended scope of the first jlab4 release as of #155

in particular I use this sort of constructions a lot:

 {download}`here's a link to the course material<./downloadable.zip>`

which shows up all right in jupyter-book but fails to render properly in jupyterlab (I'm talking jlab4)

I do not know how that behaves under jlab3, so I'd be curious to know whether this is a known limitation in general, or simply a shortcoming of the jlab4 port

@parmentelat parmentelat added the bug Something isn't working label Jun 17, 2023
@welcome
Copy link

welcome bot commented Jun 17, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@rowanc1
Copy link
Collaborator

rowanc1 commented Jun 17, 2023

The download role hasn't been completed yet, and not related to the jlab4 branch.

There is a list of yet-to-be-supported features here:
jupyter-book/mystmd#189

In this case I think that a simple link to the zip file should work though?

@parmentelat
Copy link
Author

The thing is, I plan on using the notebooks both inside jupyterlab and as (html) jupyter books

so in this context, using a regular markdown link like [download the zip](./dowloadable.zip) is subtly different:

the html tag renders properly in jupyterlab, but the target is ignored when building the jupyter book, which means that in the html output we get the link alright but clicking it results in a 404

the download role on the contrary renders correctly in the html output, with the zip file being properly copied over in the html build area
so it'd be a tremendous help if the role could be supported in jupyterlab as well :)

I could try and help on this, how hard would it be to implement the missing part, from somebody who's written a couple of basic jlab4 extensions ?

@rowanc1
Copy link
Collaborator

rowanc1 commented Jun 23, 2023

Have taken a step on the first (easy) part of this and will release myst-roles in the next few days. The next step will be consuming that change, and then changing the jupyterlab behaviour to download when you click rather than open the file (or perhaps provide the option?).

rowanc1 added a commit to jupyter-book/mystmd that referenced this issue Jun 23, 2023
@parmentelat
Copy link
Author

Thanks for taking care of this ! let's keep it simple: since the role name is download I can see no need for an option to open, and always downloading seems the right thing to do, imho

rowanc1 added a commit that referenced this issue Jun 24, 2023
@rowanc1 rowanc1 changed the title some MyST constructions do not render properly within jlab4 ⤵️ Implement {download} role Jun 28, 2023
@rowanc1
Copy link
Collaborator

rowanc1 commented Jun 28, 2023

@parmentelat the PR in #162 has this implemented now!

download-role

@agoose77 also a number of other small fixes to the theme:
https://github.com/executablebooks/myst-theme/releases/tag/myst-to-react%400.3.3

@rowanc1 rowanc1 added enhancement New feature or request and removed bug Something isn't working labels Jun 28, 2023
@parmentelat
Copy link
Author

excellent, many thanks :)

rowanc1 added a commit that referenced this issue Jun 29, 2023
* ⤵️ Local download links See #158
* 🏷 Updates to theme v0.3.3
@rowanc1
Copy link
Collaborator

rowanc1 commented Jul 4, 2023

This is released in v2.0.1! 🚀

Thanks again for your help @parmentelat.

@rowanc1 rowanc1 closed this as completed Jul 4, 2023
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

No branches or pull requests

2 participants