mml 2.2.1 → 2.3.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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +14 -4
  3. data/CLAUDE.md +79 -0
  4. data/README.adoc +166 -43
  5. data/lib/mml/base/deprecated_font_attributes.rb +31 -0
  6. data/lib/mml/base/maction.rb +28 -0
  7. data/lib/mml/base/maligngroup.rb +26 -0
  8. data/lib/mml/base/malignmark.rb +26 -0
  9. data/lib/mml/base/math.rb +23 -0
  10. data/lib/mml/base/menclose.rb +27 -0
  11. data/lib/mml/base/merror.rb +25 -0
  12. data/lib/mml/base/mfenced.rb +34 -0
  13. data/lib/mml/base/mfrac.rb +33 -0
  14. data/lib/mml/base/mfraction.rb +33 -0
  15. data/lib/mml/base/mglyph.rb +42 -0
  16. data/lib/mml/base/mi.rb +32 -0
  17. data/lib/mml/base/mlabeledtr.rb +37 -0
  18. data/lib/mml/base/mlongdiv.rb +31 -0
  19. data/lib/mml/base/mmultiscripts.rb +31 -0
  20. data/lib/mml/base/mn.rb +32 -0
  21. data/lib/mml/base/mo.rb +76 -0
  22. data/lib/mml/base/mover.rb +29 -0
  23. data/lib/mml/base/mpadded.rb +35 -0
  24. data/lib/mml/base/mphantom.rb +25 -0
  25. data/lib/mml/base/mprescripts.rb +24 -0
  26. data/lib/mml/base/mroot.rb +25 -0
  27. data/lib/mml/base/mrow.rb +29 -0
  28. data/lib/mml/base/ms.rb +37 -0
  29. data/lib/mml/base/mscarries.rb +33 -0
  30. data/lib/mml/base/mscarry.rb +29 -0
  31. data/lib/mml/base/msgroup.rb +31 -0
  32. data/lib/mml/base/msline.rb +34 -0
  33. data/lib/mml/base/mspace.rb +52 -0
  34. data/lib/mml/base/msqrt.rb +25 -0
  35. data/lib/mml/base/msrow.rb +27 -0
  36. data/lib/mml/base/mstack.rb +33 -0
  37. data/lib/mml/base/mstyle.rb +189 -0
  38. data/lib/mml/base/msub.rb +27 -0
  39. data/lib/mml/base/msubsup.rb +29 -0
  40. data/lib/mml/base/msup.rb +27 -0
  41. data/lib/mml/base/mtable.rb +57 -0
  42. data/lib/mml/base/mtd.rb +29 -0
  43. data/lib/mml/base/mtext.rb +32 -0
  44. data/lib/mml/base/mtr.rb +35 -0
  45. data/lib/mml/base/munder.rb +31 -0
  46. data/lib/mml/base/munderover.rb +31 -0
  47. data/lib/mml/base/none.rb +24 -0
  48. data/lib/mml/base/semantics.rb +23 -0
  49. data/lib/mml/base/v3_only/operator_attrs.rb +24 -0
  50. data/lib/mml/base/v3_only/style_attrs.rb +31 -0
  51. data/lib/mml/base/v3_only/table_attrs.rb +28 -0
  52. data/lib/mml/base/v3_only.rb +11 -0
  53. data/lib/mml/base/v4_attributes.rb +30 -0
  54. data/lib/mml/base.rb +51 -0
  55. data/lib/mml/common_elements.rb +85 -0
  56. data/lib/mml/context_configuration.rb +118 -0
  57. data/lib/mml/context_options.rb +64 -0
  58. data/lib/mml/namespace.rb +10 -0
  59. data/lib/mml/v3/common_elements.rb +8 -0
  60. data/lib/mml/v3/configuration.rb +4 -96
  61. data/lib/mml/v3/maction.rb +2 -14
  62. data/lib/mml/v3/maligngroup.rb +2 -12
  63. data/lib/mml/v3/malignmark.rb +2 -12
  64. data/lib/mml/v3/math.rb +3 -10
  65. data/lib/mml/v3/menclose.rb +3 -14
  66. data/lib/mml/v3/merror.rb +3 -12
  67. data/lib/mml/v3/mfenced.rb +3 -21
  68. data/lib/mml/v3/mfrac.rb +3 -20
  69. data/lib/mml/v3/mfraction.rb +3 -20
  70. data/lib/mml/v3/mglyph.rb +3 -38
  71. data/lib/mml/v3/mi.rb +3 -30
  72. data/lib/mml/v3/mlabeledtr.rb +2 -23
  73. data/lib/mml/v3/mlongdiv.rb +3 -18
  74. data/lib/mml/v3/mmultiscripts.rb +3 -20
  75. data/lib/mml/v3/mn.rb +3 -30
  76. data/lib/mml/v3/mo.rb +4 -78
  77. data/lib/mml/v3/mover.rb +3 -16
  78. data/lib/mml/v3/mpadded.rb +3 -22
  79. data/lib/mml/v3/mphantom.rb +3 -12
  80. data/lib/mml/v3/mprescripts.rb +2 -10
  81. data/lib/mml/v3/mroot.rb +3 -12
  82. data/lib/mml/v3/mrow.rb +3 -18
  83. data/lib/mml/v3/ms.rb +4 -36
  84. data/lib/mml/v3/mscarries.rb +3 -20
  85. data/lib/mml/v3/mscarry.rb +3 -16
  86. data/lib/mml/v3/msgroup.rb +3 -18
  87. data/lib/mml/v3/msline.rb +2 -20
  88. data/lib/mml/v3/mspace.rb +3 -50
  89. data/lib/mml/v3/msqrt.rb +3 -12
  90. data/lib/mml/v3/msrow.rb +3 -14
  91. data/lib/mml/v3/mstack.rb +3 -20
  92. data/lib/mml/v3/mstyle.rb +5 -204
  93. data/lib/mml/v3/msub.rb +3 -14
  94. data/lib/mml/v3/msubsup.rb +3 -16
  95. data/lib/mml/v3/msup.rb +3 -14
  96. data/lib/mml/v3/mtable.rb +3 -53
  97. data/lib/mml/v3/mtd.rb +3 -16
  98. data/lib/mml/v3/mtext.rb +3 -30
  99. data/lib/mml/v3/mtr.rb +2 -21
  100. data/lib/mml/v3/munder.rb +3 -18
  101. data/lib/mml/v3/munderover.rb +3 -18
  102. data/lib/mml/v3/namespace.rb +1 -4
  103. data/lib/mml/v3/none.rb +2 -10
  104. data/lib/mml/v3/semantics.rb +3 -12
  105. data/lib/mml/v3.rb +51 -77
  106. data/lib/mml/v4/a.rb +4 -13
  107. data/lib/mml/v4/common_elements.rb +13 -0
  108. data/lib/mml/v4/configuration.rb +4 -97
  109. data/lib/mml/v4/maction.rb +4 -19
  110. data/lib/mml/v4/maligngroup.rb +4 -17
  111. data/lib/mml/v4/malignmark.rb +4 -17
  112. data/lib/mml/v4/math.rb +4 -14
  113. data/lib/mml/v4/menclose.rb +4 -18
  114. data/lib/mml/v4/merror.rb +4 -16
  115. data/lib/mml/v4/mfenced.rb +4 -25
  116. data/lib/mml/v4/mfrac.rb +4 -24
  117. data/lib/mml/v4/mfraction.rb +4 -20
  118. data/lib/mml/v4/mglyph.rb +4 -35
  119. data/lib/mml/v4/mi.rb +4 -30
  120. data/lib/mml/v4/mlabeledtr.rb +6 -23
  121. data/lib/mml/v4/mlongdiv.rb +4 -18
  122. data/lib/mml/v4/mmultiscripts.rb +4 -24
  123. data/lib/mml/v4/mn.rb +4 -29
  124. data/lib/mml/v4/mo.rb +4 -75
  125. data/lib/mml/v4/mover.rb +4 -20
  126. data/lib/mml/v4/mpadded.rb +4 -26
  127. data/lib/mml/v4/mphantom.rb +4 -16
  128. data/lib/mml/v4/mprescripts.rb +4 -11
  129. data/lib/mml/v4/mroot.rb +4 -16
  130. data/lib/mml/v4/mrow.rb +4 -20
  131. data/lib/mml/v4/ms.rb +4 -34
  132. data/lib/mml/v4/mscarries.rb +4 -20
  133. data/lib/mml/v4/mscarry.rb +4 -16
  134. data/lib/mml/v4/msgroup.rb +4 -18
  135. data/lib/mml/v4/msline.rb +4 -21
  136. data/lib/mml/v4/mspace.rb +4 -49
  137. data/lib/mml/v4/msqrt.rb +4 -16
  138. data/lib/mml/v4/msrow.rb +4 -18
  139. data/lib/mml/v4/mstack.rb +4 -24
  140. data/lib/mml/v4/mstyle.rb +4 -186
  141. data/lib/mml/v4/msub.rb +4 -18
  142. data/lib/mml/v4/msubsup.rb +4 -20
  143. data/lib/mml/v4/msup.rb +4 -18
  144. data/lib/mml/v4/mtable.rb +4 -55
  145. data/lib/mml/v4/mtd.rb +4 -20
  146. data/lib/mml/v4/mtext.rb +4 -29
  147. data/lib/mml/v4/mtr.rb +4 -25
  148. data/lib/mml/v4/munder.rb +4 -22
  149. data/lib/mml/v4/munderover.rb +4 -22
  150. data/lib/mml/v4/namespace.rb +1 -4
  151. data/lib/mml/v4/none.rb +6 -11
  152. data/lib/mml/v4/semantics.rb +4 -12
  153. data/lib/mml/v4.rb +52 -74
  154. data/lib/mml/version.rb +1 -1
  155. data/lib/mml/versioned_parser.rb +46 -0
  156. data/lib/mml.rb +34 -6
  157. metadata +60 -4
  158. data/lib/mml/v3/common_attributes.rb +0 -22
  159. data/lib/mml/v4/common_attributes.rb +0 -26
