-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Test: ipynb image attachment renderer #156380
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
Comments
@Yoyokrazy would you please find volunteers for testing, thanks. |
there was an issue with how the scripts were built, should be fixed in the next insiders publish with #156469 |
I'll test on Linux! |
On Linux:
Screenshots: I don't think this is a VSCode issue per se. It seems like a Jupyter bug 🤔 |
It works, but I wasn't able to paste pictures from the explorer into Jupyter (only screenshots from my screenshot tool worked). |
@sadasant - can you retry with the update from last night, images should be rendering with the latest insiders patch |
@sadasant This is actually expected behavior. Jupyter brings along the file name, but the image itself is just converted into base64 data and kept behind the notebook. There's no reference to the original file itself. Likely for the idea of keeping notebooks as portable as possible without needing people to transfer the image files as well. As for the three points above that, not totally sure about the stability of Juypter's functionality, seems like they might have some bugs... |
@amunger ok cool! now the image does display! Yay!! @Yoyokrazy ok thank you! Yeah I think Jupyter has some bugs, at least in Linux. So, things look good from what I can tell, given the limitations of Jupyter on linux. |
The image attachment preview looks good, great work! There is only one bug that we throw an error when we fail to find an image attachment and break the whole markdown preview, I'll suggest we have it fixed before release. We may also want to explore how to prevent markdown renderer plugins bring down the whole markdown preview. cc @mjbvz |
Uh oh!
There was an error while loading. Please reload this page.
Refs: #119961 #155777
Complexity: 2
Authors: @Yoyokrazy
Summary:
VScode now supports the builtin rendering of images within markdown ipynb cells when stored as attachment encoded base64 data.
Basics:
vscode/extensions/ipynb/src
is now the filecellAttachmentRenderer.ts
which extends the markdown renderer implemented inside the builtin markdown-language-features extension. There is a new image rule extended, which access and renders the attached base64 image data from within the cell metadata when the markdown source references!()[attachment:filename.filetype]
Steps to Test:
This is specifically a test to render images from notebooks that are created outside of vscode. Previously, vscode did not support images referenced via attachment metadata. Follow the procedure below:
python -m notebook
!()[attachment:image.png]
,!()[attachment:image-2.png]
,!()[attachment:image-3.png]
etc.!()[attachment:filename.png]
isntead of!()[attachment:image.png]
Things to Check:
The text was updated successfully, but these errors were encountered: