alister 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,609 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alister
4
+ module HTML
5
+ class Builder
6
+ # @!method html(value = nil, **args, &block)
7
+ # Creates a <html> element and puts it to {#elements}
8
+ # @param value [String] The value of the element
9
+ # @param args [Hash] The attributes of the element
10
+ # @return [void]
11
+ # @yield Create child elements of <html>
12
+
13
+ # @!method body(value = nil, **args, &block)
14
+ # Creates a <body> element and puts it to {#elements}
15
+ # @param value [String] The value of the element
16
+ # @param args [Hash] The attributes of the element
17
+ # @return [void]
18
+ # @yield Create child elements of <body>
19
+
20
+ # @!method div(value = nil, **args, &block)
21
+ # Creates a <div> element and puts it to {#elements}
22
+ # @param value [String] The value of the element
23
+ # @param args [Hash] The attributes of the element
24
+ # @return [void]
25
+ # @yield Create child elements of <div>
26
+
27
+ # @!method span(value = nil, **args, &block)
28
+ # Creates a <span> element and puts it to {#elements}
29
+ # @param value [String] The value of the element
30
+ # @param args [Hash] The attributes of the element
31
+ # @return [void]
32
+ # @yield Create child elements of <span>
33
+
34
+ # @!method applet(value = nil, **args, &block)
35
+ # Creates a <applet> element and puts it to {#elements}
36
+ # @param value [String] The value of the element
37
+ # @param args [Hash] The attributes of the element
38
+ # @return [void]
39
+ # @yield Create child elements of <applet>
40
+
41
+ # @!method object(value = nil, **args, &block)
42
+ # Creates a <object> element and puts it to {#elements}
43
+ # @param value [String] The value of the element
44
+ # @param args [Hash] The attributes of the element
45
+ # @return [void]
46
+ # @yield Create child elements of <object>
47
+
48
+ # @!method iframe(value = nil, **args, &block)
49
+ # Creates a <iframe> element and puts it to {#elements}
50
+ # @param value [String] The value of the element
51
+ # @param args [Hash] The attributes of the element
52
+ # @return [void]
53
+ # @yield Create child elements of <iframe>
54
+
55
+ # @!method h1(value = nil, **args, &block)
56
+ # Creates a <h1> element and puts it to {#elements}
57
+ # @param value [String] The value of the element
58
+ # @param args [Hash] The attributes of the element
59
+ # @return [void]
60
+ # @yield Create child elements of <h1>
61
+
62
+ # @!method h2(value = nil, **args, &block)
63
+ # Creates a <h2> element and puts it to {#elements}
64
+ # @param value [String] The value of the element
65
+ # @param args [Hash] The attributes of the element
66
+ # @return [void]
67
+ # @yield Create child elements of <h2>
68
+
69
+ # @!method h3(value = nil, **args, &block)
70
+ # Creates a <h3> element and puts it to {#elements}
71
+ # @param value [String] The value of the element
72
+ # @param args [Hash] The attributes of the element
73
+ # @return [void]
74
+ # @yield Create child elements of <h3>
75
+
76
+ # @!method h4(value = nil, **args, &block)
77
+ # Creates a <h4> element and puts it to {#elements}
78
+ # @param value [String] The value of the element
79
+ # @param args [Hash] The attributes of the element
80
+ # @return [void]
81
+ # @yield Create child elements of <h4>
82
+
83
+ # @!method h5(value = nil, **args, &block)
84
+ # Creates a <h5> element and puts it to {#elements}
85
+ # @param value [String] The value of the element
86
+ # @param args [Hash] The attributes of the element
87
+ # @return [void]
88
+ # @yield Create child elements of <h5>
89
+
90
+ # @!method h6(value = nil, **args, &block)
91
+ # Creates a <h6> element and puts it to {#elements}
92
+ # @param value [String] The value of the element
93
+ # @param args [Hash] The attributes of the element
94
+ # @return [void]
95
+ # @yield Create child elements of <h6>
96
+
97
+ # @!method para(value = nil, **args, &block)
98
+ # Creates a <p> element and puts it to {#elements}
99
+ # @param value [String] The value of the element
100
+ # @param args [Hash] The attributes of the element
101
+ # @return [void]
102
+ # @yield Create child elements of <p>
103
+
104
+ # @!method blockquote(value = nil, **args, &block)
105
+ # Creates a <blockquote> element and puts it to {#elements}
106
+ # @param value [String] The value of the element
107
+ # @param args [Hash] The attributes of the element
108
+ # @return [void]
109
+ # @yield Create child elements of <blockquote>
110
+
111
+ # @!method pre(value = nil, **args, &block)
112
+ # Creates a <pre> element and puts it to {#elements}
113
+ # @param value [String] The value of the element
114
+ # @param args [Hash] The attributes of the element
115
+ # @return [void]
116
+ # @yield Create child elements of <pre>
117
+
118
+ # @!method a(value = nil, **args, &block)
119
+ # Creates a <a> element and puts it to {#elements}
120
+ # @param value [String] The value of the element
121
+ # @param args [Hash] The attributes of the element
122
+ # @return [void]
123
+ # @yield Create child elements of <a>
124
+
125
+ # @!method abbr(value = nil, **args, &block)
126
+ # Creates a <abbr> element and puts it to {#elements}
127
+ # @param value [String] The value of the element
128
+ # @param args [Hash] The attributes of the element
129
+ # @return [void]
130
+ # @yield Create child elements of <abbr>
131
+
132
+ # @!method acronym(value = nil, **args, &block)
133
+ # Creates a <acronym> element and puts it to {#elements}
134
+ # @param value [String] The value of the element
135
+ # @param args [Hash] The attributes of the element
136
+ # @return [void]
137
+ # @yield Create child elements of <acronym>
138
+
139
+ # @!method address(value = nil, **args, &block)
140
+ # Creates a <address> element and puts it to {#elements}
141
+ # @param value [String] The value of the element
142
+ # @param args [Hash] The attributes of the element
143
+ # @return [void]
144
+ # @yield Create child elements of <address>
145
+
146
+ # @!method big(value = nil, **args, &block)
147
+ # Creates a <big> element and puts it to {#elements}
148
+ # @param value [String] The value of the element
149
+ # @param args [Hash] The attributes of the element
150
+ # @return [void]
151
+ # @yield Create child elements of <big>
152
+
153
+ # @!method cite(value = nil, **args, &block)
154
+ # Creates a <cite> element and puts it to {#elements}
155
+ # @param value [String] The value of the element
156
+ # @param args [Hash] The attributes of the element
157
+ # @return [void]
158
+ # @yield Create child elements of <cite>
159
+
160
+ # @!method code(value = nil, **args, &block)
161
+ # Creates a <code> element and puts it to {#elements}
162
+ # @param value [String] The value of the element
163
+ # @param args [Hash] The attributes of the element
164
+ # @return [void]
165
+ # @yield Create child elements of <code>
166
+
167
+ # @!method del(value = nil, **args, &block)
168
+ # Creates a <del> element and puts it to {#elements}
169
+ # @param value [String] The value of the element
170
+ # @param args [Hash] The attributes of the element
171
+ # @return [void]
172
+ # @yield Create child elements of <del>
173
+
174
+ # @!method dfn(value = nil, **args, &block)
175
+ # Creates a <dfn> element and puts it to {#elements}
176
+ # @param value [String] The value of the element
177
+ # @param args [Hash] The attributes of the element
178
+ # @return [void]
179
+ # @yield Create child elements of <dfn>
180
+
181
+ # @!method em(value = nil, **args, &block)
182
+ # Creates a <em> element and puts it to {#elements}
183
+ # @param value [String] The value of the element
184
+ # @param args [Hash] The attributes of the element
185
+ # @return [void]
186
+ # @yield Create child elements of <em>
187
+
188
+ # @!method img(value = nil, **args, &block)
189
+ # Creates a <img> element and puts it to {#elements}
190
+ # @param value [String] The value of the element
191
+ # @param args [Hash] The attributes of the element
192
+ # @return [void]
193
+ # @yield Create child elements of <img>
194
+
195
+ # @!method ins(value = nil, **args, &block)
196
+ # Creates a <ins> element and puts it to {#elements}
197
+ # @param value [String] The value of the element
198
+ # @param args [Hash] The attributes of the element
199
+ # @return [void]
200
+ # @yield Create child elements of <ins>
201
+
202
+ # @!method kbd(value = nil, **args, &block)
203
+ # Creates a <kbd> element and puts it to {#elements}
204
+ # @param value [String] The value of the element
205
+ # @param args [Hash] The attributes of the element
206
+ # @return [void]
207
+ # @yield Create child elements of <kbd>
208
+
209
+ # @!method q(value = nil, **args, &block)
210
+ # Creates a <q> element and puts it to {#elements}
211
+ # @param value [String] The value of the element
212
+ # @param args [Hash] The attributes of the element
213
+ # @return [void]
214
+ # @yield Create child elements of <q>
215
+
216
+ # @!method s(value = nil, **args, &block)
217
+ # Creates a <s> element and puts it to {#elements}
218
+ # @param value [String] The value of the element
219
+ # @param args [Hash] The attributes of the element
220
+ # @return [void]
221
+ # @yield Create child elements of <s>
222
+
223
+ # @!method samp(value = nil, **args, &block)
224
+ # Creates a <samp> element and puts it to {#elements}
225
+ # @param value [String] The value of the element
226
+ # @param args [Hash] The attributes of the element
227
+ # @return [void]
228
+ # @yield Create child elements of <samp>
229
+
230
+ # @!method small(value = nil, **args, &block)
231
+ # Creates a <small> element and puts it to {#elements}
232
+ # @param value [String] The value of the element
233
+ # @param args [Hash] The attributes of the element
234
+ # @return [void]
235
+ # @yield Create child elements of <small>
236
+
237
+ # @!method strike(value = nil, **args, &block)
238
+ # Creates a <strike> element and puts it to {#elements}
239
+ # @param value [String] The value of the element
240
+ # @param args [Hash] The attributes of the element
241
+ # @return [void]
242
+ # @yield Create child elements of <strike>
243
+
244
+ # @!method strong(value = nil, **args, &block)
245
+ # Creates a <strong> element and puts it to {#elements}
246
+ # @param value [String] The value of the element
247
+ # @param args [Hash] The attributes of the element
248
+ # @return [void]
249
+ # @yield Create child elements of <strong>
250
+
251
+ # @!method sub(value = nil, **args, &block)
252
+ # Creates a <sub> element and puts it to {#elements}
253
+ # @param value [String] The value of the element
254
+ # @param args [Hash] The attributes of the element
255
+ # @return [void]
256
+ # @yield Create child elements of <sub>
257
+
258
+ # @!method sup(value = nil, **args, &block)
259
+ # Creates a <sup> element and puts it to {#elements}
260
+ # @param value [String] The value of the element
261
+ # @param args [Hash] The attributes of the element
262
+ # @return [void]
263
+ # @yield Create child elements of <sup>
264
+
265
+ # @!method tt(value = nil, **args, &block)
266
+ # Creates a <tt> element and puts it to {#elements}
267
+ # @param value [String] The value of the element
268
+ # @param args [Hash] The attributes of the element
269
+ # @return [void]
270
+ # @yield Create child elements of <tt>
271
+
272
+ # @!method var(value = nil, **args, &block)
273
+ # Creates a <var> element and puts it to {#elements}
274
+ # @param value [String] The value of the element
275
+ # @param args [Hash] The attributes of the element
276
+ # @return [void]
277
+ # @yield Create child elements of <var>
278
+
279
+ # @!method b(value = nil, **args, &block)
280
+ # Creates a <b> element and puts it to {#elements}
281
+ # @param value [String] The value of the element
282
+ # @param args [Hash] The attributes of the element
283
+ # @return [void]
284
+ # @yield Create child elements of <b>
285
+
286
+ # @!method u(value = nil, **args, &block)
287
+ # Creates a <u> element and puts it to {#elements}
288
+ # @param value [String] The value of the element
289
+ # @param args [Hash] The attributes of the element
290
+ # @return [void]
291
+ # @yield Create child elements of <u>
292
+
293
+ # @!method i(value = nil, **args, &block)
294
+ # Creates a <i> element and puts it to {#elements}
295
+ # @param value [String] The value of the element
296
+ # @param args [Hash] The attributes of the element
297
+ # @return [void]
298
+ # @yield Create child elements of <i>
299
+
300
+ # @!method center(value = nil, **args, &block)
301
+ # Creates a <center> element and puts it to {#elements}
302
+ # @param value [String] The value of the element
303
+ # @param args [Hash] The attributes of the element
304
+ # @return [void]
305
+ # @yield Create child elements of <center>
306
+
307
+ # @!method meta(value = nil, **args, &block)
308
+ # Creates a <meta> element and puts it to {#elements}
309
+ # @param value [String] The value of the element
310
+ # @param args [Hash] The attributes of the element
311
+ # @return [void]
312
+ # @yield Create child elements of <meta>
313
+
314
+ # @!method dl(value = nil, **args, &block)
315
+ # Creates a <dl> element and puts it to {#elements}
316
+ # @param value [String] The value of the element
317
+ # @param args [Hash] The attributes of the element
318
+ # @return [void]
319
+ # @yield Create child elements of <dl>
320
+
321
+ # @!method dt(value = nil, **args, &block)
322
+ # Creates a <dt> element and puts it to {#elements}
323
+ # @param value [String] The value of the element
324
+ # @param args [Hash] The attributes of the element
325
+ # @return [void]
326
+ # @yield Create child elements of <dt>
327
+
328
+ # @!method dd(value = nil, **args, &block)
329
+ # Creates a <dd> element and puts it to {#elements}
330
+ # @param value [String] The value of the element
331
+ # @param args [Hash] The attributes of the element
332
+ # @return [void]
333
+ # @yield Create child elements of <dd>
334
+
335
+ # @!method ol(value = nil, **args, &block)
336
+ # Creates a <ol> element and puts it to {#elements}
337
+ # @param value [String] The value of the element
338
+ # @param args [Hash] The attributes of the element
339
+ # @return [void]
340
+ # @yield Create child elements of <ol>
341
+
342
+ # @!method ul(value = nil, **args, &block)
343
+ # Creates a <ul> element and puts it to {#elements}
344
+ # @param value [String] The value of the element
345
+ # @param args [Hash] The attributes of the element
346
+ # @return [void]
347
+ # @yield Create child elements of <ul>
348
+
349
+ # @!method li(value = nil, **args, &block)
350
+ # Creates a <li> element and puts it to {#elements}
351
+ # @param value [String] The value of the element
352
+ # @param args [Hash] The attributes of the element
353
+ # @return [void]
354
+ # @yield Create child elements of <li>
355
+
356
+ # @!method fieldset(value = nil, **args, &block)
357
+ # Creates a <fieldset> element and puts it to {#elements}
358
+ # @param value [String] The value of the element
359
+ # @param args [Hash] The attributes of the element
360
+ # @return [void]
361
+ # @yield Create child elements of <fieldset>
362
+
363
+ # @!method form(value = nil, **args, &block)
364
+ # Creates a <form> element and puts it to {#elements}
365
+ # @param value [String] The value of the element
366
+ # @param args [Hash] The attributes of the element
367
+ # @return [void]
368
+ # @yield Create child elements of <form>
369
+
370
+ # @!method label(value = nil, **args, &block)
371
+ # Creates a <label> element and puts it to {#elements}
372
+ # @param value [String] The value of the element
373
+ # @param args [Hash] The attributes of the element
374
+ # @return [void]
375
+ # @yield Create child elements of <label>
376
+
377
+ # @!method legend(value = nil, **args, &block)
378
+ # Creates a <legend> element and puts it to {#elements}
379
+ # @param value [String] The value of the element
380
+ # @param args [Hash] The attributes of the element
381
+ # @return [void]
382
+ # @yield Create child elements of <legend>
383
+
384
+ # @!method table(value = nil, **args, &block)
385
+ # Creates a <table> element and puts it to {#elements}
386
+ # @param value [String] The value of the element
387
+ # @param args [Hash] The attributes of the element
388
+ # @return [void]
389
+ # @yield Create child elements of <table>
390
+
391
+ # @!method caption(value = nil, **args, &block)
392
+ # Creates a <caption> element and puts it to {#elements}
393
+ # @param value [String] The value of the element
394
+ # @param args [Hash] The attributes of the element
395
+ # @return [void]
396
+ # @yield Create child elements of <caption>
397
+
398
+ # @!method tbody(value = nil, **args, &block)
399
+ # Creates a <tbody> element and puts it to {#elements}
400
+ # @param value [String] The value of the element
401
+ # @param args [Hash] The attributes of the element
402
+ # @return [void]
403
+ # @yield Create child elements of <tbody>
404
+
405
+ # @!method tfoot(value = nil, **args, &block)
406
+ # Creates a <tfoot> element and puts it to {#elements}
407
+ # @param value [String] The value of the element
408
+ # @param args [Hash] The attributes of the element
409
+ # @return [void]
410
+ # @yield Create child elements of <tfoot>
411
+
412
+ # @!method thead(value = nil, **args, &block)
413
+ # Creates a <thead> element and puts it to {#elements}
414
+ # @param value [String] The value of the element
415
+ # @param args [Hash] The attributes of the element
416
+ # @return [void]
417
+ # @yield Create child elements of <thead>
418
+
419
+ # @!method tr(value = nil, **args, &block)
420
+ # Creates a <tr> element and puts it to {#elements}
421
+ # @param value [String] The value of the element
422
+ # @param args [Hash] The attributes of the element
423
+ # @return [void]
424
+ # @yield Create child elements of <tr>
425
+
426
+ # @!method th(value = nil, **args, &block)
427
+ # Creates a <th> element and puts it to {#elements}
428
+ # @param value [String] The value of the element
429
+ # @param args [Hash] The attributes of the element
430
+ # @return [void]
431
+ # @yield Create child elements of <th>
432
+
433
+ # @!method td(value = nil, **args, &block)
434
+ # Creates a <td> element and puts it to {#elements}
435
+ # @param value [String] The value of the element
436
+ # @param args [Hash] The attributes of the element
437
+ # @return [void]
438
+ # @yield Create child elements of <td>
439
+
440
+ # @!method article(value = nil, **args, &block)
441
+ # Creates a <article> element and puts it to {#elements}
442
+ # @param value [String] The value of the element
443
+ # @param args [Hash] The attributes of the element
444
+ # @return [void]
445
+ # @yield Create child elements of <article>
446
+
447
+ # @!method aside(value = nil, **args, &block)
448
+ # Creates a <aside> element and puts it to {#elements}
449
+ # @param value [String] The value of the element
450
+ # @param args [Hash] The attributes of the element
451
+ # @return [void]
452
+ # @yield Create child elements of <aside>
453
+
454
+ # @!method canvas(value = nil, **args, &block)
455
+ # Creates a <canvas> element and puts it to {#elements}
456
+ # @param value [String] The value of the element
457
+ # @param args [Hash] The attributes of the element
458
+ # @return [void]
459
+ # @yield Create child elements of <canvas>
460
+
461
+ # @!method details(value = nil, **args, &block)
462
+ # Creates a <details> element and puts it to {#elements}
463
+ # @param value [String] The value of the element
464
+ # @param args [Hash] The attributes of the element
465
+ # @return [void]
466
+ # @yield Create child elements of <details>
467
+
468
+ # @!method embed(value = nil, **args, &block)
469
+ # Creates a <embed> element and puts it to {#elements}
470
+ # @param value [String] The value of the element
471
+ # @param args [Hash] The attributes of the element
472
+ # @return [void]
473
+ # @yield Create child elements of <embed>
474
+
475
+ # @!method figure(value = nil, **args, &block)
476
+ # Creates a <figure> element and puts it to {#elements}
477
+ # @param value [String] The value of the element
478
+ # @param args [Hash] The attributes of the element
479
+ # @return [void]
480
+ # @yield Create child elements of <figure>
481
+
482
+ # @!method figcaption(value = nil, **args, &block)
483
+ # Creates a <figcaption> element and puts it to {#elements}
484
+ # @param value [String] The value of the element
485
+ # @param args [Hash] The attributes of the element
486
+ # @return [void]
487
+ # @yield Create child elements of <figcaption>
488
+
489
+ # @!method footer(value = nil, **args, &block)
490
+ # Creates a <footer> element and puts it to {#elements}
491
+ # @param value [String] The value of the element
492
+ # @param args [Hash] The attributes of the element
493
+ # @return [void]
494
+ # @yield Create child elements of <footer>
495
+
496
+ # @!method header(value = nil, **args, &block)
497
+ # Creates a <header> element and puts it to {#elements}
498
+ # @param value [String] The value of the element
499
+ # @param args [Hash] The attributes of the element
500
+ # @return [void]
501
+ # @yield Create child elements of <header>
502
+
503
+ # @!method hgroup(value = nil, **args, &block)
504
+ # Creates a <hgroup> element and puts it to {#elements}
505
+ # @param value [String] The value of the element
506
+ # @param args [Hash] The attributes of the element
507
+ # @return [void]
508
+ # @yield Create child elements of <hgroup>
509
+
510
+ # @!method menu(value = nil, **args, &block)
511
+ # Creates a <menu> element and puts it to {#elements}
512
+ # @param value [String] The value of the element
513
+ # @param args [Hash] The attributes of the element
514
+ # @return [void]
515
+ # @yield Create child elements of <menu>
516
+
517
+ # @!method nav(value = nil, **args, &block)
518
+ # Creates a <nav> element and puts it to {#elements}
519
+ # @param value [String] The value of the element
520
+ # @param args [Hash] The attributes of the element
521
+ # @return [void]
522
+ # @yield Create child elements of <nav>
523
+
524
+ # @!method output(value = nil, **args, &block)
525
+ # Creates a <output> element and puts it to {#elements}
526
+ # @param value [String] The value of the element
527
+ # @param args [Hash] The attributes of the element
528
+ # @return [void]
529
+ # @yield Create child elements of <output>
530
+
531
+ # @!method ruby(value = nil, **args, &block)
532
+ # Creates a <ruby> element and puts it to {#elements}
533
+ # @param value [String] The value of the element
534
+ # @param args [Hash] The attributes of the element
535
+ # @return [void]
536
+ # @yield Create child elements of <ruby>
537
+
538
+ # @!method section(value = nil, **args, &block)
539
+ # Creates a <section> element and puts it to {#elements}
540
+ # @param value [String] The value of the element
541
+ # @param args [Hash] The attributes of the element
542
+ # @return [void]
543
+ # @yield Create child elements of <section>
544
+
545
+ # @!method summary(value = nil, **args, &block)
546
+ # Creates a <summary> element and puts it to {#elements}
547
+ # @param value [String] The value of the element
548
+ # @param args [Hash] The attributes of the element
549
+ # @return [void]
550
+ # @yield Create child elements of <summary>
551
+
552
+ # @!method time(value = nil, **args, &block)
553
+ # Creates a <time> element and puts it to {#elements}
554
+ # @param value [String] The value of the element
555
+ # @param args [Hash] The attributes of the element
556
+ # @return [void]
557
+ # @yield Create child elements of <time>
558
+
559
+ # @!method mark(value = nil, **args, &block)
560
+ # Creates a <mark> element and puts it to {#elements}
561
+ # @param value [String] The value of the element
562
+ # @param args [Hash] The attributes of the element
563
+ # @return [void]
564
+ # @yield Create child elements of <mark>
565
+
566
+ # @!method audio(value = nil, **args, &block)
567
+ # Creates a <audio> element and puts it to {#elements}
568
+ # @param value [String] The value of the element
569
+ # @param args [Hash] The attributes of the element
570
+ # @return [void]
571
+ # @yield Create child elements of <audio>
572
+
573
+ # @!method video(value = nil, **args, &block)
574
+ # Creates a <video> element and puts it to {#elements}
575
+ # @param value [String] The value of the element
576
+ # @param args [Hash] The attributes of the element
577
+ # @return [void]
578
+ # @yield Create child elements of <video>
579
+
580
+ # @!method script(value = nil, **args, &block)
581
+ # Creates a <script> element and puts it to {#elements}
582
+ # @param value [String] The value of the element
583
+ # @param args [Hash] The attributes of the element
584
+ # @return [void]
585
+ # @yield Create child elements of <script>
586
+
587
+ # @!method head(value = nil, **args, &block)
588
+ # Creates a <head> element and puts it to {#elements}
589
+ # @param value [String] The value of the element
590
+ # @param args [Hash] The attributes of the element
591
+ # @return [void]
592
+ # @yield Create child elements of <head>
593
+
594
+ # @!method title(value = nil, **args, &block)
595
+ # Creates a <title> element and puts it to {#elements}
596
+ # @param value [String] The value of the element
597
+ # @param args [Hash] The attributes of the element
598
+ # @return [void]
599
+ # @yield Create child elements of <title>
600
+
601
+ # @!method link(value = nil, **args, &block)
602
+ # Creates a <link> element and puts it to {#elements}
603
+ # @param value [String] The value of the element
604
+ # @param args [Hash] The attributes of the element
605
+ # @return [void]
606
+ # @yield Create child elements of <link>
607
+ end
608
+ end
609
+ end
data/lib/self.rb ADDED
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'webrick'
4
+
5
+ module Alister
6
+ # An HTML Builder, the main thing that will be used
7
+ # @example Creating a simple html
8
+ # builder = Alister.html do
9
+ # doctype
10
+ # html lang: "en" do
11
+ # head do
12
+ # meta charset: "utf-8"
13
+ # meta name: "viewport", content: "width=device-width, initial-scale=1"
14
+ # end
15
+ # body do
16
+ # div id: "app"
17
+ # end
18
+ # end
19
+ # @yield Starts an html block
20
+ # @return [HTML::Builder]
21
+ def self.html(&block)
22
+ html = HTML::Builder.new
23
+ html.instance_eval(&block)
24
+ html
25
+ end
26
+
27
+ # Used to test your server
28
+ # @example Serve build folder
29
+ # Alister.serve('./build', 6969)
30
+ # @param port [Integer] Port of where the site will be hosted in
31
+ # @param path [String] Path to the folder that will be served, most likely a build folder
32
+ # @return [void]
33
+ def self.serve(path, port)
34
+ if File.directory? path
35
+ server = WEBrick::HTTPServer.new Port: port, DocumentRoot: path
36
+ trap('INT') { server.shutdown }
37
+ server.start
38
+ else
39
+ puts "[ERROR] Folder \"#{path}\" does not exist / is not a folder"
40
+ end
41
+ end
42
+ end