1 |
|
2 | (macro !-- (rest...)
|
3 | (str "<!-- " ~rest... " -->"))
|
4 |
|
5 | (macro a (rest...)
|
6 | (_LS.expandTag "a" ~rest...))
|
7 |
|
8 | (macro abbr (rest...)
|
9 | (_LS.expandTag "abbr" ~rest...))
|
10 |
|
11 | (macro address (rest...)
|
12 | (_LS.expandTag "address" ~rest...))
|
13 |
|
14 | (macro area (rest...)
|
15 | (_LS.expandTag "area" ~rest...))
|
16 |
|
17 | (macro article (rest...)
|
18 | (_LS.expandTag "article" ~rest...))
|
19 |
|
20 | (macro aside (rest...)
|
21 | (_LS.expandTag "aside" ~rest...))
|
22 |
|
23 | (macro audio (rest...)
|
24 | (_LS.expandTag "audio" ~rest...))
|
25 |
|
26 | (macro b (rest...)
|
27 | (_LS.expandTag "b" ~rest...))
|
28 |
|
29 | (macro base (rest...)
|
30 | (_LS.expandTag "base" ~rest...))
|
31 |
|
32 | (macro bdi (rest...)
|
33 | (_LS.expandTag "bdi" ~rest...))
|
34 |
|
35 | (macro bdo (rest...)
|
36 | (_LS.expandTag "bdo" ~rest...))
|
37 |
|
38 | (macro blockquote (rest...)
|
39 | (_LS.expandTag "blockquote" ~rest...))
|
40 |
|
41 | (macro body (rest...)
|
42 | (_LS.expandTag "body" ~rest...))
|
43 |
|
44 | (macro br (rest...)
|
45 | (_LS.expandTag "br" ~rest...))
|
46 |
|
47 | (macro button (rest...)
|
48 | (_LS.expandTag "button" ~rest...))
|
49 |
|
50 | (macro canvas (rest...)
|
51 | (_LS.expandTag "canvas" ~rest...))
|
52 |
|
53 | (macro caption (rest...)
|
54 | (_LS.expandTag "caption" ~rest...))
|
55 |
|
56 | (macro cite (rest...)
|
57 | (_LS.expandTag "cite" ~rest...))
|
58 |
|
59 | (macro code (rest...)
|
60 | (_LS.expandTag "code" ~rest...))
|
61 |
|
62 | (macro col (rest...)
|
63 | (_LS.expandTag "col" ~rest...))
|
64 |
|
65 | (macro colgroup (rest...)
|
66 | (_LS.expandTag "colgroup" ~rest...))
|
67 |
|
68 | (macro command (rest...)
|
69 | (_LS.expandTag "command" ~rest...))
|
70 |
|
71 | ;; (macro data (rest...)
|
72 | ;; (_LS.expandTag "data" ~rest...))
|
73 |
|
74 | (macro datalist (rest...)
|
75 | (_LS.expandTag "datalist" ~rest...))
|
76 |
|
77 | (macro dd (rest...)
|
78 | (_LS.expandTag "dd" ~rest...))
|
79 |
|
80 | (macro del (rest...)
|
81 | (_LS.expandTag "del" ~rest...))
|
82 |
|
83 | (macro details (rest...)
|
84 | (_LS.expandTag "details" ~rest...))
|
85 |
|
86 | (macro dfn (rest...)
|
87 | (_LS.expandTag "dfn" ~rest...))
|
88 |
|
89 | (macro div (rest...)
|
90 | (_LS.expandTag "div" ~rest...))
|
91 |
|
92 | (macro dl (rest...)
|
93 | (_LS.expandTag "dl" ~rest...))
|
94 |
|
95 | (macro dt (rest...)
|
96 | (_LS.expandTag "dt" ~rest...))
|
97 |
|
98 | (macro em (rest...)
|
99 | (_LS.expandTag "em" ~rest...))
|
100 |
|
101 | (macro embed (rest...)
|
102 | (_LS.expandTag "embed" ~rest...))
|
103 |
|
104 | ;;(macro eventsource (rest...)
|
105 | ;; (_LS.expandTag "eventsource" ~rest...))
|
106 |
|
107 | (macro fieldset (rest...)
|
108 | (_LS.expandTag "filedset" ~rest...))
|
109 |
|
110 | (macro figcaption (rest...)
|
111 | (_LS.expandTag "figcaption" ~rest...))
|
112 |
|
113 | (macro figure (rest...)
|
114 | (_LS.expandTag "figure" ~rest...))
|
115 |
|
116 | (macro footer (rest...)
|
117 | (_LS.expandTag "footer" ~rest...))
|
118 |
|
119 | (macro form (rest...)
|
120 | (_LS.expandTag "form" ~rest...))
|
121 |
|
122 | (macro h1 (rest...)
|
123 | (_LS.expandTag "h1" ~rest...))
|
124 |
|
125 | (macro h2 (rest...)
|
126 | (_LS.expandTag "h2" ~rest...))
|
127 |
|
128 | (macro h3 (rest...)
|
129 | (_LS.expandTag "h3" ~rest...))
|
130 |
|
131 | (macro h4 (rest...)
|
132 | (_LS.expandTag "h4" ~rest...))
|
133 |
|
134 | (macro h5 (rest...)
|
135 | (_LS.expandTag "h5" ~rest...))
|
136 |
|
137 | (macro h6 (rest...)
|
138 | (_LS.expandTag "h6" ~rest...))
|
139 |
|
140 | (macro head (rest...)
|
141 | (_LS.expandTag "head" ~rest...))
|
142 |
|
143 | (macro header (rest...)
|
144 | (_LS.expandTag "header" ~rest...))
|
145 |
|
146 | (macro hgroup (rest...)
|
147 | (_LS.expandTag "hgroup" ~rest...))
|
148 |
|
149 | (macro hr (rest...)
|
150 | (_LS.expandTag "hr" ~rest...))
|
151 |
|
152 | (macro html (rest...)
|
153 | (+ "<!DOCTYPE html>\n" (_LS.expandTag "html" ~rest...)))
|
154 |
|
155 | (macro i (rest...)
|
156 | (_LS.expandTag "i" ~rest...))
|
157 |
|
158 | (macro iframe (rest...)
|
159 | (_LS.expandTag "iframe" ~rest...))
|
160 |
|
161 | (macro img (rest...)
|
162 | (_LS.expandTag "img" ~rest...))
|
163 |
|
164 | (macro input (rest...)
|
165 | (_LS.expandTag "input" ~rest...))
|
166 |
|
167 | (macro ins (rest...)
|
168 | (_LS.expandTag "ins" ~rest...))
|
169 |
|
170 | (macro kbd (rest...)
|
171 | (_LS.expandTag "kbd" ~rest...))
|
172 |
|
173 | (macro keygen (rest...)
|
174 | (_LS.expandTag "keygen" ~rest...))
|
175 |
|
176 | (macro label (rest...)
|
177 | (_LS.expandTag "label" ~rest...))
|
178 |
|
179 | (macro legend (rest...)
|
180 | (_LS.expandTag "legend" ~rest...))
|
181 |
|
182 | (macro li (rest...)
|
183 | (_LS.expandTag "li" ~rest...))
|
184 |
|
185 | (macro link (rest...)
|
186 | (_LS.expandTag "link" ~rest...))
|
187 |
|
188 | (macro map (rest...)
|
189 | (_LS.expandTag "map" ~rest...))
|
190 |
|
191 | (macro mark (rest...)
|
192 | (_LS.expandTag "mark" ~rest...))
|
193 |
|
194 | (macro menu (rest...)
|
195 | (_LS.expandTag "menu" ~rest...))
|
196 |
|
197 | (macro meta (rest...)
|
198 | (_LS.expandTag "meta" ~rest...))
|
199 |
|
200 | (macro meter (rest...)
|
201 | (_LS.expandTag "meter" ~rest...))
|
202 |
|
203 | (macro nav (rest...)
|
204 | (_LS.expandTag "nav" ~rest...))
|
205 |
|
206 | (macro noscript (rest...)
|
207 | (_LS.expandTag "noscript" ~rest...))
|
208 |
|
209 | (macro object (rest...)
|
210 | (_LS.expandTag "object" ~rest...))
|
211 |
|
212 | (macro ol (rest...)
|
213 | (_LS.expandTag "ol" ~rest...))
|
214 |
|
215 | (macro optgroup (rest...)
|
216 | (_LS.expandTag "optgroup" ~rest...))
|
217 |
|
218 | (macro option (rest...)
|
219 | (_LS.expandTag "option" ~rest...))
|
220 |
|
221 | (macro output (rest...)
|
222 | (_LS.expandTag "output" ~rest...))
|
223 |
|
224 | (macro p (rest...)
|
225 | (_LS.expandTag "p" ~rest...))
|
226 |
|
227 | (macro param (rest...)
|
228 | (_LS.expandTag "param" ~rest...))
|
229 |
|
230 | (macro pre (rest...)
|
231 | (_LS.expandTag "pre" ~rest...))
|
232 |
|
233 | (macro progress (rest...)
|
234 | (_LS.expandTag "progress" ~rest...))
|
235 |
|
236 | (macro q (rest...)
|
237 | (_LS.expandTag "q" ~rest...))
|
238 |
|
239 | (macro rt (rest...)
|
240 | (_LS.expandTag "rt" ~rest...))
|
241 |
|
242 | (macro rp (rest...)
|
243 | (_LS.expandTag "rp" ~rest...))
|
244 |
|
245 | (macro ruby (rest...)
|
246 | (_LS.expandTag "ruby" ~rest...))
|
247 |
|
248 | (macro s (rest...)
|
249 | (_LS.expandTag "s" ~rest...))
|
250 |
|
251 | (macro samp (rest...)
|
252 | (_LS.expandTag "samp" ~rest...))
|
253 |
|
254 | (macro script (rest...)
|
255 | (_LS.expandTag "script" ~rest...))
|
256 |
|
257 | (macro section (rest...)
|
258 | (_LS.expandTag "section" ~rest...))
|
259 |
|
260 | (macro select (rest...)
|
261 | (_LS.expandTag "select" ~rest...))
|
262 |
|
263 | (macro small (rest...)
|
264 | (_LS.expandTag "small" ~rest...))
|
265 |
|
266 | (macro source (rest...)
|
267 | (_LS.expandTag "source" ~rest...))
|
268 |
|
269 | (macro span (rest...)
|
270 | (_LS.expandTag "span" ~rest...))
|
271 |
|
272 | (macro strong (rest...)
|
273 | (_LS.expandTag "strong" ~rest...))
|
274 |
|
275 | (macro style (rest...)
|
276 | (_LS.expandTag "style" ~rest...))
|
277 |
|
278 | (macro sub (rest...)
|
279 | (_LS.expandTag "sub" ~rest...))
|
280 |
|
281 | (macro summary (rest...)
|
282 | (_LS.expandTag "summary" ~rest...))
|
283 |
|
284 | (macro sup (rest...)
|
285 | (_LS.expandTag "sup" ~rest...))
|
286 |
|
287 | (macro table (rest...)
|
288 | (_LS.expandTag "table" ~rest...))
|
289 |
|
290 | (macro tbody (rest...)
|
291 | (_LS.expandTag "tbody" ~rest...))
|
292 |
|
293 | (macro td (rest...)
|
294 | (_LS.expandTag "td" ~rest...))
|
295 |
|
296 | (macro textarea (rest...)
|
297 | (_LS.expandTag "textarea" ~rest...))
|
298 |
|
299 | (macro tfoot (rest...)
|
300 | (_LS.expandTag "tfoot" ~rest...))
|
301 |
|
302 | (macro th (rest...)
|
303 | (_LS.expandTag "th" ~rest...))
|
304 |
|
305 | (macro thead (rest...)
|
306 | (_LS.expandTag "thead" ~rest...))
|
307 |
|
308 | (macro time (rest...)
|
309 | (_LS.expandTag "time" ~rest...))
|
310 |
|
311 | (macro title (rest...)
|
312 | (_LS.expandTag "title" ~rest...))
|
313 |
|
314 | (macro tr (rest...)
|
315 | (_LS.expandTag "tr" ~rest...))
|
316 |
|
317 | (macro track (rest...)
|
318 | (_LS.expandTag "track" ~rest...))
|
319 |
|
320 | (macro u (rest...)
|
321 | (_LS.expandTag "u" ~rest...))
|
322 |
|
323 | (macro ul (rest...)
|
324 | (_LS.expandTag "ul" ~rest...))
|
325 |
|
326 | ;; 'var' will trash javascript var so use _var instead
|
327 | (macro _var (rest...)
|
328 | (_LS.expandTag "var" ~rest...))
|
329 |
|
330 | (macro video (rest...)
|
331 | (_LS.expandTag "video" ~rest...))
|
332 |
|
333 | (macro wbr (rest...)
|
334 | (_LS.expandTag "wbr" ~rest...))
|
335 |
|
336 | (var _LS (|| _LS {}))
|
337 |
|
338 | (set _LS.expandTag
|
339 | (function (name attr)
|
340 | (var args (Array.prototype.slice.call arguments))
|
341 | (var ret "")
|
342 | (if (string? name)
|
343 | (do
|
344 | (set ret (+ "<" name))
|
345 | (args.shift)
|
346 | (if (object? attr)
|
347 | (do
|
348 | (set ret (+ ret (template-repeat-key attr " " key "=" "\"" value "\"")))
|
349 | (args.shift)))
|
350 | (if (|| (> args.length 0) (= name "script"))
|
351 | (set ret (str ret ">" (args.join "") "</" name ">"))
|
352 | (set ret (+ ret "/>")))
|
353 | ret)
|
354 | "")))
|