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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃専 Support data URLs in open_url #1670

Merged
merged 3 commits into from
Nov 16, 2021
Merged

馃専 Support data URLs in open_url #1670

merged 3 commits into from
Nov 16, 2021

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Nov 16, 2021

This will allow us to create a link like:

https://binder.plutojl.org/v0.17.1/open?url=data%3Aapplication%2Foctet-stream%3Bbase64%2CIyMjIEEgUGx1dG8uamwgbm90ZWJvb2sgIyMjCiMgdjAuMTQuMAoKdXNpbmcgTWFya2Rvd24KdXNpbmcgSW50ZXJhY3RpdmVVdGlscwoKIyDilZTilZDilaEgYjJkNzg2ZWMtN2Y3My0xMWVhLTFhMGMtZjM4ZDdiNmJiYzFlCm1kIiIiCiMgVGhlIEJhc2VsIHByb2JsZW0KCl9MZW9uYXJkIEV1bGVyXyBwcm92ZWQgaW4gMTc0MSB0aGF0IHRoZSBzZXJpZXMKCmBgYG1hdGgKXGZyYWN7MX17MX0gKyBcZnJhY3sxfXs0fSArIFxmcmFjezF9ezl9ICsgXGNkb3RzCmBgYAoKY29udmVyZ2VzIHRvCgpgYGBtYXRoClxmcmFje1xwaV4yfXs2fS4KYGBgCiIiIgoKIyDilZTilZDilaEgYjJkNzkzMzAtN2Y3My0xMWVhLTBkMWMtYTlhYWQxZWZhYWUxCm4gPSAxOjEwMDAwMAoKIyDilZTilZDilaEgYjJkNzkzNzYtN2Y3My0xMWVhLTJkY2UtY2I5YzQ0OWVlY2U2CnNlcSA9IG4gLl4gLTIKCiMg4pWU4pWQ4pWhIGIyZDc5MmMyLTdmNzMtMTFlYS0wYzY1LWE1MDQyNzAxZTlmMwpzcXJ0KHN1bShzZXEpICogNi4wKQoKIyDilZTilZDilaEgQ2VsbCBvcmRlcjoKIyDilZ%2FilIBiMmQ3ODZlYy03ZjczLTExZWEtMWEwYy1mMzhkN2I2YmJjMWUKIyDilaDilZBiMmQ3OTJjMi03ZjczLTExZWEtMGM2NS1hNTA0MjcwMWU5ZjMKIyDilaDilZBiMmQ3OTMzMC03ZjczLTExZWEtMGQxYy1hOWFhZDFlZmFhZTEKIyDilaDilZBiMmQ3OTM3Ni03ZjczLTExZWEtMmRjZS1jYjljNDQ5ZWVjZTYK

which will launch pluto on binder and directly run the notebook embedded in the URL (example data taken from this file). This means that we can add a "Run inside Pluto" link to code snippets like this one.

Since Base.download does not support data URLs, we have to manually add support.

@github-actions
Copy link
Contributor

Try this Pull Request!

Open Julia, and type:

julia> ]
(@v1.6) pkg> activate --temp
(@v1.6) pkg> add https://github.com/fonsp/Pluto.jl#download-data-url
(@v1.6) pkg> # press backspace/delete to go back
julia> using Pluto

@fonsp fonsp changed the title Support data URLs in open_url 馃専 Support data URLs in open_url Nov 16, 2021
@fonsp fonsp merged commit fecd831 into main Nov 16, 2021
@fonsp fonsp deleted the download-data-url branch November 16, 2021 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant