mml 2.1.0 → 2.2.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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +14 -22
  3. data/README.adoc +205 -153
  4. data/lib/mml/v3/common_attributes.rb +22 -0
  5. data/lib/mml/v3/configuration.rb +105 -0
  6. data/lib/mml/v3/maction.rb +22 -0
  7. data/lib/mml/v3/maligngroup.rb +20 -0
  8. data/lib/mml/v3/malignmark.rb +20 -0
  9. data/lib/mml/v3/math.rb +20 -0
  10. data/lib/mml/v3/menclose.rb +21 -0
  11. data/lib/mml/v3/merror.rb +19 -0
  12. data/lib/mml/v3/mfenced.rb +28 -0
  13. data/lib/mml/v3/mfrac.rb +27 -0
  14. data/lib/mml/v3/mfraction.rb +27 -0
  15. data/lib/mml/v3/mglyph.rb +46 -0
  16. data/lib/mml/v3/mi.rb +38 -0
  17. data/lib/mml/v3/mlabeledtr.rb +31 -0
  18. data/lib/mml/v3/mlongdiv.rb +25 -0
  19. data/lib/mml/v3/mmultiscripts.rb +27 -0
  20. data/lib/mml/v3/mn.rb +38 -0
  21. data/lib/mml/v3/mo.rb +86 -0
  22. data/lib/mml/v3/mover.rb +23 -0
  23. data/lib/mml/v3/mpadded.rb +29 -0
  24. data/lib/mml/v3/mphantom.rb +19 -0
  25. data/lib/mml/v3/mprescripts.rb +18 -0
  26. data/lib/mml/v3/mroot.rb +19 -0
  27. data/lib/mml/v3/mrow.rb +25 -0
  28. data/lib/mml/v3/ms.rb +43 -0
  29. data/lib/mml/v3/mscarries.rb +27 -0
  30. data/lib/mml/v3/mscarry.rb +23 -0
  31. data/lib/mml/v3/msgroup.rb +25 -0
  32. data/lib/mml/v3/msline.rb +28 -0
  33. data/lib/mml/v3/mspace.rb +58 -0
  34. data/lib/mml/v3/msqrt.rb +19 -0
  35. data/lib/mml/v3/msrow.rb +21 -0
  36. data/lib/mml/v3/mstack.rb +27 -0
  37. data/lib/mml/v3/mstyle.rb +211 -0
  38. data/lib/mml/v3/msub.rb +21 -0
  39. data/lib/mml/v3/msubsup.rb +23 -0
  40. data/lib/mml/v3/msup.rb +21 -0
  41. data/lib/mml/v3/mtable.rb +61 -0
  42. data/lib/mml/v3/mtd.rb +23 -0
  43. data/lib/mml/v3/mtext.rb +38 -0
  44. data/lib/mml/v3/mtr.rb +29 -0
  45. data/lib/mml/v3/munder.rb +25 -0
  46. data/lib/mml/v3/munderover.rb +25 -0
  47. data/lib/mml/v3/namespace.rb +10 -0
  48. data/lib/mml/v3/none.rb +18 -0
  49. data/lib/mml/v3/semantics.rb +19 -0
  50. data/lib/mml/v3/version.rb +7 -0
  51. data/lib/mml/v3.rb +85 -0
  52. data/lib/mml/v4/a.rb +31 -0
  53. data/lib/mml/v4/common_attributes.rb +26 -0
  54. data/lib/mml/v4/configuration.rb +106 -0
  55. data/lib/mml/v4/maction.rb +30 -0
  56. data/lib/mml/v4/maligngroup.rb +28 -0
  57. data/lib/mml/v4/malignmark.rb +28 -0
  58. data/lib/mml/v4/math.rb +27 -0
  59. data/lib/mml/v4/menclose.rb +29 -0
  60. data/lib/mml/v4/merror.rb +27 -0
  61. data/lib/mml/v4/mfenced.rb +36 -0
  62. data/lib/mml/v4/mfrac.rb +35 -0
  63. data/lib/mml/v4/mfraction.rb +31 -0
  64. data/lib/mml/v4/mglyph.rb +46 -0
  65. data/lib/mml/v4/mi.rb +41 -0
  66. data/lib/mml/v4/mlabeledtr.rb +34 -0
  67. data/lib/mml/v4/mlongdiv.rb +29 -0
  68. data/lib/mml/v4/mmultiscripts.rb +35 -0
  69. data/lib/mml/v4/mn.rb +40 -0
  70. data/lib/mml/v4/mo.rb +86 -0
  71. data/lib/mml/v4/mover.rb +31 -0
  72. data/lib/mml/v4/mpadded.rb +37 -0
  73. data/lib/mml/v4/mphantom.rb +27 -0
  74. data/lib/mml/v4/mprescripts.rb +22 -0
  75. data/lib/mml/v4/mroot.rb +27 -0
  76. data/lib/mml/v4/mrow.rb +31 -0
  77. data/lib/mml/v4/ms.rb +45 -0
  78. data/lib/mml/v4/mscarries.rb +31 -0
  79. data/lib/mml/v4/mscarry.rb +27 -0
  80. data/lib/mml/v4/msgroup.rb +29 -0
  81. data/lib/mml/v4/msline.rb +32 -0
  82. data/lib/mml/v4/mspace.rb +60 -0
  83. data/lib/mml/v4/msqrt.rb +27 -0
  84. data/lib/mml/v4/msrow.rb +29 -0
  85. data/lib/mml/v4/mstack.rb +35 -0
  86. data/lib/mml/v4/mstyle.rb +197 -0
  87. data/lib/mml/v4/msub.rb +29 -0
  88. data/lib/mml/v4/msubsup.rb +31 -0
  89. data/lib/mml/v4/msup.rb +29 -0
  90. data/lib/mml/v4/mtable.rb +66 -0
  91. data/lib/mml/v4/mtd.rb +31 -0
  92. data/lib/mml/v4/mtext.rb +40 -0
  93. data/lib/mml/v4/mtr.rb +36 -0
  94. data/lib/mml/v4/munder.rb +33 -0
  95. data/lib/mml/v4/munderover.rb +33 -0
  96. data/lib/mml/v4/namespace.rb +10 -0
  97. data/lib/mml/v4/none.rb +22 -0
  98. data/lib/mml/v4/opal_setup.rb.erb +6 -0
  99. data/lib/mml/v4/semantics.rb +23 -0
  100. data/lib/mml/v4/version.rb +7 -0
  101. data/lib/mml/v4.rb +81 -0
  102. data/lib/mml/version.rb +1 -1
  103. data/lib/mml.rb +24 -90
  104. metadata +101 -49
  105. data/lib/mml/common_attributes.rb +0 -21
  106. data/lib/mml/configuration.rb +0 -103
  107. data/lib/mml/maction.rb +0 -20
  108. data/lib/mml/maligngroup.rb +0 -18
  109. data/lib/mml/malignmark.rb +0 -18
  110. data/lib/mml/math.rb +0 -18
  111. data/lib/mml/menclose.rb +0 -19
  112. data/lib/mml/merror.rb +0 -17
  113. data/lib/mml/mfenced.rb +0 -26
  114. data/lib/mml/mfrac.rb +0 -25
  115. data/lib/mml/mfraction.rb +0 -25
  116. data/lib/mml/mglyph.rb +0 -44
  117. data/lib/mml/mi.rb +0 -36
  118. data/lib/mml/mlabeledtr.rb +0 -29
  119. data/lib/mml/mlongdiv.rb +0 -23
  120. data/lib/mml/mmultiscripts.rb +0 -25
  121. data/lib/mml/mn.rb +0 -36
  122. data/lib/mml/mo.rb +0 -84
  123. data/lib/mml/mover.rb +0 -21
  124. data/lib/mml/mpadded.rb +0 -27
  125. data/lib/mml/mphantom.rb +0 -17
  126. data/lib/mml/mprescripts.rb +0 -16
  127. data/lib/mml/mroot.rb +0 -17
  128. data/lib/mml/mrow.rb +0 -23
  129. data/lib/mml/ms.rb +0 -41
  130. data/lib/mml/mscarries.rb +0 -25
  131. data/lib/mml/mscarry.rb +0 -21
  132. data/lib/mml/msgroup.rb +0 -23
  133. data/lib/mml/msline.rb +0 -26
  134. data/lib/mml/mspace.rb +0 -56
  135. data/lib/mml/msqrt.rb +0 -17
  136. data/lib/mml/msrow.rb +0 -19
  137. data/lib/mml/mstack.rb +0 -25
  138. data/lib/mml/mstyle.rb +0 -209
  139. data/lib/mml/msub.rb +0 -19
  140. data/lib/mml/msubsup.rb +0 -21
  141. data/lib/mml/msup.rb +0 -19
  142. data/lib/mml/mtable.rb +0 -59
  143. data/lib/mml/mtd.rb +0 -21
  144. data/lib/mml/mtext.rb +0 -36
  145. data/lib/mml/mtr.rb +0 -27
  146. data/lib/mml/munder.rb +0 -23
  147. data/lib/mml/munderover.rb +0 -23
  148. data/lib/mml/namespace.rb +0 -9
  149. data/lib/mml/none.rb +0 -16
  150. data/lib/mml/semantics.rb +0 -17
  151. /data/lib/mml/{opal_setup.rb.erb → v3/opal_setup.rb.erb} +0 -0
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
5
+ module Configuration
6
+ SUPPORTED_TAGS = %i[
7
+ mmultiscripts
8
+ maligngroup
9
+ malignmark
10
+ munderover
11
+ semantics
12
+ mscarries
13
+ mfraction
14
+ mphantom
15
+ menclose
16
+ mlongdiv
17
+ mpadded
18
+ msubsup
19
+ mscarry
20
+ mfenced
21
+ msgroup
22
+ mglyph
23
+ mstack
24
+ munder
25
+ mtable
26
+ mstyle
27
+ mspace
28
+ msline
29
+ merror
30
+ msrow
31
+ mfrac
32
+ mover
33
+ mroot
34
+ mtext
35
+ msqrt
36
+ none
37
+ mrow
38
+ msub
39
+ msup
40
+ mi
41
+ mo
42
+ mn
43
+ ms
44
+ ].freeze
45
+
46
+ COMMON_ATTRIBUTES_CLASSES = %w[
47
+ Math
48
+ Mmultiscripts
49
+ Munderover
50
+ Semantics
51
+ Mscarries
52
+ Mfraction
53
+ Mlongdiv
54
+ Mphantom
55
+ Menclose
56
+ Mfenced
57
+ Mpadded
58
+ Msubsup
59
+ Msgroup
60
+ Mscarry
61
+ Munder
62
+ Mstyle
63
+ Mstack
64
+ Merror
65
+ Mover
66
+ Mfrac
67
+ Msrow
68
+ Mroot
69
+ Msqrt
70
+ Mrow
71
+ Msub
72
+ Msup
73
+ Mtd
74
+ Ms
75
+ ].freeze
76
+
77
+ module_function
78
+
79
+ def config
80
+ @config ||= {}
81
+ end
82
+
83
+ def config=(config)
84
+ self.config.merge!(config)
85
+ end
86
+
87
+ def custom_models=(models_hash)
88
+ # { Mi => CustomMiClass, Mo => CustomMoClass }
89
+ models_hash.each { |klass, model| klass.model(model) }
90
+ end
91
+
92
+ def adapter
93
+ Lutaml::Model::Config.xml_adapter
94
+ end
95
+
96
+ def adapter=(adapter)
97
+ Lutaml::Model::Config.xml_adapter_type = adapter
98
+ end
99
+
100
+ def class_for(class_name)
101
+ config[class_name]
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
5
+ class Maction < Lutaml::Model::Serializable
6
+ attribute :mathcolor, :string
7
+ attribute :mathbackground, :string
8
+ attribute :actiontype, :string
9
+ attribute :selection, :string
10
+
11
+ xml do
12
+ namespace Namespace
13
+ element "maction"
14
+
15
+ map_attribute "mathcolor", to: :mathcolor
16
+ map_attribute "mathbackground", to: :mathbackground
17
+ map_attribute "actiontype", to: :actiontype
18
+ map_attribute "selection", to: :selection
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
5
+ class Maligngroup < Lutaml::Model::Serializable
6
+ attribute :mathcolor, :string
7
+ attribute :mathbackground, :string
8
+ attribute :groupalign, :string
9
+
10
+ xml do
11
+ namespace Namespace
12
+ element "maligngroup"
13
+
14
+ map_attribute "mathcolor", to: :mathcolor
15
+ map_attribute "mathbackground", to: :mathbackground
16
+ map_attribute "groupalign", to: :groupalign
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
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
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
15
+ end
16
+
17
+ # For backward compatibility, we keep MathWithNamespace as an alias to Math.
18
+ MathWithNamespace = Math
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
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
44
+ end
45
+ end
46
+ end
data/lib/mml/v3/mi.rb ADDED
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
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
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
5
+ autoload(:Mtd, "mml/v3/mtd")
6
+
7
+ 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
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
25
+ end
26
+ end
27
+ end
data/lib/mml/v3/mn.rb ADDED
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
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
36
+ end
37
+ end
38
+ end
data/lib/mml/v3/mo.rb ADDED
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ module V3
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
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
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
17
+ end
18
+ end
19
+ end