@@ -3,18 +3,8 @@
3
3
  module Mml
4
4
  module V3
5
5
  class Malignmark < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
- attribute :edge, :string
9
-
10
- xml do
11
- namespace Namespace
12
- element "malignmark"
13
-
14
- map_attribute "mathcolor", to: :mathcolor
15
- map_attribute "mathbackground", to: :mathbackground
16
- map_attribute "edge", to: :edge
17
- end
6
+ include Base::Malignmark
18
7
  end
8
+ Configuration.register_model(Malignmark, id: :malignmark)
19
9
  end
20
10
  end
data/lib/mml/v3/math.rb CHANGED
@@ -2,17 +2,10 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Math < Lutaml::Model::Serializable
6
- attribute :display, :string
7
-
8
- xml do
9
- namespace Namespace
10
- element "math"
11
- mixed_content
12
-
13
- map_attribute :display, to: :display
14
- end
5
+ class Math < CommonElements
6
+ include Base::Math
15
7
  end
8
+ Configuration.register_model(Math, id: :math)
16
9
 
17
10
  # For backward compatibility, we keep MathWithNamespace as an alias to Math.
18
11
  MathWithNamespace = Math
@@ -2,20 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Menclose < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
- attribute :notation, :string
9
-
10
- xml do
11
- namespace Namespace
12
- element "menclose"
13
- mixed_content
14
-
15
- map_attribute "mathcolor", to: :mathcolor
16
- map_attribute "mathbackground", to: :mathbackground
17
- map_attribute "notation", to: :notation
18
- end
5
+ class Menclose < CommonElements
6
+ include Base::Menclose
19
7
  end
