{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/notebook/issues/621","labels_url":"https://api.github.com/repos/jupyter/notebook/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/notebook/issues/621/comments","events_url":"https://api.github.com/repos/jupyter/notebook/issues/621/events","html_url":"https://github.com/jupyter/notebook/pull/621","id":112237287,"number":621,"title":"[WIP] Implement markdown cell attachments. Allow drag’n’drop of images into…","user":{"login":"julienr","id":506602,"avatar_url":"https://avatars.githubusercontent.com/u/506602?v=3","gravatar_id":"","url":"https://api.github.com/users/julienr","html_url":"https://github.com/julienr","followers_url":"https://api.github.com/users/julienr/followers","following_url":"https://api.github.com/users/julienr/following{/other_user}","gists_url":"https://api.github.com/users/julienr/gists{/gist_id}","starred_url":"https://api.github.com/users/julienr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienr/subscriptions","organizations_url":"https://api.github.com/users/julienr/orgs","repos_url":"https://api.github.com/users/julienr/repos","events_url":"https://api.github.com/users/julienr/events{/privacy}","received_events_url":"https://api.github.com/users/julienr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-10-19T21:30:43Z","updated_at":"2015-10-21T17:05:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jupyter/notebook/pulls/621","html_url":"https://github.com/jupyter/notebook/pull/621","diff_url":"https://github.com/jupyter/notebook/pull/621.diff","patch_url":"https://github.com/jupyter/notebook/pull/621.patch"},"body":"This adds a way for users to insert inline images in markdown cells using drag and drop\r\n\r\nTODO:\r\n- [ ] Add an UI to edit attachments. I am thinking about something similar to the way one can edit cell metadata.\r\n- [ ] Add ability to copy-paste images\r\n- [ ] Add a menu item to insert images\r\n- [ ] \"Garbage collect\" attachments that are not referenced from markdown ?\r\n- [ ] Large attachments warning ?\r\n\r\nIdeas :\r\n- [ ] Could add a ipython magic so you can access attachments from python code. Could be nice to directly attach some data to the notebook for small datasets.\r\n\r\nThis is an experimental implementation of what was discussed in #613 by @ellisonbg and @stevengj .\r\nWhen a user drag and drops an image into a markdown cell, the image data is stored in the cell metadata and can be used as the source for an image by using a special 'nbdata:filename' syntax.\r\n\r\nHere are some things to discuss to move forward :\r\n- It should be possible to insert inline images without drag'n'drop. Add a menu item ?\r\n- There should be a UI so the user can easily see which cells have 'attachments' and a way to manage them.\r\n\r\nScreenshots\r\n-----------------\r\nJust after the drop of an image :\r\n<img width=\"962\" alt=\"1_source\" src=\"https://cloud.githubusercontent.com/assets/506602/10591903/14d49614-76b9-11e5-90a9-0246972bb274.png\">\r\n\r\nThe metadata :\r\n<img width=\"689\" alt=\"2_metadata\" src=\"https://cloud.githubusercontent.com/assets/506602/10591919/26d009ac-76b9-11e5-9ff4-3a3f475b6970.png\">\r\n\r\nThe rendered cell\r\n<img width=\"819\" alt=\"3_rendered\" src=\"https://cloud.githubusercontent.com/assets/506602/10591925/2c245d86-76b9-11e5-9829-e0bf966659c8.png\">"},"comment":{"url":"https://api.github.com/repos/jupyter/notebook/issues/comments/149964115","html_url":"https://github.com/jupyter/notebook/pull/621#issuecomment-149964115","issue_url":"https://api.github.com/repos/jupyter/notebook/issues/621","id":149964115,"user":{"login":"ellisonbg","id":27600,"avatar_url":"https://avatars.githubusercontent.com/u/27600?v=3","gravatar_id":"","url":"https://api.github.com/users/ellisonbg","html_url":"https://github.com/ellisonbg","followers_url":"https://api.github.com/users/ellisonbg/followers","following_url":"https://api.github.com/users/ellisonbg/following{/other_user}","gists_url":"https://api.github.com/users/ellisonbg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisonbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisonbg/subscriptions","organizations_url":"https://api.github.com/users/ellisonbg/orgs","repos_url":"https://api.github.com/users/ellisonbg/repos","events_url":"https://api.github.com/users/ellisonbg/events{/privacy}","received_events_url":"https://api.github.com/users/ellisonbg/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T17:05:14Z","updated_at":"2015-10-21T17:05:14Z","body":"@jasongrout is probably in favor of embedding (next to me) - \"I think the\ncall has already been made by how we handle output\"\n\nOn Wed, Oct 21, 2015 at 12:59 PM, Brian Granger <ellisonbg@gmail.com> wrote:\n\n> I can see both sides here.\n>\n> I see Min's point that almost everything is accomplished by uploading to\n> the server next to the notebook using the Content API.\n>\n> I also see that we are already putting binary data in the notebook and\n> adding more won't causes too many problems.\n>\n> From a usability perspective, I do think the main point is is allowing\n> easy uploading.\n>\n> But the secondary point is to have a self contained file.\n>\n>\n> On Wed, Oct 21, 2015 at 12:42 PM, Steven G. Johnson <\n> notifications@github.com> wrote:\n>\n>> We're already using JSON as a container to store binary data. I just want\n>> to be able to paste a few kB more in when I need a simple figure, without\n>> losing the self-contained nature of the file.\n>>\n>> @minrk <https://github.com/minrk>, I agree that the tradeoffs are even\n>> worse for code-generated images, but I wanted to point out that the\n>> arguments that you and @juhasch <https://github.com/juhasch> are making\n>> would largely apply to them as well. That should give you pause — we have\n>> an existence proof that these arguments can be outweighed by the\n>> convenience of having a self-contained file.\n>>\n>> —\n>> Reply to this email directly or view it on GitHub\n>> <https://github.com/jupyter/notebook/pull/621#issuecomment-149956443>.\n>>\n>\n>\n>\n> --\n> Brian E. Granger\n> Associate Professor of Physics and Data Science\n> Cal Poly State University, San Luis Obispo\n> @ellisonbg on Twitter and GitHub\n> bgranger@calpoly.edu and ellisonbg@gmail.com\n>\n\n\n\n-- \nBrian E. Granger\nAssociate Professor of Physics and Data Science\nCal Poly State University, San Luis Obispo\n@ellisonbg on Twitter and GitHub\nbgranger@calpoly.edu and ellisonbg@gmail.com\n"}}