jupyter-book / jupyterlab-myst

Use MyST Markdown directly in Jupyter Lab
https://jupyter-book.github.io/jupyterlab-myst/
BSD 3-Clause "New" or "Revised" License
140 stars 17 forks source link

Markdown image for valid image paths does not render #240

Closed choldgraf closed 3 months ago

choldgraf commented 5 months ago

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

drewlio commented 5 months ago

Possibly related, embeds are not working in the notebook.

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

image

image

scottyhq commented 4 months ago

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
: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
agoose77 commented 4 months ago

@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 commented 3 months ago

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