-
Notifications
You must be signed in to change notification settings - Fork 4
/
make.jl
31 lines (28 loc) · 943 Bytes
/
make.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Cobweb
using Cobweb: h, Page, CSS
using Markdown
page = h.html(
h.head(
h.meta(charset="UTF-8"),
h.meta(name="viewport", content="width=device-width, initial-scale=1.0"),
h.title("Cobweb.jl Docs"),
CSS("""
html {
font-family: Arial;
}
""")
),
h.body(
h.h1("This page was built with ", h.code("Cobweb.jl"), "."),
md"""
Take a look at [`docs/make.jl`](https://github.com/joshday/Cobweb.jl/blob/main/docs/make.jl) inside the [`Cobweb.jl` repo](https://github.com/joshday/Cobweb.jl).
""",
h.button("Click Me for an alert!", onclick="buttonClicked()"),
Cobweb.Javascript("const buttonClicked = () => alert('This button was clicked!')"),
)
)
index_html = touch(joinpath(mkpath(joinpath(@__DIR__, "build")), "index.html"))
open(index_html, "w") do io
println(io, Cobweb.Doctype())
write(io, page)
end