hyperlang 0.1.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.
Files changed (117) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/rake.yml +19 -0
  3. data/.github/workflows/release.yml +28 -0
  4. data/.gitignore +8 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +19 -0
  7. data/.rubocop_todo.yml +45 -0
  8. data/Gemfile +15 -0
  9. data/README.adoc +176 -0
  10. data/Rakefile +12 -0
  11. data/hyperlang.gemspec +36 -0
  12. data/lib/hyperlang/version.rb +5 -0
  13. data/lib/hyperlang/xhtml/a.rb +44 -0
  14. data/lib/hyperlang/xhtml/abbr.rb +22 -0
  15. data/lib/hyperlang/xhtml/acronym.rb +22 -0
  16. data/lib/hyperlang/xhtml/address.rb +26 -0
  17. data/lib/hyperlang/xhtml/applet.rb +42 -0
  18. data/lib/hyperlang/xhtml/area.rb +29 -0
  19. data/lib/hyperlang/xhtml/b.rb +22 -0
  20. data/lib/hyperlang/xhtml/base.rb +17 -0
  21. data/lib/hyperlang/xhtml/basefont.rb +21 -0
  22. data/lib/hyperlang/xhtml/bdo.rb +22 -0
  23. data/lib/hyperlang/xhtml/big.rb +22 -0
  24. data/lib/hyperlang/xhtml/blockquote.rb +44 -0
  25. data/lib/hyperlang/xhtml/body.rb +54 -0
  26. data/lib/hyperlang/xhtml/br.rb +12 -0
  27. data/lib/hyperlang/xhtml/button.rb +42 -0
  28. data/lib/hyperlang/xhtml/caption.rb +20 -0
  29. data/lib/hyperlang/xhtml/center.rb +48 -0
  30. data/lib/hyperlang/xhtml/cite.rb +20 -0
  31. data/lib/hyperlang/xhtml/code.rb +22 -0
  32. data/lib/hyperlang/xhtml/col.rb +29 -0
  33. data/lib/hyperlang/xhtml/colgroup.rb +31 -0
  34. data/lib/hyperlang/xhtml/dd.rb +40 -0
  35. data/lib/hyperlang/xhtml/del.rb +38 -0
  36. data/lib/hyperlang/xhtml/dfn.rb +20 -0
  37. data/lib/hyperlang/xhtml/dir.rb +21 -0
  38. data/lib/hyperlang/xhtml/div.rb +64 -0
  39. data/lib/hyperlang/xhtml/dl.rb +21 -0
  40. data/lib/hyperlang/xhtml/dt.rb +30 -0
  41. data/lib/hyperlang/xhtml/em.rb +22 -0
  42. data/lib/hyperlang/xhtml/fieldset.rb +34 -0
  43. data/lib/hyperlang/xhtml/font.rb +26 -0
  44. data/lib/hyperlang/xhtml/form.rb +40 -0
  45. data/lib/hyperlang/xhtml/frame.rb +31 -0
  46. data/lib/hyperlang/xhtml/frameset.rb +25 -0
  47. data/lib/hyperlang/xhtml/h1.rb +34 -0
  48. data/lib/hyperlang/xhtml/h2.rb +34 -0
  49. data/lib/hyperlang/xhtml/h3.rb +34 -0
  50. data/lib/hyperlang/xhtml/h4.rb +34 -0
  51. data/lib/hyperlang/xhtml/h5.rb +34 -0
  52. data/lib/hyperlang/xhtml/h6.rb +34 -0
  53. data/lib/hyperlang/xhtml/head.rb +27 -0
  54. data/lib/hyperlang/xhtml/hr.rb +17 -0
  55. data/lib/hyperlang/xhtml/html.rb +17 -0
  56. data/lib/hyperlang/xhtml/i.rb +22 -0
  57. data/lib/hyperlang/xhtml/iframe.rb +40 -0
  58. data/lib/hyperlang/xhtml/img.rb +35 -0
  59. data/lib/hyperlang/xhtml/input.rb +55 -0
  60. data/lib/hyperlang/xhtml/ins.rb +38 -0
  61. data/lib/hyperlang/xhtml/isindex.rb +19 -0
  62. data/lib/hyperlang/xhtml/kbd.rb +20 -0
  63. data/lib/hyperlang/xhtml/label.rb +24 -0
  64. data/lib/hyperlang/xhtml/legend.rb +22 -0
  65. data/lib/hyperlang/xhtml/li.rb +42 -0
  66. data/lib/hyperlang/xhtml/link.rb +31 -0
  67. data/lib/hyperlang/xhtml/map.rb +35 -0
  68. data/lib/hyperlang/xhtml/menu.rb +21 -0
  69. data/lib/hyperlang/xhtml/meta.rb +23 -0
  70. data/lib/hyperlang/xhtml/namespace.rb +10 -0
  71. data/lib/hyperlang/xhtml/noframes.rb +46 -0
  72. data/lib/hyperlang/xhtml/noscript.rb +42 -0
  73. data/lib/hyperlang/xhtml/object.rb +48 -0
  74. data/lib/hyperlang/xhtml/ol.rb +25 -0
  75. data/lib/hyperlang/xhtml/optgroup.rb +23 -0
  76. data/lib/hyperlang/xhtml/option.rb +25 -0
  77. data/lib/hyperlang/xhtml/p.rb +36 -0
  78. data/lib/hyperlang/xhtml/param.rb +23 -0
  79. data/lib/hyperlang/xhtml/pre.rb +32 -0
  80. data/lib/hyperlang/xhtml/q.rb +22 -0
  81. data/lib/hyperlang/xhtml/rb.rb +20 -0
  82. data/lib/hyperlang/xhtml/rbc.rb +19 -0
  83. data/lib/hyperlang/xhtml/rp.rb +19 -0
  84. data/lib/hyperlang/xhtml/rt.rb +22 -0
  85. data/lib/hyperlang/xhtml/rtc.rb +23 -0
  86. data/lib/hyperlang/xhtml/ruby.rb +27 -0
  87. data/lib/hyperlang/xhtml/s.rb +20 -0
  88. data/lib/hyperlang/xhtml/samp.rb +20 -0
  89. data/lib/hyperlang/xhtml/script.rb +25 -0
  90. data/lib/hyperlang/xhtml/select.rb +37 -0
  91. data/lib/hyperlang/xhtml/small.rb +22 -0
  92. data/lib/hyperlang/xhtml/span.rb +24 -0
  93. data/lib/hyperlang/xhtml/strike.rb +20 -0
  94. data/lib/hyperlang/xhtml/strong.rb +22 -0
  95. data/lib/hyperlang/xhtml/style.rb +23 -0
  96. data/lib/hyperlang/xhtml/sub.rb +20 -0
  97. data/lib/hyperlang/xhtml/sup.rb +20 -0
  98. data/lib/hyperlang/xhtml/table.rb +43 -0
  99. data/lib/hyperlang/xhtml/tbody.rb +27 -0
  100. data/lib/hyperlang/xhtml/td.rb +42 -0
  101. data/lib/hyperlang/xhtml/textarea.rb +41 -0
  102. data/lib/hyperlang/xhtml/tfoot.rb +27 -0
  103. data/lib/hyperlang/xhtml/th.rb +42 -0
  104. data/lib/hyperlang/xhtml/thead.rb +27 -0
  105. data/lib/hyperlang/xhtml/title.rb +15 -0
  106. data/lib/hyperlang/xhtml/tr.rb +29 -0
  107. data/lib/hyperlang/xhtml/tt.rb +20 -0
  108. data/lib/hyperlang/xhtml/u.rb +20 -0
  109. data/lib/hyperlang/xhtml/ul.rb +23 -0
  110. data/lib/hyperlang/xhtml/var.rb +20 -0
  111. data/lib/hyperlang/xhtml/xhtml.rb +147 -0
  112. data/lib/hyperlang.rb +16 -0
  113. data/spec/hyperlang/round_trip_spec.rb +86 -0
  114. data/spec/hyperlang/xhtml/block_spec.rb +56 -0
  115. data/spec/hyperlang/xhtml/inline_spec.rb +60 -0
  116. data/spec/spec_helper.rb +17 -0
  117. metadata +173 -0
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Blockquote < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :cite, :string
8
+ attribute :p, Hyperlang::Xhtml::P, collection: true
9
+ attribute :div, Hyperlang::Xhtml::Div, collection: true
10
+ attribute :ul, Hyperlang::Xhtml::Ul, collection: true
11
+ attribute :ol, Hyperlang::Xhtml::Ol, collection: true
12
+ attribute :table, Hyperlang::Xhtml::Table, collection: true
13
+ attribute :h1, Hyperlang::Xhtml::H1, collection: true
14
+ attribute :h2, Hyperlang::Xhtml::H2, collection: true
15
+ attribute :h3, Hyperlang::Xhtml::H3, collection: true
16
+ attribute :h4, Hyperlang::Xhtml::H4, collection: true
17
+ attribute :h5, Hyperlang::Xhtml::H5, collection: true
18
+ attribute :h6, Hyperlang::Xhtml::H6, collection: true
19
+ attribute :id, :string
20
+ attribute :klass, :string
21
+
22
+ xml do
23
+ element "blockquote"
24
+ namespace Hyperlang::Xhtml::Namespace
25
+ mixed_content
26
+ map_content to: :content
27
+ map_attribute "cite", to: :cite
28
+ map_element "p", to: :p
29
+ map_element "div", to: :div
30
+ map_element "ul", to: :ul
31
+ map_element "ol", to: :ol
32
+ map_element "table", to: :table
33
+ map_element "h1", to: :h1
34
+ map_element "h2", to: :h2
35
+ map_element "h3", to: :h3
36
+ map_element "h4", to: :h4
37
+ map_element "h5", to: :h5
38
+ map_element "h6", to: :h6
39
+ map_attribute "id", to: :id
40
+ map_attribute "class", to: :klass
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Body < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :div, Hyperlang::Xhtml::Div, collection: true
8
+ attribute :p, Hyperlang::Xhtml::P, collection: true
9
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
10
+ attribute :a, Hyperlang::Xhtml::A, collection: true
11
+ attribute :ul, Hyperlang::Xhtml::Ul, collection: true
12
+ attribute :ol, Hyperlang::Xhtml::Ol, collection: true
13
+ attribute :table, Hyperlang::Xhtml::Table, collection: true
14
+ attribute :h1, Hyperlang::Xhtml::H1, collection: true
15
+ attribute :h2, Hyperlang::Xhtml::H2, collection: true
16
+ attribute :h3, Hyperlang::Xhtml::H3, collection: true
17
+ attribute :h4, Hyperlang::Xhtml::H4, collection: true
18
+ attribute :h5, Hyperlang::Xhtml::H5, collection: true
19
+ attribute :h6, Hyperlang::Xhtml::H6, collection: true
20
+ attribute :pre, Hyperlang::Xhtml::Pre, collection: true
21
+ attribute :blockquote, Hyperlang::Xhtml::Blockquote, collection: true
22
+ attribute :hr, Hyperlang::Xhtml::Hr, collection: true
23
+ attribute :form, Hyperlang::Xhtml::Form, collection: true
24
+ attribute :fieldset, Hyperlang::Xhtml::Fieldset, collection: true
25
+ attribute :noscript, Hyperlang::Xhtml::Noscript, collection: true
26
+
27
+ xml do
28
+ element "body"
29
+ namespace Hyperlang::Xhtml::Namespace
30
+ mixed_content
31
+ map_content to: :content
32
+ map_element "div", to: :div
33
+ map_element "p", to: :p
34
+ map_element "span", to: :span
35
+ map_element "a", to: :a
36
+ map_element "ul", to: :ul
37
+ map_element "ol", to: :ol
38
+ map_element "table", to: :table
39
+ map_element "h1", to: :h1
40
+ map_element "h2", to: :h2
41
+ map_element "h3", to: :h3
42
+ map_element "h4", to: :h4
43
+ map_element "h5", to: :h5
44
+ map_element "h6", to: :h6
45
+ map_element "pre", to: :pre
46
+ map_element "blockquote", to: :blockquote
47
+ map_element "hr", to: :hr
48
+ map_element "form", to: :form
49
+ map_element "fieldset", to: :fieldset
50
+ map_element "noscript", to: :noscript
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Br < Lutaml::Model::Serializable
6
+ xml do
7
+ element "br"
8
+ namespace Hyperlang::Xhtml::Namespace
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Button < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :p, Hyperlang::Xhtml::P, collection: true
8
+ attribute :div, Hyperlang::Xhtml::Div, collection: true
9
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
10
+ attribute :strong, Hyperlang::Xhtml::Strong, collection: true
11
+ attribute :em, Hyperlang::Xhtml::Em, collection: true
12
+ attribute :name, :string
13
+ attribute :value, :string
14
+ attribute :type, :string
15
+ attribute :disabled, :string
16
+ attribute :tabindex, :integer
17
+ attribute :accesskey, :string
18
+ attribute :id, :string
19
+ attribute :klass, :string
20
+
21
+ xml do
22
+ element "button"
23
+ namespace Hyperlang::Xhtml::Namespace
24
+ mixed_content
25
+ map_content to: :content
26
+ map_element "p", to: :p
27
+ map_element "div", to: :div
28
+ map_element "span", to: :span
29
+ map_element "strong", to: :strong
30
+ map_element "em", to: :em
31
+ map_attribute "name", to: :name
32
+ map_attribute "value", to: :value
33
+ map_attribute "type", to: :type
34
+ map_attribute "disabled", to: :disabled
35
+ map_attribute "tabindex", to: :tabindex
36
+ map_attribute "accesskey", to: :accesskey
37
+ map_attribute "id", to: :id
38
+ map_attribute "class", to: :klass
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Caption < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :id, :string
8
+ attribute :klass, :string
9
+
10
+ xml do
11
+ element "caption"
12
+ namespace Hyperlang::Xhtml::Namespace
13
+ mixed_content
14
+ map_content to: :content
15
+ map_attribute "id", to: :id
16
+ map_attribute "class", to: :klass
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Center < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :p, Hyperlang::Xhtml::P, collection: true
8
+ attribute :div, Hyperlang::Xhtml::Div, collection: true
9
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
10
+ attribute :ul, Hyperlang::Xhtml::Ul, collection: true
11
+ attribute :ol, Hyperlang::Xhtml::Ol, collection: true
12
+ attribute :li, Hyperlang::Xhtml::Li, collection: true
13
+ attribute :h1, Hyperlang::Xhtml::H1, collection: true
14
+ attribute :h2, Hyperlang::Xhtml::H2, collection: true
15
+ attribute :h3, Hyperlang::Xhtml::H3, collection: true
16
+ attribute :h4, Hyperlang::Xhtml::H4, collection: true
17
+ attribute :h5, Hyperlang::Xhtml::H5, collection: true
18
+ attribute :h6, Hyperlang::Xhtml::H6, collection: true
19
+ attribute :a, Hyperlang::Xhtml::A, collection: true
20
+ attribute :table, Hyperlang::Xhtml::Table, collection: true
21
+ attribute :id, :string
22
+ attribute :klass, :string
23
+
24
+ xml do
25
+ element "center"
26
+ namespace Hyperlang::Xhtml::Namespace
27
+ mixed_content
28
+ map_content to: :content
29
+ map_element "p", to: :p
30
+ map_element "div", to: :div
31
+ map_element "span", to: :span
32
+ map_element "ul", to: :ul
33
+ map_element "ol", to: :ol
34
+ map_element "li", to: :li
35
+ map_element "h1", to: :h1
36
+ map_element "h2", to: :h2
37
+ map_element "h3", to: :h3
38
+ map_element "h4", to: :h4
39
+ map_element "h5", to: :h5
40
+ map_element "h6", to: :h6
41
+ map_element "a", to: :a
42
+ map_element "table", to: :table
43
+ map_attribute "id", to: :id
44
+ map_attribute "class", to: :klass
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Cite < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :id, :string
8
+ attribute :klass, :string
9
+
10
+ xml do
11
+ element "cite"
12
+ namespace Hyperlang::Xhtml::Namespace
13
+ mixed_content
14
+ map_content to: :content
15
+ map_attribute "id", to: :id
16
+ map_attribute "class", to: :klass
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Code < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :id, :string
8
+ attribute :klass, :string
9
+ attribute :style, :string
10
+
11
+ xml do
12
+ element "code"
13
+ namespace Hyperlang::Xhtml::Namespace
14
+ mixed_content
15
+ map_content to: :content
16
+ map_attribute "id", to: :id
17
+ map_attribute "class", to: :klass
18
+ map_attribute "style", to: :style
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Col < Lutaml::Model::Serializable
6
+ attribute :span, :integer
7
+ attribute :width, :string
8
+ attribute :align, :string
9
+ attribute :char, :string
10
+ attribute :charoff, :string
11
+ attribute :valign, :string
12
+ attribute :id, :string
13
+ attribute :klass, :string
14
+
15
+ xml do
16
+ element "col"
17
+ namespace Hyperlang::Xhtml::Namespace
18
+ map_attribute "span", to: :span
19
+ map_attribute "width", to: :width
20
+ map_attribute "align", to: :align
21
+ map_attribute "char", to: :char
22
+ map_attribute "charoff", to: :charoff
23
+ map_attribute "valign", to: :valign
24
+ map_attribute "id", to: :id
25
+ map_attribute "class", to: :klass
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Colgroup < Lutaml::Model::Serializable
6
+ attribute :col, Hyperlang::Xhtml::Col, collection: true
7
+ attribute :span, :integer
8
+ attribute :width, :string
9
+ attribute :align, :string
10
+ attribute :char, :string
11
+ attribute :charoff, :string
12
+ attribute :valign, :string
13
+ attribute :id, :string
14
+ attribute :klass, :string
15
+
16
+ xml do
17
+ element "colgroup"
18
+ namespace Hyperlang::Xhtml::Namespace
19
+ map_element "col", to: :col
20
+ map_attribute "span", to: :span
21
+ map_attribute "width", to: :width
22
+ map_attribute "align", to: :align
23
+ map_attribute "char", to: :char
24
+ map_attribute "charoff", to: :charoff
25
+ map_attribute "valign", to: :valign
26
+ map_attribute "id", to: :id
27
+ map_attribute "class", to: :klass
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Dd < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :p, Hyperlang::Xhtml::P, collection: true
8
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
9
+ # div omitted: creates circular dd→div→li→dd (div→li cycle, div is Phase 4, dd is Phase 3)
10
+ attribute :ul, Hyperlang::Xhtml::Ul, collection: true
11
+ attribute :ol, Hyperlang::Xhtml::Ol, collection: true
12
+ attribute :li, Hyperlang::Xhtml::Li, collection: true
13
+ attribute :a, Hyperlang::Xhtml::A, collection: true
14
+ attribute :strong, Hyperlang::Xhtml::Strong, collection: true
15
+ attribute :em, Hyperlang::Xhtml::Em, collection: true
16
+ attribute :br, Hyperlang::Xhtml::Br, collection: true
17
+ attribute :id, :string
18
+ attribute :klass, :string
19
+
20
+ xml do
21
+ element "dd"
22
+ namespace Hyperlang::Xhtml::Namespace
23
+ mixed_content
24
+ map_content to: :content
25
+ map_element "p", to: :p
26
+ map_element "span", to: :span
27
+ # div omitted (circular)
28
+ map_element "ul", to: :ul
29
+ map_element "ol", to: :ol
30
+ map_element "li", to: :li
31
+ map_element "a", to: :a
32
+ map_element "strong", to: :strong
33
+ map_element "em", to: :em
34
+ map_element "br", to: :br
35
+ map_attribute "id", to: :id
36
+ map_attribute "class", to: :klass
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Del < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :cite, :string
8
+ attribute :datetime, :string
9
+ attribute :p, Hyperlang::Xhtml::P, collection: true
10
+ attribute :div, Hyperlang::Xhtml::Div, collection: true
11
+ attribute :ul, Hyperlang::Xhtml::Ul, collection: true
12
+ attribute :ol, Hyperlang::Xhtml::Ol, collection: true
13
+ attribute :li, Hyperlang::Xhtml::Li, collection: true
14
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
15
+ attribute :a, Hyperlang::Xhtml::A, collection: true
16
+ attribute :id, :string
17
+ attribute :klass, :string
18
+
19
+ xml do
20
+ element "del"
21
+ namespace Hyperlang::Xhtml::Namespace
22
+ mixed_content
23
+ map_content to: :content
24
+ map_attribute "cite", to: :cite
25
+ map_attribute "datetime", to: :datetime
26
+ map_element "p", to: :p
27
+ map_element "div", to: :div
28
+ map_element "ul", to: :ul
29
+ map_element "ol", to: :ol
30
+ map_element "li", to: :li
31
+ map_element "span", to: :span
32
+ map_element "a", to: :a
33
+ map_attribute "id", to: :id
34
+ map_attribute "class", to: :klass
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Dfn < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :id, :string
8
+ attribute :klass, :string
9
+
10
+ xml do
11
+ element "dfn"
12
+ namespace Hyperlang::Xhtml::Namespace
13
+ mixed_content
14
+ map_content to: :content
15
+ map_attribute "id", to: :id
16
+ map_attribute "class", to: :klass
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Dir < Lutaml::Model::Serializable
6
+ attribute :li, Hyperlang::Xhtml::Li, collection: true
7
+ attribute :compact, :string
8
+ attribute :id, :string
9
+ attribute :klass, :string
10
+
11
+ xml do
12
+ element "dir"
13
+ namespace Hyperlang::Xhtml::Namespace
14
+ map_element "li", to: :li
15
+ map_attribute "compact", to: :compact
16
+ map_attribute "id", to: :id
17
+ map_attribute "class", to: :klass
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Div < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
8
+ attribute :p, Hyperlang::Xhtml::P, collection: true
9
+ attribute :br, Hyperlang::Xhtml::Br, collection: true
10
+ attribute :strong, Hyperlang::Xhtml::Strong, collection: true
11
+ attribute :em, Hyperlang::Xhtml::Em, collection: true
12
+ attribute :ul, Hyperlang::Xhtml::Ul, collection: true
13
+ attribute :ol, Hyperlang::Xhtml::Ol, collection: true
14
+ attribute :li, Hyperlang::Xhtml::Li, collection: true
15
+ attribute :h1, Hyperlang::Xhtml::H1, collection: true
16
+ attribute :h2, Hyperlang::Xhtml::H2, collection: true
17
+ attribute :h3, Hyperlang::Xhtml::H3, collection: true
18
+ attribute :h4, Hyperlang::Xhtml::H4, collection: true
19
+ attribute :h5, Hyperlang::Xhtml::H5, collection: true
20
+ attribute :h6, Hyperlang::Xhtml::H6, collection: true
21
+ attribute :a, Hyperlang::Xhtml::A, collection: true
22
+ attribute :img, Hyperlang::Xhtml::Img, collection: true
23
+ # blockquote omitted: creates circular dependency div↔blockquote
24
+ attribute :pre, Hyperlang::Xhtml::Pre, collection: true
25
+ attribute :table, Hyperlang::Xhtml::Table, collection: true
26
+ # form omitted: creates circular dependency form↔fieldset
27
+ attribute :klass, :string
28
+ attribute :style, :string
29
+ attribute :id, :string
30
+ attribute :title, :string
31
+
32
+ xml do
33
+ element "div"
34
+ namespace Hyperlang::Xhtml::Namespace
35
+ mixed_content
36
+ map_content to: :content
37
+ map_element "span", to: :span
38
+ map_element "p", to: :p
39
+ map_element "br", to: :br
40
+ map_element "strong", to: :strong
41
+ map_element "em", to: :em
42
+ map_element "ul", to: :ul
43
+ map_element "ol", to: :ol
44
+ map_element "li", to: :li
45
+ map_element "h1", to: :h1
46
+ map_element "h2", to: :h2
47
+ map_element "h3", to: :h3
48
+ map_element "h4", to: :h4
49
+ map_element "h5", to: :h5
50
+ map_element "h6", to: :h6
51
+ map_element "a", to: :a
52
+ map_element "img", to: :img
53
+ # blockquote omitted: creates circular div↔blockquote
54
+ map_element "pre", to: :pre
55
+ map_element "table", to: :table
56
+ # form omitted: creates circular form↔fieldset
57
+ map_attribute "class", to: :klass
58
+ map_attribute "style", to: :style
59
+ map_attribute "id", to: :id
60
+ map_attribute "title", to: :title
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Dl < Lutaml::Model::Serializable
6
+ attribute :dt, Hyperlang::Xhtml::Dt, collection: true
7
+ attribute :dd, Hyperlang::Xhtml::Dd, collection: true
8
+ attribute :id, :string
9
+ attribute :klass, :string
10
+
11
+ xml do
12
+ element "dl"
13
+ namespace Hyperlang::Xhtml::Namespace
14
+ map_element "dt", to: :dt
15
+ map_element "dd", to: :dd
16
+ map_attribute "id", to: :id
17
+ map_attribute "class", to: :klass
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Dt < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :span, Hyperlang::Xhtml::Span, collection: true
8
+ attribute :a, Hyperlang::Xhtml::A, collection: true
9
+ attribute :strong, Hyperlang::Xhtml::Strong, collection: true
10
+ attribute :em, Hyperlang::Xhtml::Em, collection: true
11
+ attribute :br, Hyperlang::Xhtml::Br, collection: true
12
+ attribute :id, :string
13
+ attribute :klass, :string
14
+
15
+ xml do
16
+ element "dt"
17
+ namespace Hyperlang::Xhtml::Namespace
18
+ mixed_content
19
+ map_content to: :content
20
+ map_element "span", to: :span
21
+ map_element "a", to: :a
22
+ map_element "strong", to: :strong
23
+ map_element "em", to: :em
24
+ map_element "br", to: :br
25
+ map_attribute "id", to: :id
26
+ map_attribute "class", to: :klass
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Em < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :id, :string
8
+ attribute :klass, :string
9
+ attribute :style, :string
10
+
11
+ xml do
12
+ element "em"
13
+ namespace Hyperlang::Xhtml::Namespace
14
+ mixed_content
15
+ map_content to: :content
16
+ map_attribute "id", to: :id
17
+ map_attribute "class", to: :klass
18
+ map_attribute "style", to: :style
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Fieldset < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :legend, Hyperlang::Xhtml::Legend
8
+ attribute :p, Hyperlang::Xhtml::P, collection: true
9
+ attribute :div, Hyperlang::Xhtml::Div, collection: true
10
+ attribute :input, Hyperlang::Xhtml::Input, collection: true
11
+ attribute :select, Hyperlang::Xhtml::Select, collection: true
12
+ attribute :textarea, Hyperlang::Xhtml::Textarea, collection: true
13
+ attribute :button, Hyperlang::Xhtml::Button, collection: true
14
+ attribute :id, :string
15
+ attribute :klass, :string
16
+
17
+ xml do
18
+ element "fieldset"
19
+ namespace Hyperlang::Xhtml::Namespace
20
+ mixed_content
21
+ map_content to: :content
22
+ map_element "legend", to: :legend
23
+ map_element "p", to: :p
24
+ map_element "div", to: :div
25
+ map_element "input", to: :input
26
+ map_element "select", to: :select
27
+ map_element "textarea", to: :textarea
28
+ map_element "button", to: :button
29
+ map_attribute "id", to: :id
30
+ map_attribute "class", to: :klass
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyperlang
4
+ module Xhtml
5
+ class Font < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :size, :string
8
+ attribute :color, :string
9
+ attribute :face, :string
10
+ attribute :id, :string
11
+ attribute :klass, :string
12
+
13
+ xml do
14
+ element "font"
15
+ namespace Hyperlang::Xhtml::Namespace
16
+ mixed_content
17
+ map_content to: :content
18
+ map_attribute "size", to: :size
19
+ map_attribute "color", to: :color
20
+ map_attribute "face", to: :face
21
+ map_attribute "id", to: :id
22
+ map_attribute "class", to: :klass
23
+ end
24
+ end
25
+ end
26
+ end