jupyterlab-myst icon indicating copy to clipboard operation
jupyterlab-myst copied to clipboard

Markdown image for valid image paths does not render

Open choldgraf opened this issue 1 year ago • 1 comments

I'm not sure what the issue here is, but I've found that paths to valid images do not render properly with Markdown and I'm not sure why.

For example, below I show that an image exists by displaying it with IPython.display.Image, but show that it does not exist if I try to display the same image using markdown with jupyterlab-myst:

image

This also doesn't work for relative paths:

CleanShot 2024-05-02 at 10 06 49@2x

choldgraf avatar May 01 '24 18:05 choldgraf

Possibly related, embeds are not working in the notebook.

Interestingly, the two forms of embeds fail in different ways.

image

image

drewlio avatar May 02 '24 17:05 drewlio

I've just run into this as well (jupyterlab-myst 2.4.2):

Does not render:

![logo](../../scipy2024.png)
<img src="../../scipy2024.png" align="right" width="20%">

Does render (full URL)

<img src="https://github.com/xarray-contrib/xarray-tutorial/blob/main/images/scipy2024.png?raw=true" align="right" width="20%">

Does render if image in same directory as notebook but does not align as expected :(

```{image} ./scipy2024.png
:alt: ScipyLogo
:width: 20%
:align: right
``` 

Does not render if image in a parent directory

```{image} ../../scipy2024.png
:alt: ScipyLogo
:width: 20%
:align: right
``` 

But we have lots of notebooks with local paths in a github repository. It would be nice if this were supported so that the notebook appears in JupyterLab exactly as it does on a website, for example: https://github.com/xarray-contrib/xarray-tutorial/blob/main/workshops/scipy2024/index.ipynb

scottyhq avatar Jun 06 '24 17:06 scottyhq

@scottyhq can you confirm where the root directory of the Jupyter server is? I.e the path to the top-level directory in the jupyterlab file browser. The problem described above is a fundamental challenge that follows from Jupyter kernels using a different file system interface (kernel process) to the Jupyter frontend (E.g jupyterlab via Jupyter server).

agoose77 avatar Jun 08 '24 14:06 agoose77

I'm closing this because I'm pretty sure this is due to user expectations rather than a bug in our code. I recognise that this can be confusing, and/or I might be wrong, so please do ping back here if you want to continue the conversation! <3

agoose77 avatar Jul 29 '24 14:07 agoose77