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

Support for pasting images into markdown notebook cells #156847

Merged
merged 29 commits into from
Aug 8, 2022

Conversation

Yoyokrazy
Copy link
Contributor

Fixes: #151408 #119961

Adds support for pasting images into markdown cells. Works either with screenshots or copying files from file explorer.

Currently limited to only image/png mime type.

@Yoyokrazy Yoyokrazy requested review from mjbvz and rebornix and removed request for mjbvz August 1, 2022 23:25
@vscodenpa vscodenpa added this to the August 2022 milestone Aug 1, 2022
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
Copy link

@ProKashif ProKashif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good please attend @mjbvz comments

extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
@Yoyokrazy Yoyokrazy requested a review from mjbvz August 2, 2022 20:33
@Yoyokrazy
Copy link
Contributor Author

Current snippet functionality is attached in this image. Ended up using the snippet.appendChoice() function as it felt like the best UX when inserting an image.
image

extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
extensions/ipynb/src/notebookImagePaste.ts Outdated Show resolved Hide resolved
@Yoyokrazy Yoyokrazy requested a review from mjbvz August 4, 2022 23:32
mjbvz
mjbvz previously approved these changes Aug 4, 2022
@Yoyokrazy Yoyokrazy enabled auto-merge (squash) August 8, 2022 20:37
@Yoyokrazy Yoyokrazy merged commit 9225503 into main Aug 8, 2022
@Yoyokrazy Yoyokrazy deleted the mlively/imagePaste branch August 8, 2022 20:57
joyceerhl pushed a commit that referenced this pull request Aug 10, 2022
* dataflow support for updated metadata

* update cellAttachmentRenderer.ts to reflect metadata being a getter() inside MarkupCell

* document paste additions

* update condition to re-render cells, now includes metadata changes

* paste API working, debugging command added

* paste working with metadata. needs numbering, and cleaning upon delete

* paste screenshot works fully

* remove debugging command. Cleaning.

* notebook cells now re-render upon metadata changes

* changed name validity checking, remove unneeded function

* use _document for cell data, use snippet choice, dto fix

* return subscription, for loop, uri fix, alter metadata in-place, better snippet

* metadata fix, object.equals, fix cellAttRenderer metadata call

* added comment with source of encodeBase64

* gate mkdn image paste behind experimental setting
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling copy-paste image to Jupyter Notebook like recent Jupyter Lab would be very nice
6 participants