Created
October 23, 2020 16:27
-
-
Save fonsp/5caafdb78cbbee3f2b5f7c0f4c9fb076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### A Pluto.jl notebook ### | |
# v0.12.4 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ c86e0d52-154b-11eb-3cab-056d5919b2a3 | |
begin | |
import Pkg | |
Pkg.add("Hyperscript") | |
using Hyperscript | |
end | |
# ╔═╡ f5a92298-1549-11eb-2d5c-9f81a0a2b186 | |
svg_data = read(download("https://raw.githubusercontent.com/gist/fonsp/9a36c183e2cad7c8fc30290ec95eb104/raw/ca3a38a61f95cd58d79d00b663a3c114d21e284e/cute.svg"), String) | |
# ╔═╡ 84ff8cd8-154b-11eb-05e3-9b8dd6cf06db | |
import Base64 | |
# ╔═╡ e9332caa-154b-11eb-2689-433ba8b5dede | |
function svg(data, width) | |
src = join([ | |
"data:", | |
"image/svg+xml", | |
";base64,", | |
Base64.base64encode(data) | |
]) | |
m("img", src=src, width=width) | |
end | |
# ╔═╡ 19f94374-154c-11eb-37c5-77b3f995687d | |
svg(svg_data, 100) | |
# ╔═╡ Cell order: | |
# ╠═f5a92298-1549-11eb-2d5c-9f81a0a2b186 | |
# ╠═84ff8cd8-154b-11eb-05e3-9b8dd6cf06db | |
# ╠═c86e0d52-154b-11eb-3cab-056d5919b2a3 | |
# ╠═19f94374-154c-11eb-37c5-77b3f995687d | |
# ╠═e9332caa-154b-11eb-2689-433ba8b5dede |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment