mml 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/Gemfile +2 -0
  4. data/lib/mml/configuration.rb +70 -0
  5. data/lib/mml/maction.rb +21 -0
  6. data/lib/mml/maligngroup.rb +19 -0
  7. data/lib/mml/malignmark.rb +19 -0
  8. data/lib/mml/math_with_namespace.rb +20 -0
  9. data/lib/mml/math_with_nil_namespace.rb +19 -0
  10. data/lib/mml/menclose.rb +25 -0
  11. data/lib/mml/merror.rb +23 -0
  12. data/lib/mml/mfenced.rb +33 -0
  13. data/lib/mml/mfrac.rb +31 -0
  14. data/lib/mml/mfraction.rb +31 -0
  15. data/lib/mml/mglyph.rb +45 -0
  16. data/lib/mml/mi.rb +37 -0
  17. data/lib/mml/mlabeledtr.rb +27 -0
  18. data/lib/mml/mlongdiv.rb +29 -0
  19. data/lib/mml/mml.rb +21 -0
  20. data/lib/mml/mmultiscripts.rb +29 -0
  21. data/lib/mml/mn.rb +37 -0
  22. data/lib/mml/mo.rb +85 -0
  23. data/lib/mml/mover.rb +27 -0
  24. data/lib/mml/mpadded.rb +33 -0
  25. data/lib/mml/mphantom.rb +23 -0
  26. data/lib/mml/mprescripts.rb +17 -0
  27. data/lib/mml/mroot.rb +23 -0
  28. data/lib/mml/mrow.rb +31 -0
  29. data/lib/mml/ms.rb +47 -0
  30. data/lib/mml/mscarries.rb +31 -0
  31. data/lib/mml/mscarry.rb +27 -0
  32. data/lib/mml/msgroup.rb +32 -0
  33. data/lib/mml/msline.rb +27 -0
  34. data/lib/mml/mspace.rb +57 -0
  35. data/lib/mml/msqrt.rb +24 -0
  36. data/lib/mml/msrow.rb +26 -0
  37. data/lib/mml/mstack.rb +31 -0
  38. data/lib/mml/mstyle.rb +215 -0
  39. data/lib/mml/msub.rb +25 -0
  40. data/lib/mml/msubsup.rb +27 -0
  41. data/lib/mml/msup.rb +25 -0
  42. data/lib/mml/mtable.rb +57 -0
  43. data/lib/mml/mtd.rb +27 -0
  44. data/lib/mml/mtext.rb +37 -0
  45. data/lib/mml/mtr.rb +25 -0
  46. data/lib/mml/munder.rb +29 -0
  47. data/lib/mml/munderover.rb +29 -0
  48. data/lib/mml/none.rb +17 -0
  49. data/lib/mml/semantics.rb +21 -0
  50. data/lib/mml/version.rb +1 -1
  51. data/lib/mml.rb +6 -5
  52. data/mml.gemspec +2 -1
  53. metadata +66 -6
