Created
September 29, 2023 15:17
-
-
Save j-fu/48f820df9723efb993b491b112fb470b to your computer and use it in GitHub Desktop.
htl_mwe2.jl
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.19.29 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ e052cc91-ca85-492d-95e2-6b0c707ac859 | |
begin | |
using Pkg | |
Pkg.activate(mktempdir()) | |
Pkg.add(url="https://github.com/JuliaPluto/HypertextLiteral.jl/#36") | |
Pkg.add("AbstractPlutoDingetjes") | |
import HypertextLiteral: @htl | |
import AbstractPlutoDingetjes.Display: published_to_js | |
using AbstractPlutoDingetjes | |
end | |
# ╔═╡ ae4677c4-5d18-11ee-002c-934296bff110 | |
let | |
x = Dict( | |
"data" => rand(Float64, 20), | |
"name" => "juliette", | |
) | |
@htl(""" | |
<script> | |
// we interpolate into JavaScript: | |
const x = $(published_to_js(x)) | |
alert(x.name) | |
</script> | |
""") | |
end | |
# ╔═╡ Cell order: | |
# ╠═e052cc91-ca85-492d-95e2-6b0c707ac859 | |
# ╠═ae4677c4-5d18-11ee-002c-934296bff110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment