Skip to content

Commit ae0bbb7

Browse files
committed
🧹
1 parent deaa052 commit ae0bbb7

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

‎.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
src/nakai/html.gleam linguist-generated
2-
src/nakai/html/attrs.gleam linguist-generated
2+
src/nakai/attr.gleam linguist-generated

‎Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ all: build
88
# `gleam run -m ...` does a full build, but we need to run it again after our codegen
99
# step, or we might end up with the build artifacts being stale, if the new generated
1010
# is different.
11-
build:
12-
@$(GLEAM) run -m nakai_codegen
11+
build: codegen
1312
@$(GLEAM) build
1413
.PHONY: build
1514

16-
docs: build
15+
codegen:
16+
@$(GLEAM) run -m nakai_codegen
17+
.PHONY: codegen
18+
19+
docs: codegen
1720
@$(GLEAM) docs build
1821
.PHONY: docs
1922

@@ -22,11 +25,11 @@ format:
2225
@$(GLEAM) run -m nakai_codegen
2326
.PHONY: format
2427

25-
test: build
28+
test: codegen
2629
@$(GLEAM) test
2730
.PHONY: test
2831

29-
bench: build
32+
bench: codegen
3033
@$(GLEAM) run -m nakai_benchmark
3134
.PHONY: bench
3235

‎codegen/html_prelude.gleam

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub type Node {
1212
/// will be rendered in-place, equivalent to using `html.Fragment(children)`.
1313
/// ## Example
1414
/// ```gleam
15-
/// html.Html([attrs.lang("en-US")], [
15+
/// html.Html([attr.lang("en-US")], [
1616
/// ...
1717
/// ])
1818
/// ```
@@ -35,7 +35,7 @@ pub type Node {
3535
/// will be rendered in-place, equivalent to using `html.Fragment(children)`.
3636
/// ## Example
3737
/// ```gleam
38-
/// html.Body([attrs.class("dark-mode")], [
38+
/// html.Body([attr.class("dark-mode")], [
3939
/// ...
4040
/// ])
4141
/// ```
@@ -74,7 +74,7 @@ pub type Node {
7474
/// ## Example
7575
/// ```gleam
7676
/// // bad example, pls use `html.link`
77-
/// html.LeafElement("link", [attrs.rel("stylesheet"), attrs.href(...)])
77+
/// html.LeafElement("link", [attr.rel("stylesheet"), attr.href(...)])
7878
/// ```
7979
LeafElement(tag: String, attrs: List(Attr))
8080
/// An HTML comment, which will be included in the document.
@@ -122,7 +122,10 @@ pub type Node {
122122
/// any other script, so **do not use any untrusted input**.
123123
/// ## Example
124124
/// ```gleam
125-
/// html.Script("alert('hello, lucy!')")
125+
/// html.Script([], "alert('hello, lucy!')")
126+
/// ```
127+
/// ```gleam
128+
/// html.Script([attr.type_("module"), attr.src(...)], "")
126129
/// ```
127130
Script(attrs: List(Attr), content: String)
128131
/// Renders absolutely nothing. For when you may or may not have something to render,

‎src/nakai/html.gleam

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)