8
+ Configuration.register_model(Menclose, id: :menclose)
20
9
  end
21
10
  end
data/lib/mml/v3/merror.rb CHANGED
@@ -2,18 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Merror < Lutaml::Model::Serializable
6
- attribute :mathbackground, :string
7
- attribute :mathcolor, :string
8
-
9
- xml do
10
- namespace Namespace
11
- element "merror"
12
- mixed_content
13
-
14
- map_attribute "mathcolor", to: :mathcolor
15
- map_attribute "mathbackground", to: :mathbackground
16
- end
5
+ class Merror < CommonElements
6
+ include Base::Merror
17
7
  end
8
+ Configuration.register_model(Merror, id: :merror)
18
9
  end
19
10
  end
@@ -2,27 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mfenced < Lutaml::Model::Serializable
6
- attribute :mathbackground, :string
7
- attribute :separators, :string
8
- attribute :mathcolor, :string
9
- attribute :content, :string
10
- attribute :close, :string
11
- attribute :open, :string
12
-
13
- xml do
14
- namespace Namespace
15
- element "mfenced"
16
- mixed_content
17
-
18
- map_content to: :content
19
-
20
- map_attribute "mathbackground", to: :mathbackground
21
- map_attribute "separators", to: :separators
22
- map_attribute "mathcolor", to: :mathcolor
23
- map_attribute "close", to: :close
24
- map_attribute "open", to: :open
25
- end
5
+ class Mfenced < CommonElements
6
+ include Base::Mfenced
26
7
  end
