Skip to content

Commit

Permalink
simplified rewrite of a bunch of stuff. Remove parsing for now
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Dec 11, 2023
1 parent 3595146 commit 62f0485
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*.Manifest.toml
docs/build
*ipynb*
*.DS_Store
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "0.5.3"

[deps]
DefaultApplication = "3f0dd361-4fe0-5fc6-8523-80b14ec94d85"
EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
18 changes: 8 additions & 10 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@ using Cobweb
using Cobweb: h, Page, CSS
using Markdown

css = Dict(
"html" => Dict(
"font-family" => "Arial"
)
)

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(css),
css"""
html {
font-family: Arial;
}
"""
),
h.body(
h.h1("This page was built with ", h.code("Cobweb.jl"), "."),
Markdown.parse("""
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"))

Cobweb.save(Page(page), index_html)
open(io -> write(io, page), index_html, "w")
Loading

0 comments on commit 62f0485

Please sign in to comment.