executablebooks / jupyterlab-myst

Use MyST Markdown directly in Jupyter Lab

Home Page:https://mystmd.org/guide/quickstart-jupyter-lab-myst

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⤵️ Implement {download} role

parmentelat opened this issue · comments

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

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! 🎉

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:
executablebooks/mystmd#189

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

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 ?

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?).

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

@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

excellent, many thanks :)

This is released in v2.0.1! 🚀

Thanks again for your help @parmentelat.