8
+ Configuration.register_model(Mfenced, id: :mfenced)
27
9
  end
28
10
  end
data/lib/mml/v3/mfrac.rb CHANGED
@@ -2,26 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mfrac < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
- attribute :linethickness, :string
9
- attribute :numalign, :string
10
- attribute :denomalign, :string
11
- attribute :bevelled, :string
12
-
13
- xml do
14
- namespace Namespace
15
- element "mfrac"
16
- mixed_content
17
-
18
- map_attribute "mathcolor", to: :mathcolor
19
- map_attribute "mathbackground", to: :mathbackground
20
- map_attribute "linethickness", to: :linethickness
21
- map_attribute "numalign", to: :numalign
22
- map_attribute "denomalign", to: :denomalign
23
- map_attribute "bevelled", to: :bevelled
24
- end
5
+ class Mfrac < CommonElements
6
+ include Base::Mfrac
25
7
  end
8
+ Configuration.register_model(Mfrac, id: :mfrac)
26
9
  end
27
10
  end
@@ -2,26 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mfraction < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
- attribute :linethickness, :string
9
- attribute :numalign, :string
10
- attribute :denomalign, :string
11
- attribute :bevelled, :string
12
-
13
- xml do
14
- namespace Namespace
15
- element "mfraction"
16
- mixed_content
17
-
18
- map_attribute "mathcolor", to: :mathcolor
19
- map_attribute "mathbackground", to: :mathbackground
20
- map_attribute "linethickness", to: :linethickness
21
- map_attribute "numalign", to: :numalign
22
- map_attribute "denomalign", to: :denomalign
23
- map_attribute "bevelled", to: :bevelled
24
- end
5
+ class Mfraction < CommonElements
6
+ include Base::Mfraction
25
7
  end
8
+ Configuration.register_model(Mfraction, id: :mfraction)
26
9
  end
27
10
  end
data/lib/mml/v3/mglyph.rb CHANGED
@@ -3,44 +3,9 @@
3
3
  module Mml
4
4
  module V3
5
5
  class Mglyph < Lutaml::Model::Serializable
