👀 Reading hidden code
using HypertextLiteral
: @htl, @htl_str
<script>
alert("Hello from preamble!")
</script>
👀 Reading hidden code
<marquee>asdfasdf</marquee>
👀 Reading hidden code
Section 1.1
The Newton Method
Lecture Video
ct_header = @htl("""
<div style="
min-height: 500px;
width: 100%;
background: #282936;
color: #fff;
padding-top: 68px;
">
<div style="
max-width: 800px;
margin: 0 auto;
">
<span style="
font-family: Vollkorn, serif;
font-weight: 700;
font-feature-settings: 'lnum', 'pnum';
"> <p style="
font-size: 1.5rem;
opacity: .8;
"><em>Section 1.1</em></p>
<p style="text-align: center; font-size: 2rem;">
<em> The Newton Method </em>
</p>
<p style="
font-size: 1.5rem;
text-align: center;
opacity: .8;
"><em>Lecture Video</em></p>
<div style="display: flex; justify-content: center;">
<div notthestyle="position: relative; right: 0; top: 0; z-index: 300;">
<iframe src="https://www.youtube.com/embed/Wjcx9sNSLP8" width=400 height=250 frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
</div>
</div>
</div>
<style>
body {
overflow-x: hidden;
}
</style>
""")
👀 Reading hidden code
<div style="
min-height: 500px;
width: 100%;
background: #282936;
color: #fff;
padding-top: 68px;
">
<div style="
max-width: 800px;
margin: 0 auto;
">
<span style="
font-family: Vollkorn, serif;
font-weight: 700;
font-feature-settings: 'lnum', 'pnum';
"> <p style="
font-size: 1.5rem;
opacity: .8;
"><em>Section 1.1</em></p>
<p style="text-align: center; font-size: 2rem;">
<em> The Newton Method </em>
</p>
<p style="
font-size: 1.5rem;
text-align: center;
opacity: .8;
"><em>Lecture Video</em></p>
<div style="display: flex; justify-content: center;">
<div notthestyle="position: relative; right: 0; top: 0; z-index: 300;">
<iframe src="https://www.youtube.com/embed/Wjcx9sNSLP8" width=400 height=250 frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
</div>
</div>
</div>
<style>
body {
overflow-x: hidden;
}
</style>
set_preamble_html(ct_header)
👀 Reading hidden code
set_preamble_html (generic function with 1 method)
set_preamble_html(data) = @htl("""
<script>
const data = $(try
repr(MIME"text/html"(), data)
catch e
string(data)
end)
let u = new URL(window.location.href)
u.searchParams.set("preamble_html", data)
let button = html`<input type=button value="See preview!">`
button.onclick = async () => {
window.location.href = u.href
}
let code = html`<code></code>`
code.innerText = data
return html`
<pre>\${code}</pre>
\${button}
`
</script>
""")
👀 Reading hidden code