File: html-structs.rkt

package info (click to toggle)
racket 7.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 125,432 kB
  • sloc: ansic: 258,980; pascal: 59,975; sh: 33,650; asm: 13,558; lisp: 7,124; makefile: 3,329; cpp: 2,889; exp: 499; python: 274; xml: 11
file content (365 lines) | stat: -rw-r--r-- 13,652 bytes parent folder | download | duplicates (11)
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
#lang racket/base
(require racket/contract
         xml)

(define-struct html-element (attributes))
(define-struct (html-full html-element) (content))
(define-struct (mzscheme html-full) ())
(define-struct (html html-full) ())
(define-struct (div html-full) ())
(define-struct (center html-full) ())
(define-struct (blockquote html-full) ())
(define-struct (ins html-full) ())
(define-struct (del html-full) ())
(define-struct (dd html-full) ())
(define-struct (li html-full) ())
(define-struct (th html-full) ())
(define-struct (td html-full) ())
(define-struct (iframe html-full) ())
(define-struct (noframes html-full) ())
(define-struct (noscript html-full) ())
(define-struct (style html-full) ())
(define-struct (script html-full) ())
(define-struct (option html-full) ())
(define-struct (textarea html-full) ())
(define-struct (title html-full) ())
(define-struct (head html-full) ())
(define-struct (tr html-full) ())
(define-struct (colgroup html-full) ())
(define-struct (thead html-full) ())
(define-struct (tfoot html-full) ())
(define-struct (tbody html-full) ())
(define-struct (tt html-full) ())
(define-struct (i html-full) ())
(define-struct (b html-full) ())
(define-struct (u html-full) ())
(define-struct (s html-full) ())
(define-struct (strike html-full) ())
(define-struct (big html-full) ())
(define-struct (small html-full) ())
(define-struct (em html-full) ())
(define-struct (strong html-full) ())
(define-struct (dfn html-full) ())
(define-struct (code html-full) ())
(define-struct (samp html-full) ())
(define-struct (kbd html-full) ())
(define-struct (var html-full) ())
(define-struct (cite html-full) ())
(define-struct (abbr html-full) ())
(define-struct (acronym html-full) ())
(define-struct (sub html-full) ())
(define-struct (sup html-full) ())
(define-struct (span html-full) ())
(define-struct (bdo html-full) ())
(define-struct (font html-full) ())
(define-struct (p html-full) ())
(define-struct (h1 html-full) ())
(define-struct (h2 html-full) ())
(define-struct (h3 html-full) ())
(define-struct (h4 html-full) ())
(define-struct (h5 html-full) ())
(define-struct (h6 html-full) ())
(define-struct (q html-full) ())
(define-struct (dt html-full) ())
(define-struct (legend html-full) ())
(define-struct (caption html-full) ())
(define-struct (table html-full) ())
(define-struct (button html-full) ())
(define-struct (fieldset html-full) ())
(define-struct (optgroup html-full) ())
(define-struct (select html-full) ())
(define-struct (label html-full) ())
(define-struct (form html-full) ())
(define-struct (ol html-full) ())
(define-struct (ul html-full) ())
(define-struct (dir html-full) ())
(define-struct (menu html-full) ())
(define-struct (dl html-full) ())
(define-struct (pre html-full) ())
(define-struct (object html-full) ())
(define-struct (applet html-full) ())
(define-struct (-map html-full) ())
(define-struct (a html-full) ())
(define-struct (address html-full) ())
(define-struct (body html-full) ())
(define-struct (basefont html-element) ())
(define-struct (br html-element) ())
(define-struct (area html-element) ())
(define-struct (alink html-element) ())
(define-struct (img html-element) ())
(define-struct (param html-element) ())
(define-struct (hr html-element) ())
(define-struct (input html-element) ())
(define-struct (col html-element) ())
(define-struct (isindex html-element) ())
(define-struct (base html-element) ())
(define-struct (meta html-element) ())

;; Html-content = Html-element | Pc-data | Entity   
(define html-content/c
  (or/c html-element? pcdata? entity?))

(provide/contract
 [html-content/c contract?]
 [struct html-element ([attributes (listof attribute?)])]
 [struct (html-full html-element)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
  [struct (mzscheme html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (html html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (div html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (center html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (blockquote html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (ins html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (del html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (dd html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (li html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (th html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (td html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (iframe html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (noframes html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (noscript html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (style html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (script html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (option html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (textarea html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (title html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (head html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (tr html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (colgroup html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (thead html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (tfoot html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (tbody html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (tt html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (i html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (b html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (u html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (s html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (strike html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (big html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (small html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (em html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (strong html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (dfn html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (code html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (samp html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (kbd html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (var html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (cite html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (abbr html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (acronym html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (sub html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (sup html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (span html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (bdo html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (font html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (p html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (h1 html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (h2 html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (h3 html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (h4 html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (h5 html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (h6 html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (q html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (dt html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (legend html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (caption html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (table html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (button html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (fieldset html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (optgroup html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (select html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (label html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (form html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (ol html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (ul html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (dir html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (menu html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (dl html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (pre html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (object html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (applet html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (-map html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (a html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (address html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (body html-full)
         ([attributes (listof attribute?)]
          [content (listof html-content/c)])]
 [struct (basefont html-element)
         ([attributes (listof attribute?)])]
 [struct (br html-element)
         ([attributes (listof attribute?)])]
 [struct (area html-element)
         ([attributes (listof attribute?)])]
 [struct (alink html-element)
         ([attributes (listof attribute?)])]
 [struct (img html-element)
         ([attributes (listof attribute?)])]
 [struct (param html-element)
         ([attributes (listof attribute?)])]
 [struct (hr html-element)
         ([attributes (listof attribute?)])]
 [struct (input html-element)
         ([attributes (listof attribute?)])]
 [struct (col html-element)
         ([attributes (listof attribute?)])]
 [struct (isindex html-element)
         ([attributes (listof attribute?)])]
 [struct (base html-element)
         ([attributes (listof attribute?)])]
 [struct (meta html-element)
         ([attributes (listof attribute?)])])