6
- attribute :alt, :string
7
- attribute :src, :string
8
- attribute :width, :string
9
- attribute :color, :string
10
- attribute :index, :integer
11
- attribute :height, :string
12
- attribute :valign, :string
13
- attribute :mathsize, :string
14
- attribute :fontsize, :string
15
- attribute :fontstyle, :string
16
- attribute :mathcolor, :string
17
- attribute :fontfamily, :string
18
- attribute :fontweight, :string
19
- attribute :background, :string
20
- attribute :mathvariant, :string
21
- attribute :mathbackground, :string
22
-
23
- xml do
24
- namespace Namespace
25
- element "mglyph"
26
-
27
- map_attribute "src", to: :src
28
- map_attribute "alt", to: :alt
29
- map_attribute "color", to: :color
30
- map_attribute "index", to: :index
31
- map_attribute "width", to: :width
32
- map_attribute "height", to: :height
33
- map_attribute "valign", to: :valign
34
- map_attribute "mathsize", to: :mathsize
35
- map_attribute "fontsize", to: :fontsize
36
- map_attribute "fontstyle", to: :fontstyle
37
- map_attribute "mathcolor", to: :mathcolor
38
- map_attribute "background", to: :background
39
- map_attribute "fontfamily", to: :fontfamily
40
- map_attribute "fontweight", to: :fontweight
41
- map_attribute "mathvariant", to: :mathvariant
42
- map_attribute "mathbackground", to: :mathbackground
43
- end
6
+ include Base::Mglyph
7
+ include Base::DeprecatedFontAttributes
44
8
  end
9
+ Configuration.register_model(Mglyph, id: :mglyph)
45
10
  end
46
11
  end
data/lib/mml/v3/mi.rb CHANGED
@@ -3,36 +3,9 @@
3
3
  module Mml
4
4
  module V3
5
5
  class Mi < Lutaml::Model::Serializable
6
- attribute :dir, :string
7
- attribute :value, :string
8
- attribute :color, :string
9
- attribute :mathsize, :string
10
- attribute :fontsize, :string
11
- attribute :fontstyle, :string
12
- attribute :mathcolor, :string
13
- attribute :background, :string
14
- attribute :fontfamily, :string
15
- attribute :fontweight, :string
16
- attribute :mathvariant, :string
17
- attribute :mathbackground, :string
18
-
19
- xml do
20
- namespace Namespace
21
- element "mi"
22
-
23
- map_content to: :value
24
- map_attribute "dir", to: :dir
25
- map_attribute "color", to: :color
26
- map_attribute "mathsize", to: :mathsize
27
- map_attribute "fontsize", to: :fontsize
28
- map_attribute "fontstyle", to: :fontstyle
29
- map_attribute "mathcolor", to: :mathcolor
30
- map_attribute "fontfamily", to: :fontfamily
31
- map_attribute "fontweight", to: :fontweight
32
- map_attribute "background", to: :background
33
- map_attribute "mathvariant", to: :mathvariant
34
- map_attribute "mathbackground", to: :mathbackground
35
- end
6
+ include Base::Mi
7
+ include Base::DeprecatedFontAttributes
36
8
  end
9
+ Configuration.register_model(Mi, id: :mi)
37
10
  end
38
11
  end
@@ -2,30 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- autoload(:Mtd, "mml/v3/mtd")
6
-
7
5
  class Mlabeledtr < Lutaml::Model::Serializable
8
- attribute :mathbackground, :string
9
- attribute :columnalign, :string
10
- attribute :groupalign, :string
11
- attribute :mathcolor, :string
12
- attribute :rowalign, :string
13
- attribute :id, :string
14
- attribute :mtd_value, Mtd, collection: true
15
-
16
- xml do
17
- namespace Namespace
18
- element "mlabeledtr"
19
- mixed_content
20
-
21
- map_attribute "mathbackground", to: :mathbackground
22
- map_attribute "columnalign", to: :columnalign
23
- map_attribute "groupalign", to: :groupalign
24
- map_attribute "mathcolor", to: :mathcolor
25
- map_attribute "rowalign", to: :rowalign
26
- map_attribute "id", to: :id
27
- map_element "mtd", to: :mtd_value
28
- end
6
+ include Base::Mlabeledtr
29
7
  end
8
+ Configuration.register_model(Mlabeledtr, id: :mlabeledtr)
30
9
  end