data/lib/mml/mstyle.rb ADDED
@@ -0,0 +1,215 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ # rubocop:disable Metrics/ClassLength
5
+ class Mstyle < Lutaml::Model::Serializable
6
+ model Mml::Configuration.class_for(:mstyle)
7
+
8
+ attribute :mathcolor, :string
9
+ attribute :mathbackground, :string
10
+ attribute :scriptlevel, :integer
11
+ attribute :displaystyle, :string
12
+ attribute :scriptsizemultiplier, :integer
13
+ attribute :scriptminsize, :string
14
+ attribute :infixlinebreakstyle, :string
15
+ attribute :decimalpoint, :string
16
+ attribute :accent, :string
17
+ attribute :accentunder, :string
18
+ attribute :align, :string
19
+ attribute :alignmentscope, :string
20
+ attribute :bevelled, :string
21
+ attribute :charalign, :string
22
+ attribute :charspacing, :string
23
+ attribute :close, :string
24
+ attribute :columnalign, :string
25
+ attribute :columnlines, :string
26
+ attribute :columnspacing, :string
27
+ attribute :columnspan, :integer
28
+ attribute :columnwidth, :string
29
+ attribute :crossout, :string
30
+ attribute :denomalign, :string
31
+ attribute :depth, :string
32
+ attribute :dir, :string
33
+ attribute :edge, :string
34
+ attribute :equalcolumns, :string
35
+ attribute :equalrows, :string
36
+ attribute :fence, :string
37
+ attribute :form, :string
38
+ attribute :frame, :string
39
+ attribute :framespacing, :string
40
+ attribute :groupalign, :string
41
+ attribute :height, :string
42
+ attribute :indentalign, :string
43
+ attribute :indentalignfirst, :string
44
+ attribute :indentalignlast, :string
45
+ attribute :indentshift, :string
46
+ attribute :indentshiftfirst, :string
47
+ attribute :indentshiftlast, :string
48
+ attribute :indenttarget, :string
49
+ attribute :largeop, :string
50
+ attribute :leftoverhang, :string
51
+ attribute :length, :integer
52
+ attribute :linebreak, :string
53
+ attribute :linebreakmultchar, :string
54
+ attribute :linebreakstyle, :string
55
+ attribute :lineleading, :string
56
+ attribute :linethickness, :string
57
+ attribute :location, :string
58
+ attribute :longdivstyle, :string
59
+ attribute :lquote, :string
60
+ attribute :lspace, :string
61
+ attribute :mathsize, :string
62
+ attribute :mathvariant, :string
63
+ attribute :maxsize, :string
64
+ attribute :minlabelspacing, :string
65
+ attribute :minsize, :string
66
+ attribute :movablelimits, :string
67
+ attribute :mslinethickness, :string
68
+ attribute :notation, :string
69
+ attribute :numalign, :string
70
+ attribute :open, :string
71
+ attribute :position, :integer
72
+ attribute :rightoverhang, :string
73
+ attribute :rowalign, :string
74
+ attribute :rowlines, :string
75
+ attribute :rowspacing, :string
76
+ attribute :rowspan, :integer
77
+ attribute :rquote, :string
78
+ attribute :rspace, :string
79
+ attribute :selection, :integer
80
+ attribute :separator, :string
81
+ attribute :separators, :string
82
+ attribute :shift, :integer
83
+ attribute :side, :string
84
+ attribute :stackalign, :string
85
+ attribute :stretchy, :string
86
+ attribute :subscriptshift, :string
87
+ attribute :superscriptshift, :string
88
+ attribute :symmetric, :string
89
+ attribute :valign, :string
90
+ attribute :width, :string
91
+ attribute :fontfamily, :string
92
+ attribute :fontweight, :string
93
+ attribute :fontstyle, :string
94
+ attribute :fontsize, :string
95
+ attribute :color, :string
96
+ attribute :background, :string
97
+ attribute :veryverythinmathspace, :string
98
+ attribute :verythinmathspace, :string
99
+ attribute :thinmathspace, :string
100
+ attribute :mediummathspace, :string
101
+ attribute :thickmathspace, :string
102
+ attribute :verythickmathspace, :string
103
+ attribute :veryverythickmathspace, :string
104
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
105
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
106
+ end
107
+
108
+ # rubocop:disable Metrics/BlockLength
109
+ xml do
110
+ root "mstyle", mixed: true
111
+
112
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
113
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
114
+ map_attribute "scriptlevel", to: :scriptlevel, namespace: nil
115
+ map_attribute "displaystyle", to: :displaystyle, namespace: nil
116
+ map_attribute "scriptsizemultiplier", to: :scriptsizemultiplier, namespace: nil
117
+ map_attribute "scriptminsize", to: :scriptminsize, namespace: nil
118
+ map_attribute "infixlinebreakstyle", to: :infixlinebreakstyle, namespace: nil
119
+ map_attribute "decimalpoint", to: :decimalpoint, namespace: nil
120
+ map_attribute "accent", to: :accent, namespace: nil
121
+ map_attribute "accentunder", to: :accentunder, namespace: nil
122
+ map_attribute "align", to: :align, namespace: nil
123
+ map_attribute "alignmentscope", to: :alignmentscope, namespace: nil
124
+ map_attribute "bevelled", to: :bevelled, namespace: nil
125
+ map_attribute "charalign", to: :charalign, namespace: nil
126
+ map_attribute "charspacing", to: :charspacing, namespace: nil
127
+ map_attribute "close", to: :close, namespace: nil
128
+ map_attribute "columnalign", to: :columnalign, namespace: nil
129
+ map_attribute "columnlines", to: :columnlines, namespace: nil
130
+ map_attribute "columnspacing", to: :columnspacing, namespace: nil
131
+ map_attribute "columnspan", to: :columnspan, namespace: nil
132
+ map_attribute "columnwidth", to: :columnwidth, namespace: nil
133
+ map_attribute "crossout", to: :crossout, namespace: nil
134
+ map_attribute "denomalign", to: :denomalign, namespace: nil
135
+ map_attribute "depth", to: :depth, namespace: nil
136
+ map_attribute "dir", to: :dir, namespace: nil
137
+ map_attribute "edge", to: :edge, namespace: nil
138
+ map_attribute "equalcolumns", to: :equalcolumns, namespace: nil
139
+ map_attribute "equalrows", to: :equalrows, namespace: nil
140
+ map_attribute "fence", to: :fence, namespace: nil
141
+ map_attribute "form", to: :form, namespace: nil
142
+ map_attribute "frame", to: :frame, namespace: nil
143
+ map_attribute "framespacing", to: :framespacing, namespace: nil
144
+ map_attribute "groupalign", to: :groupalign, namespace: nil
145
+ map_attribute "height", to: :height, namespace: nil
146
+ map_attribute "indentalign", to: :indentalign, namespace: nil
147
+ map_attribute "indentalignfirst", to: :indentalignfirst, namespace: nil
148
+ map_attribute "indentalignlast", to: :indentalignlast, namespace: nil
149
+ map_attribute "indentshift", to: :indentshift, namespace: nil
150
+ map_attribute "indentshiftfirst", to: :indentshiftfirst, namespace: nil
151
+ map_attribute "indentshiftlast", to: :indentshiftlast, namespace: nil
152
+ map_attribute "indenttarget", to: :indenttarget, namespace: nil
153
+ map_attribute "largeop", to: :largeop, namespace: nil
154
+ map_attribute "leftoverhang", to: :leftoverhang, namespace: nil
155
+ map_attribute "length", to: :length, namespace: nil
156
+ map_attribute "linebreak", to: :linebreak, namespace: nil
157
+ map_attribute "linebreakmultchar", to: :linebreakmultchar, namespace: nil
158
+ map_attribute "linebreakstyle", to: :linebreakstyle, namespace: nil
159
+ map_attribute "lineleading", to: :lineleading, namespace: nil
160
+ map_attribute "linethickness", to: :linethickness, namespace: nil
161
+ map_attribute "location", to: :location, namespace: nil
162
+ map_attribute "longdivstyle", to: :longdivstyle, namespace: nil
163
+ map_attribute "lquote", to: :lquote, namespace: nil
164
+ map_attribute "lspace", to: :lspace, namespace: nil
165
+ map_attribute "mathsize", to: :mathsize, namespace: nil
166
+ map_attribute "mathvariant", to: :mathvariant, namespace: nil
167
+ map_attribute "maxsize", to: :maxsize, namespace: nil
168
+ map_attribute "minlabelspacing", to: :minlabelspacing, namespace: nil
169
+ map_attribute "minsize", to: :minsize, namespace: nil
170
+ map_attribute "movablelimits", to: :movablelimits, namespace: nil
171
+ map_attribute "mslinethickness", to: :mslinethickness, namespace: nil
172
+ map_attribute "notation", to: :notation, namespace: nil
173
+ map_attribute "numalign", to: :numalign, namespace: nil
174
+ map_attribute "open", to: :open, namespace: nil
175
+ map_attribute "position", to: :position, namespace: nil
176
+ map_attribute "rightoverhang", to: :rightoverhang, namespace: nil
177
+ map_attribute "rowalign", to: :rowalign, namespace: nil
178
+ map_attribute "rowlines", to: :rowlines, namespace: nil
179
+ map_attribute "rowspacing", to: :rowspacing, namespace: nil
180
+ map_attribute "rowspan", to: :rowspan, namespace: nil
181
+ map_attribute "rquote", to: :rquote, namespace: nil
182
+ map_attribute "rspace", to: :rspace, namespace: nil
183
+ map_attribute "selection", to: :selection, namespace: nil
184
+ map_attribute "separator", to: :separator, namespace: nil
185
+ map_attribute "separators", to: :separators, namespace: nil
186
+ map_attribute "shift", to: :shift, namespace: nil
187
+ map_attribute "side", to: :side, namespace: nil
188
+ map_attribute "stackalign", to: :stackalign, namespace: nil
189
+ map_attribute "stretchy", to: :stretchy, namespace: nil
190
+ map_attribute "subscriptshift", to: :subscriptshift, namespace: nil
191
+ map_attribute "superscriptshift", to: :superscriptshift, namespace: nil
192
+ map_attribute "symmetric", to: :symmetric, namespace: nil
193
+ map_attribute "valign", to: :valign, namespace: nil
194
+ map_attribute "width", to: :width, namespace: nil
195
+ map_attribute "fontfamily", to: :fontfamily, namespace: nil
196
+ map_attribute "fontweight", to: :fontweight, namespace: nil
197
+ map_attribute "fontstyle", to: :fontstyle, namespace: nil
198
+ map_attribute "fontsize", to: :fontsize, namespace: nil
199
+ map_attribute "color", to: :color, namespace: nil
200
+ map_attribute "background", to: :background, namespace: nil
201
+ map_attribute "veryverythinmathspace", to: :veryverythinmathspace, namespace: nil
202
+ map_attribute "verythinmathspace", to: :verythinmathspace, namespace: nil
203
+ map_attribute "thinmathspace", to: :thinmathspace, namespace: nil
204
+ map_attribute "mediummathspace", to: :mediummathspace, namespace: nil
205
+ map_attribute "thickmathspace", to: :thickmathspace, namespace: nil
206
+ map_attribute "verythickmathspace", to: :verythickmathspace, namespace: nil
207
+ map_attribute "veryverythickmathspace", to: :veryverythickmathspace, namespace: nil
208
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
209
+ map_element tag.to_sym, to: :"#{tag}_value"
210
+ end
211
+ end
212
+ # rubocop:enable Metrics/BlockLength
213
+ end
214
+ # rubocop:enable Metrics/ClassLength
215
+ end
data/lib/mml/msub.rb ADDED
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msub < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msub)
6
+
7
+ attribute :mathbackground, :string
8
+ attribute :subscriptshift, :string
9
+ attribute :mathcolor, :string
10
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
11
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
12
+ end
13
+
14
+ xml do
15
+ root "msub", mixed: true
16
+
17
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
18
+ map_attribute "subscriptshift", to: :subscriptshift, namespace: nil
19
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
20
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
21
+ map_element tag.to_sym, to: :"#{tag}_value"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msubsup < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msubsup)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :subscriptshift, :string
10
+ attribute :superscriptshift, :string
11
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
12
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
13
+ end
14
+
15
+ xml do
16
+ root "msubsup", mixed: true
17
+
18
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
19
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
20
+ map_attribute "subscriptshift", to: :subscriptshift, namespace: nil
21
+ map_attribute "superscriptshift", to: :superscriptshift, namespace: nil
22
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
23
+ map_element tag.to_sym, to: :"#{tag}_value"
24
+ end
25
+ end
26
+ end
27
+ end
data/lib/mml/msup.rb ADDED
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msup < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msup)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :superscriptshift, :string
10
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
11
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
12
+ end
13
+
14
+ xml do
15
+ root "msup", mixed: true
16
+
17
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
18
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
19
+ map_attribute "superscriptshift", to: :superscriptshift, namespace: nil
20
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
21
+ map_element tag.to_sym, to: :"#{tag}_value"
22
+ end
23
+ end
24
+ end
25
+ end
data/lib/mml/mtable.rb ADDED
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mtable < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mtable)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :align, :string
10
+ attribute :rowalign, :string
11
+ attribute :columnalign, :string
12
+ attribute :groupalign, :string
13
+ attribute :alignmentscope, :string
14
+ attribute :columnwidth, :string
15
+ attribute :width, :string
16
+ attribute :rowspacing, :string
17
+ attribute :columnspacing, :string
18
+ attribute :rowlines, :string
19
+ attribute :columnlines, :string
20
+ attribute :frame, :string
21
+ attribute :framespacing, :string
22
+ attribute :equalrows, :string
23
+ attribute :equalcolumns, :string
24
+ attribute :displaystyle, :string
25
+ attribute :side, :string
26
+ attribute :minlabelspacing, :string
27
+ attribute :mlabeledtr_value, Mlabeledtr, collection: true
28
+ attribute :mtr_value, Mtr, collection: true
29
+
30
+ xml do
31
+ root "mtable", mixed: true
32
+
33
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
34
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
35
+ map_attribute "align", to: :align, namespace: nil
36
+ map_attribute "rowalign", to: :rowalign, namespace: nil
37
+ map_attribute "columnalign", to: :columnalign, namespace: nil
38
+ map_attribute "groupalign", to: :groupalign, namespace: nil
39
+ map_attribute "alignmentscope", to: :alignmentscope, namespace: nil
40
+ map_attribute "columnwidth", to: :columnwidth, namespace: nil
41
+ map_attribute "width", to: :width, namespace: nil
42
+ map_attribute "rowspacing", to: :rowspacing, namespace: nil
43
+ map_attribute "columnspacing", to: :columnspacing, namespace: nil
44
+ map_attribute "rowlines", to: :rowlines, namespace: nil
45
+ map_attribute "columnlines", to: :columnlines, namespace: nil
46
+ map_attribute "frame", to: :frame, namespace: nil
47
+ map_attribute "framespacing", to: :framespacing, namespace: nil
48
+ map_attribute "equalrows", to: :equalrows, namespace: nil
49
+ map_attribute "equalcolumns", to: :equalcolumns, namespace: nil
50
+ map_attribute "displaystyle", to: :displaystyle, namespace: nil
51
+ map_attribute "side", to: :side, namespace: nil
52
+ map_attribute "minlabelspacing", to: :minlabelspacing, namespace: nil
53
+ map_element "mlabeledtr", to: :mlabeledtr_value
54
+ map_element "mtr", to: :mtr_value
55
+ end
56
+ end
57
+ end
data/lib/mml/mtd.rb ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mtd < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mtd)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :rowalign, :string
10
+ attribute :columnalign, :string
11
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
12
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
13
+ end
14
+
15
+ xml do
16
+ root "mtd", mixed: true
17
+
18
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
19
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
20
+ map_attribute "rowalign", to: :rowalign, namespace: nil
21
+ map_attribute "columnalign", to: :columnalign, namespace: nil
22
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
23
+ map_element tag.to_sym, to: :"#{tag}_value"
24
+ end
25
+ end
26
+ end
27
+ end
data/lib/mml/mtext.rb ADDED
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mtext < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mtext)
6
+
7
+ attribute :value, :string
8
+ attribute :mathcolor, :string
9
+ attribute :mathbackground, :string
10
+ attribute :mathvariant, :string
11
+ attribute :mathsize, :string
12
+ attribute :dir, :string
13
+ attribute :fontfamily, :string
14
+ attribute :fontweight, :string
15
+ attribute :fontstyle, :string
16
+ attribute :fontsize, :string
17
+ attribute :color, :string
18
+ attribute :background, :string
19
+
20
+ xml do
21
+ root "mtext"
22
+
23
+ map_content to: :value
24
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
25
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
26
+ map_attribute "mathvariant", to: :mathvariant, namespace: nil
27
+ map_attribute "mathsize", to: :mathsize, namespace: nil
28
+ map_attribute "dir", to: :dir, namespace: nil
29
+ map_attribute "fontfamily", to: :fontfamily, namespace: nil
30
+ map_attribute "fontweight", to: :fontweight, namespace: nil
31
+ map_attribute "fontstyle", to: :fontstyle, namespace: nil
32
+ map_attribute "fontsize", to: :fontsize, namespace: nil
33
+ map_attribute "color", to: :color, namespace: nil
34
+ map_attribute "background", to: :background, namespace: nil
35
+ end
36
+ end
37
+ end
data/lib/mml/mtr.rb ADDED
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mtr < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mtr)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :rowalign, :string
10
+ attribute :columnalign, :string
11
+ attribute :groupalign, :string
12
+ attribute :mtd_value, Mtd, collection: true
13
+
14
+ xml do
15
+ root "mtr", mixed: true
16
+
17
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
18
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
19
+ map_attribute "rowalign", to: :rowalign, namespace: nil
20
+ map_attribute "columnalign", to: :columnalign, namespace: nil
21
+ map_attribute "groupalign", to: :groupalign, namespace: nil
22
+ map_element "mtd", to: :mtd_value
23
+ end
24
+ end
25
+ end
data/lib/mml/munder.rb ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Munder < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:munder)
6
+
7
+ attribute :mathbackground, :string
8
+ attribute :accentunder, :string
9
+ attribute :mathcolor, :string
10
+ attribute :content, :string
11
+ attribute :align, :string
12
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
13
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
14
+ end
15
+
16
+ xml do
17
+ root "munder", mixed: true
18
+
19
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
20
+ map_attribute "accentunder", to: :accentunder, namespace: nil
21
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
22
+ map_attribute "align", to: :align, namespace: nil
23
+ map_content to: :content
24
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
25
+ map_element tag.to_sym, to: :"#{tag}_value"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Munderover < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:munderover)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :accent, :string
10
+ attribute :accentunder, :string
11
+ attribute :align, :string
12
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
13
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
14
+ end
15
+
16
+ xml do
17
+ root "munderover", mixed: true
18
+
19
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
20
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
21
+ map_attribute "accent", to: :accent, namespace: nil
22
+ map_attribute "accentunder", to: :accentunder, namespace: nil
23
+ map_attribute "align", to: :align, namespace: nil
24
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
25
+ map_element tag.to_sym, to: :"#{tag}_value"
26
+ end
27
+ end
28
+ end
29
+ end
data/lib/mml/none.rb ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class None < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:none)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+
10
+ xml do
11
+ root "none"
12
+
13
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
14
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Semantics < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:semantics)
6
+
7
+ attribute :annotation, Mml::Mi, collection: true
8
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
9
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
10
+ end
11
+
12
+ xml do
13
+ root "semantics", mixed: true
14
+
15
+ map_element :annotation, to: :annotation
16
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
17
+ map_element tag.to_sym, to: :"#{tag}_value"
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/mml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mml
4
- VERSION = "0.1.0"
4
+ VERSION = "1.0.0"
5
5
  end
data/lib/mml.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "mml/version"
3
+ require "zeitwerk"
4
+ require "lutaml/model"
5
+ require_relative "mml/mml"
4
6
 
5
- module Mml
6
- class Error < StandardError; end
7
- # Your code goes here...
8
- end
7
+ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
8
+ loader.ignore("#{__dir__}/lib/mml.rb")
9
+ loader.setup
data/mml.gemspec CHANGED
@@ -30,5 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_runtime_dependency "lutaml-model"
33
+ spec.add_runtime_dependency "lutaml-model", "~> 0.3"
34
+ spec.add_runtime_dependency "zeitwerk"
34
35
  end