forked from chasefleming/elem-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
elements.go
221 lines (162 loc) · 5.18 KB
/
elements.go
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
package elem
// ========== Document Structure ==========
func Body(props Attrs, children ...Node) *Element {
return NewElement("body", props, children...)
}
func Head(props Attrs, children ...Node) *Element {
return NewElement("head", props, children...)
}
func Html(props Attrs, children ...Node) *Element {
return NewElement("html", props, children...)
}
func Title(props Attrs, children ...Node) *Element {
return NewElement("title", props, children...)
}
// ========== Text Formatting and Structure ==========
func A(props Attrs, children ...Node) *Element {
return NewElement("a", props, children...)
}
func Br(props Attrs) *Element {
return NewElement("br", props)
}
func Blockquote(props Attrs, children ...Node) *Element {
return NewElement("blockquote", props, children...)
}
func Code(props Attrs, children ...Node) *Element {
return NewElement("code", props, children...)
}
func Div(props Attrs, children ...Node) *Element {
return NewElement("div", props, children...)
}
func Em(props Attrs, children ...Node) *Element {
return NewElement("em", props, children...)
}
func H1(props Attrs, children ...Node) *Element {
return NewElement("h1", props, children...)
}
func H2(props Attrs, children ...Node) *Element {
return NewElement("h2", props, children...)
}
func H3(props Attrs, children ...Node) *Element {
return NewElement("h3", props, children...)
}
func Hr(props Attrs) *Element {
return NewElement("hr", props)
}
func I(props Attrs, children ...Node) *Element {
return NewElement("i", props, children...)
}
func P(props Attrs, children ...Node) *Element {
return NewElement("p", props, children...)
}
func Pre(props Attrs, children ...Node) *Element {
return NewElement("pre", props, children...)
}
func Span(props Attrs, children ...Node) *Element {
return NewElement("span", props, children...)
}
func Strong(props Attrs, children ...Node) *Element {
return NewElement("strong", props, children...)
}
func Text(content string) TextNode {
return TextNode(content)
}
// ========== Lists ==========
func Li(props Attrs, children ...Node) *Element {
return NewElement("li", props, children...)
}
func Ul(props Attrs, children ...Node) *Element {
return NewElement("ul", props, children...)
}
func Ol(props Attrs, children ...Node) *Element {
return NewElement("ol", props, children...)
}
func Dl(props Attrs, children ...Node) *Element {
return NewElement("dl", props, children...)
}
func Dt(props Attrs, children ...Node) *Element {
return NewElement("dt", props, children...)
}
func Dd(props Attrs, children ...Node) *Element {
return NewElement("dd", props, children...)
}
// ========== Forms ==========
func Button(props Attrs, children ...Node) *Element {
return NewElement("button", props, children...)
}
func Form(attrs Attrs, children ...Node) *Element {
return NewElement("form", attrs, children...)
}
func Input(attrs Attrs) *Element {
return NewElement("input", attrs)
}
func Label(attrs Attrs, children ...Node) *Element {
return NewElement("label", attrs, children...)
}
func Option(attrs Attrs, content TextNode) *Element {
return NewElement("option", attrs, content)
}
func Select(attrs Attrs, children ...Node) *Element {
return NewElement("select", attrs, children...)
}
func Textarea(attrs Attrs, content TextNode) *Element {
return NewElement("textarea", attrs, content)
}
// ========== Hyperlinks and Multimedia ==========
func Img(props Attrs) *Element {
return NewElement("img", props)
}
// ========== Meta Elements ==========
func Link(props Attrs) *Element {
return NewElement("link", props)
}
func Meta(props Attrs) *Element {
return NewElement("meta", props)
}
func Script(props Attrs, children ...Node) *Element {
return NewElement("script", props, children...)
}
// ========== Semantic Elements ==========
func Article(props Attrs, children ...Node) *Element {
return NewElement("article", props, children...)
}
func Aside(props Attrs, children ...Node) *Element {
return NewElement("aside", props, children...)
}
func Footer(props Attrs, children ...Node) *Element {
return NewElement("footer", props, children...)
}
func Header(props Attrs, children ...Node) *Element {
return NewElement("header", props, children...)
}
func Main(props Attrs, children ...Node) *Element {
return NewElement("main", props, children...)
}
func Nav(props Attrs, children ...Node) *Element {
return NewElement("nav", props, children...)
}
func Section(props Attrs, children ...Node) *Element {
return NewElement("section", props, children...)
}
// ========== Tables ==========
func Table(props Attrs, children ...Node) *Element {
return NewElement("table", props, children...)
}
func THead(props Attrs, children ...Node) *Element {
return NewElement("thead", props, children...)
}
func TBody(props Attrs, children ...Node) *Element {
return NewElement("tbody", props, children...)
}
func TFoot(props Attrs, children ...Node) *Element {
return NewElement("tfoot", props, children...)
}
func Tr(props Attrs, children ...Node) *Element {
return NewElement("tr", props, children...)
}
func Th(props Attrs, children ...Node) *Element {
return NewElement("th", props, children...)
}
func Td(props Attrs, children ...Node) *Element {
return NewElement("td", props, children...)
}