31
10
  end
@@ -2,24 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mlongdiv < Lutaml::Model::Serializable
6
- attribute :mathbackground, :string
7
- attribute :longdivstyle, :string
8
- attribute :mathcolor, :string
9
- attribute :position, :integer
10
- attribute :shift, :integer
11
-
12
- xml do
13
- namespace Namespace
14
- element "mlongdiv"
15
- mixed_content
16
-
17
- map_attribute "mathbackground", to: :mathbackground
18
- map_attribute "longdivstyle", to: :longdivstyle
19
- map_attribute "mathcolor", to: :mathcolor
20
- map_attribute "position", to: :position
21
- map_attribute "shift", to: :shift
22
- end
5
+ class Mlongdiv < CommonElements
6
+ include Base::Mlongdiv
23
7
  end
8
+ Configuration.register_model(Mlongdiv, id: :mlongdiv)
24
9
  end
25
10
  end
@@ -2,26 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- autoload(:Mprescripts, "mml/v3/mprescripts")
6
-
7
- class Mmultiscripts < Lutaml::Model::Serializable
8
- attribute :mathcolor, :string
9
- attribute :mathbackground, :string
10
- attribute :subscriptshift, :string
11
- attribute :superscriptshift, :string
12
- attribute :mprescripts_value, Mprescripts
13
-
14
- xml do
15
- namespace Namespace
16
- element "mmultiscripts"
17
- mixed_content
18
-
19
- map_attribute "mathcolor", to: :mathcolor
20
- map_attribute "mathbackground", to: :mathbackground
21
- map_attribute "subscriptshift", to: :subscriptshift
22
- map_attribute "superscriptshift", to: :superscriptshift
23
- map_element "mprescripts", to: :mprescripts_value
24
- end
5
+ class Mmultiscripts < CommonElements
6
+ include Base::Mmultiscripts
25
7
  end
8
+ Configuration.register_model(Mmultiscripts, id: :mmultiscripts)
26
9
  end
27
10
  end
data/lib/mml/v3/mn.rb CHANGED
@@ -3,36 +3,9 @@
3
3
  module Mml
4
4
  module V3
5
5
  class Mn < Lutaml::Model::Serializable
6
- attribute :value, :string
7
- attribute :mathcolor, :string
8
- attribute :mathbackground, :string
9
- attribute :mathvariant, :string
10
- attribute :mathsize, :string
11
- attribute :dir, :string
12
- attribute :fontfamily, :string
13
- attribute :fontweight, :string
14
- attribute :fontstyle, :string
15
- attribute :fontsize, :string
16
- attribute :color, :string
17
- attribute :background, :string
18
-
19
- xml do
20
- namespace Namespace
21
- element "mn"
22
-
23
- map_content to: :value
24
- map_attribute "mathcolor", to: :mathcolor
25
- map_attribute "mathbackground", to: :mathbackground
26
- map_attribute "mathvariant", to: :mathvariant
27
- map_attribute "mathsize", to: :mathsize
28
- map_attribute "dir", to: :dir
29
- map_attribute "fontfamily", to: :fontfamily
30
- map_attribute "fontweight", to: :fontweight
31
- map_attribute "fontstyle", to: :fontstyle
32
- map_attribute "fontsize", to: :fontsize
33
- map_attribute "color", to: :color
34
- map_attribute "background", to: :background
35
- end
6
+ include Base::Mn
7
+ include Base::DeprecatedFontAttributes
36
8
  end
9
+ Configuration.register_model(Mn, id: :mn)
37
10
  end
38
11
  end
data/lib/mml/v3/mo.rb CHANGED
@@ -3,84 +3,10 @@
3
3
  module Mml
4
4
  module V3
5
5
  class Mo < Lutaml::Model::Serializable
6
- attribute :value, :string
7
- attribute :mathcolor, :string
8
- attribute :mathbackground, :string
9
- attribute :mathvariant, :string
10
- attribute :mathsize, :string
11
- attribute :dir, :string
12
- attribute :fontfamily, :string
13
- attribute :fontweight, :string
14
- attribute :fontstyle, :string
15
- attribute :fontsize, :string
16
- attribute :color, :string
17
- attribute :background, :string
18
- attribute :form, :string
19
- attribute :fence, :string
20
- attribute :separator, :string
21
- attribute :lspace, :string
22
- attribute :rspace, :string
23
- attribute :stretchy, :string
24
- attribute :symmetric, :string
25
- attribute :maxsize, :string
26
- attribute :minsize, :string
27
- attribute :largeop, :string
28
- attribute :movablelimits, :string
29
- attribute :accent, :string
30
- attribute :linebreak, :string
31
- attribute :lineleading, :string
32
- attribute :linebreakstyle, :string
33
- attribute :linebreakmultchar, :string
34
- attribute :indentalign, :string
35
- attribute :indentshift, :string
36
- attribute :indenttarget, :string
37
- attribute :indentalignfirst, :string
38
- attribute :indentshiftfirst, :string
39
- attribute :indentalignlast, :string
40
- attribute :indentshiftlast, :string
41
-
42
- # rubocop:disable Metrics/BlockLength
43
- xml do
44
- namespace Namespace
45
- element "mo"
46
-
47
- map_content to: :value
48
- map_attribute "dir", to: :dir
49
- map_attribute "form", to: :form
50
- map_attribute "fence", to: :fence
51
- map_attribute "color", to: :color
52
- map_attribute "accent", to: :accent
53
- map_attribute "lspace", to: :lspace
54
- map_attribute "rspace", to: :rspace
55
- map_attribute "maxsize", to: :maxsize
56
- map_attribute "minsize", to: :minsize
57
- map_attribute "largeop", to: :largeop
58
- map_attribute "stretchy", to: :stretchy
59
- map_attribute "mathsize", to: :mathsize
60
- map_attribute "fontsize", to: :fontsize
61
- map_attribute "linebreak", to: :linebreak
62
- map_attribute "fontstyle", to: :fontstyle
63
- map_attribute "separator", to: :separator
64
- map_attribute "symmetric", to: :symmetric
65
- map_attribute "mathcolor", to: :mathcolor
66
- map_attribute "fontfamily", to: :fontfamily
67
- map_attribute "fontweight", to: :fontweight
68
- map_attribute "background", to: :background
69
- map_attribute "mathvariant", to: :mathvariant
70
- map_attribute "lineleading", to: :lineleading
71
- map_attribute "indentalign", to: :indentalign
72
- map_attribute "indentshift", to: :indentshift
73
- map_attribute "indenttarget", to: :indenttarget
74
- map_attribute "movablelimits", to: :movablelimits
75
- map_attribute "linebreakstyle", to: :linebreakstyle
76
- map_attribute "mathbackground", to: :mathbackground
77
- map_attribute "indentalignlast", to: :indentalignlast
78
- map_attribute "indentshiftlast", to: :indentshiftlast
79
- map_attribute "indentalignfirst", to: :indentalignfirst
80
- map_attribute "indentshiftfirst", to: :indentshiftfirst
81
- map_attribute "linebreakmultchar", to: :linebreakmultchar
82
- end
83
- # rubocop:enable Metrics/BlockLength
6
+ include Base::Mo
7
+ include Base::DeprecatedFontAttributes
8
+ include Base::V3Only::OperatorAttributes
84
9
  end
10
+ Configuration.register_model(Mo, id: :mo)
85
11
  end
86
12
  end
data/lib/mml/v3/mover.rb CHANGED
@@ -2,22 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mover < Lutaml::Model::Serializable
6
- attribute :mathbackground, :string
7
- attribute :mathcolor, :string
8
- attribute :accent, :string
9
- attribute :align, :string
10
-
11
- xml do
12
- namespace Namespace
13
- element "mover"
14
- mixed_content
15
-
16
- map_attribute "mathbackground", to: :mathbackground
17
- map_attribute "mathcolor", to: :mathcolor
18
- map_attribute "accent", to: :accent
19
- map_attribute "align", to: :align
20
- end
5
+ class Mover < CommonElements
6
+ include Base::Mover
21
7
  end
8
+ Configuration.register_model(Mover, id: :mover)
22
9
  end
23
10
  end
@@ -2,28 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mpadded < Lutaml::Model::Serializable
6
- attribute :mathbackground, :string
7
- attribute :mathcolor, :string
8
- attribute :voffset, :string
9
- attribute :height, :string
10
- attribute :lspace, :string
11
- attribute :depth, :string
12
- attribute :width, :string
13
-
14
- xml do
15
- namespace Namespace
16
- element "mpadded"
17
- mixed_content
18
-
19
- map_attribute "mathbackground", to: :mathbackground
20
- map_attribute "mathcolor", to: :mathcolor
21
- map_attribute "voffset", to: :voffset
22
- map_attribute "height", to: :height
23
- map_attribute "lspace", to: :lspace
24
- map_attribute "depth", to: :depth
25
- map_attribute "width", to: :width
26
- end
5
+ class Mpadded < CommonElements
6
+ include Base::Mpadded
27
7
  end
8
+ Configuration.register_model(Mpadded, id: :mpadded)
28
9
  end
29
10
  end
@@ -2,18 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mphantom < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
-
9
- xml do
10
- namespace Namespace
11
- element "mphantom"
12
- mixed_content
13
-
14
- map_attribute "mathcolor", to: :mathcolor
15
- map_attribute "mathbackground", to: :mathbackground
16
- end
5
+ class Mphantom < CommonElements
6
+ include Base::Mphantom
17
7
  end
8
+ Configuration.register_model(Mphantom, id: :mphantom)
18
9
  end
19
10
  end
@@ -3,16 +3,8 @@
3
3
  module Mml
4
4
  module V3
5
5
  class Mprescripts < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
-
9
- xml do
10
- namespace Namespace
11
- element "mprescripts"
12
-
13
- map_attribute "mathcolor", to: :mathcolor
14
- map_attribute "mathbackground", to: :mathbackground
15
- end
6
+ include Base::Mprescripts
16
7
  end
8
+ Configuration.register_model(Mprescripts, id: :mprescripts)
17
9
  end
18
10
  end
data/lib/mml/v3/mroot.rb CHANGED
@@ -2,18 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mroot < Lutaml::Model::Serializable
6
- attribute :mathcolor, :string
7
- attribute :mathbackground, :string
8
-
9
- xml do
10
- namespace Namespace
11
- element "mroot"
12
- mixed_content
13
-
14
- map_attribute "mathcolor", to: :mathcolor
15
- map_attribute "mathbackground", to: :mathbackground
16
- end
5
+ class Mroot < CommonElements
6
+ include Base::Mroot
17
7
  end
8
+ Configuration.register_model(Mroot, id: :mroot)
18
9
  end
19
10
  end
data/lib/mml/v3/mrow.rb CHANGED
@@ -2,24 +2,9 @@
2
2
 
3
3
  module Mml
4
4
  module V3
5
- class Mrow < Lutaml::Model::Serializable
6
- attribute :mathbackground, :string
7
- attribute :mathcolor, :string
8
- attribute :content, :string
9
- attribute :intent, :string
10
- attribute :dir, :string
11
-
12
- xml do
13
- namespace Namespace
14
- element "mrow"
15
- mixed_content
16
-
17
- map_content to: :content
18
- map_attribute "dir", to: :dir
19
- map_attribute "intent", to: :intent
20
- map_attribute "mathcolor", to: :mathcolor
21
- map_attribute "mathbackground", to: :mathbackground
22
- end
5
+ class Mrow < CommonElements
6
+ include Base::Mrow
23
7
  end
8
+ Configuration.register_model(Mrow, id: :mrow)
24
9
  end
25
10
  end