mml 0.4.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mml/configuration.rb +5 -39
- data/lib/mml/maction.rb +2 -0
- data/lib/mml/maligngroup.rb +2 -0
- data/lib/mml/malignmark.rb +2 -0
- data/lib/mml/math_with_namespace.rb +8 -2
- data/lib/mml/math_with_nil_namespace.rb +8 -2
- data/lib/mml/menclose.rb +8 -0
- data/lib/mml/merror.rb +8 -0
- data/lib/mml/mfenced.rb +9 -0
- data/lib/mml/mfrac.rb +8 -0
- data/lib/mml/mfraction.rb +8 -0
- data/lib/mml/mglyph.rb +2 -0
- data/lib/mml/mi.rb +2 -0
- data/lib/mml/mlabeledtr.rb +2 -2
- data/lib/mml/mlongdiv.rb +8 -0
- data/lib/mml/mml.rb +21 -0
- data/lib/mml/mmultiscripts.rb +8 -2
- data/lib/mml/mn.rb +3 -1
- data/lib/mml/mo.rb +2 -0
- data/lib/mml/mover.rb +8 -0
- data/lib/mml/mpadded.rb +8 -0
- data/lib/mml/mphantom.rb +8 -0
- data/lib/mml/mprescripts.rb +2 -0
- data/lib/mml/mroot.rb +8 -0
- data/lib/mml/mrow.rb +10 -0
- data/lib/mml/ms.rb +8 -0
- data/lib/mml/mscarries.rb +8 -0
- data/lib/mml/mscarry.rb +8 -0
- data/lib/mml/msgroup.rb +11 -0
- data/lib/mml/msline.rb +2 -0
- data/lib/mml/mspace.rb +2 -0
- data/lib/mml/msqrt.rb +9 -0
- data/lib/mml/msrow.rb +9 -0
- data/lib/mml/mstack.rb +8 -0
- data/lib/mml/mstyle.rb +8 -0
- data/lib/mml/msub.rb +8 -0
- data/lib/mml/msubsup.rb +8 -0
- data/lib/mml/msup.rb +8 -0
- data/lib/mml/mtable.rb +2 -2
- data/lib/mml/mtd.rb +8 -0
- data/lib/mml/mtext.rb +2 -0
- data/lib/mml/mtr.rb +2 -2
- data/lib/mml/munder.rb +8 -0
- data/lib/mml/munderover.rb +8 -0
- data/lib/mml/none.rb +2 -0
- data/lib/mml/semantics.rb +9 -3
- data/lib/mml/version.rb +1 -1
- data/lib/mml.rb +5 -45
- data/mml.gemspec +2 -2
- metadata +12 -13
- data/lib/mml/common_attributes.rb +0 -21
- data/lib/mml/opal_setup.rb.erb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565c1e39fe3e4ac67501f0064c9685dae36c40339c12ed1d7d489a73fbdb8a73
|
4
|
+
data.tar.gz: 1f7fb702767b86261862c161384b6f1f44899b31923285e3af00de766daae784
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a06d4db0336c75b7c888c03c3c88fecba8bc0f4dd1622354b41d829a60ae0a5548b162bf9334320bac88984f7a77f043e909e0ff13c069d0debcff4f973ade23
|
7
|
+
data.tar.gz: 0b3a278522ec51b683a0be41198909fe9f3a882148d053f4d444771dfb2cfe4ab6f16ed73cb11c30b89acbeb51fe56c935216e4527c7c9a71cd2436df3d3ce81
|
data/lib/mml/configuration.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
module Configuration
|
5
|
-
SUPPORTED_TAGS = %
|
5
|
+
SUPPORTED_TAGS = %w[
|
6
6
|
mmultiscripts
|
7
7
|
maligngroup
|
8
8
|
malignmark
|
@@ -42,38 +42,6 @@ module Mml
|
|
42
42
|
ms
|
43
43
|
].freeze
|
44
44
|
|
45
|
-
COMMON_ATTRIBUTES_CLASSES = %w[
|
46
|
-
MathWithNilNamespace
|
47
|
-
MathWithNamespace
|
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
45
|
module_function
|
78
46
|
|
79
47
|
def config
|
@@ -84,17 +52,15 @@ module Mml
|
|
84
52
|
self.config.merge!(config)
|
85
53
|
end
|
86
54
|
|
87
|
-
def custom_models=(models_hash)
|
88
|
-
# { Mi => CustomMiClass, Mo => CustomMoClass }
|
89
|
-
models_hash.each { |klass, model| klass.model(model) }
|
90
|
-
end
|
91
|
-
|
92
55
|
def adapter
|
93
56
|
Lutaml::Model::Config.xml_adapter
|
94
57
|
end
|
95
58
|
|
96
59
|
def adapter=(adapter)
|
97
|
-
Lutaml::Model::Config.
|
60
|
+
Lutaml::Model::Config.configure do |config|
|
61
|
+
require "lutaml/model/xml_adapter/#{adapter.downcase}_adapter"
|
62
|
+
config.xml_adapter = Lutaml::Model::XmlAdapter.const_get("#{adapter.to_s.capitalize}Adapter")
|
63
|
+
end
|
98
64
|
end
|
99
65
|
|
100
66
|
def class_for(class_name)
|
data/lib/mml/maction.rb
CHANGED
data/lib/mml/maligngroup.rb
CHANGED
data/lib/mml/malignmark.rb
CHANGED
@@ -2,13 +2,19 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class MathWithNamespace < Lutaml::Model::Serializable
|
5
|
-
|
5
|
+
model Mml::Configuration.class_for(:math)
|
6
|
+
|
7
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
8
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
9
|
+
end
|
6
10
|
|
7
11
|
xml do
|
8
12
|
root "math", mixed: true
|
9
13
|
namespace "http://www.w3.org/1998/Math/MathML", nil
|
10
14
|
|
11
|
-
|
15
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
16
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
17
|
+
end
|
12
18
|
end
|
13
19
|
end
|
14
20
|
end
|
@@ -2,12 +2,18 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class MathWithNilNamespace < Lutaml::Model::Serializable
|
5
|
-
|
5
|
+
model Mml::Configuration.class_for(:math)
|
6
|
+
|
7
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
8
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
9
|
+
end
|
6
10
|
|
7
11
|
xml do
|
8
12
|
root "math", mixed: true
|
9
13
|
|
10
|
-
|
14
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
15
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
16
|
+
end
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
data/lib/mml/menclose.rb
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Menclose < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:menclose)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :notation, :string
|
10
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
11
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
12
|
+
end
|
8
13
|
|
9
14
|
xml do
|
10
15
|
root "menclose", mixed: true
|
@@ -12,6 +17,9 @@ module Mml
|
|
12
17
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
13
18
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
14
19
|
map_attribute "notation", to: :notation, namespace: nil
|
20
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
21
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
22
|
+
end
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
data/lib/mml/merror.rb
CHANGED
@@ -2,14 +2,22 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Merror < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:merror)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :mathcolor, :string
|
9
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
10
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
11
|
+
end
|
7
12
|
|
8
13
|
xml do
|
9
14
|
root "merror", mixed: true
|
10
15
|
|
11
16
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
12
17
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
18
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
19
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
data/lib/mml/mfenced.rb
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mfenced < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mfenced)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :separators, :string
|
7
9
|
attribute :mathcolor, :string
|
8
10
|
attribute :content, :string
|
9
11
|
attribute :close, :string
|
10
12
|
attribute :open, :string
|
13
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
14
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
15
|
+
end
|
11
16
|
|
12
17
|
xml do
|
13
18
|
root "mfenced", mixed: true
|
@@ -19,6 +24,10 @@ module Mml
|
|
19
24
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
20
25
|
map_attribute "close", to: :close, namespace: nil
|
21
26
|
map_attribute "open", to: :open, namespace: nil
|
27
|
+
|
28
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
29
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
30
|
+
end
|
22
31
|
end
|
23
32
|
end
|
24
33
|
end
|
data/lib/mml/mfrac.rb
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mfrac < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mfrac)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :linethickness, :string
|
8
10
|
attribute :numalign, :string
|
9
11
|
attribute :denomalign, :string
|
10
12
|
attribute :bevelled, :string
|
13
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
14
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
15
|
+
end
|
11
16
|
|
12
17
|
xml do
|
13
18
|
root "mfrac", mixed: true
|
@@ -18,6 +23,9 @@ module Mml
|
|
18
23
|
map_attribute "numalign", to: :numalign, namespace: nil
|
19
24
|
map_attribute "denomalign", to: :denomalign, namespace: nil
|
20
25
|
map_attribute "bevelled", to: :bevelled, namespace: nil
|
26
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
27
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
data/lib/mml/mfraction.rb
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mfraction < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mfraction)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :linethickness, :string
|
8
10
|
attribute :numalign, :string
|
9
11
|
attribute :denomalign, :string
|
10
12
|
attribute :bevelled, :string
|
13
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
14
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
15
|
+
end
|
11
16
|
|
12
17
|
xml do
|
13
18
|
root "mfraction", mixed: true
|
@@ -18,6 +23,9 @@ module Mml
|
|
18
23
|
map_attribute "numalign", to: :numalign, namespace: nil
|
19
24
|
map_attribute "denomalign", to: :denomalign, namespace: nil
|
20
25
|
map_attribute "bevelled", to: :bevelled, namespace: nil
|
26
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
27
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
data/lib/mml/mglyph.rb
CHANGED
data/lib/mml/mi.rb
CHANGED
data/lib/mml/mlabeledtr.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Mml
|
4
|
-
autoload(:Mtd, "mml/mtd")
|
5
|
-
|
6
4
|
class Mlabeledtr < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mlabeledtr)
|
6
|
+
|
7
7
|
attribute :mathbackground, :string
|
8
8
|
attribute :columnalign, :string
|
9
9
|
attribute :groupalign, :string
|
data/lib/mml/mlongdiv.rb
CHANGED
@@ -2,11 +2,16 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mlongdiv < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mlongdiv)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :longdivstyle, :string
|
7
9
|
attribute :mathcolor, :string
|
8
10
|
attribute :position, :integer
|
9
11
|
attribute :shift, :integer
|
12
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
13
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
14
|
+
end
|
10
15
|
|
11
16
|
xml do
|
12
17
|
root "mlongdiv", mixed: true
|
@@ -16,6 +21,9 @@ module Mml
|
|
16
21
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
17
22
|
map_attribute "position", to: :position, namespace: nil
|
18
23
|
map_attribute "shift", to: :shift, namespace: nil
|
24
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
25
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
26
|
+
end
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
data/lib/mml/mml.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mml
|
4
|
+
class Error < StandardError; end
|
5
|
+
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def config
|
9
|
+
Configuration.config
|
10
|
+
end
|
11
|
+
|
12
|
+
def parse(input, namespace_exist: true)
|
13
|
+
Configuration.adapter = :ox unless Configuration.adapter
|
14
|
+
|
15
|
+
if namespace_exist
|
16
|
+
Mml::MathWithNamespace.from_xml(input)
|
17
|
+
else
|
18
|
+
Mml::MathWithNilNamespace.from_xml(input)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/mml/mmultiscripts.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Mml
|
4
|
-
autoload(:Mprescripts, "mml/mprescripts")
|
5
|
-
|
6
4
|
class Mmultiscripts < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mmultiscripts)
|
6
|
+
|
7
7
|
attribute :mathcolor, :string
|
8
8
|
attribute :mathbackground, :string
|
9
9
|
attribute :subscriptshift, :string
|
10
10
|
attribute :superscriptshift, :string
|
11
11
|
attribute :mprescripts_value, Mprescripts
|
12
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
13
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
14
|
+
end
|
12
15
|
|
13
16
|
xml do
|
14
17
|
root "mmultiscripts", mixed: true
|
@@ -18,6 +21,9 @@ module Mml
|
|
18
21
|
map_attribute "subscriptshift", to: :subscriptshift, namespace: nil
|
19
22
|
map_attribute "superscriptshift", to: :superscriptshift, namespace: nil
|
20
23
|
map_element "mprescripts", to: :mprescripts_value
|
24
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
25
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
26
|
+
end
|
21
27
|
end
|
22
28
|
end
|
23
29
|
end
|
data/lib/mml/mn.rb
CHANGED
data/lib/mml/mo.rb
CHANGED
data/lib/mml/mover.rb
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mover < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mover)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :mathcolor, :string
|
7
9
|
attribute :accent, :string
|
8
10
|
attribute :align, :string
|
11
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
12
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
13
|
+
end
|
9
14
|
|
10
15
|
xml do
|
11
16
|
root "mover", mixed: true
|
@@ -14,6 +19,9 @@ module Mml
|
|
14
19
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
15
20
|
map_attribute "accent", to: :accent, namespace: nil
|
16
21
|
map_attribute "align", to: :align, namespace: nil
|
22
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
23
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
data/lib/mml/mpadded.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mpadded < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mpadded)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :mathcolor, :string
|
7
9
|
attribute :voffset, :string
|
@@ -9,6 +11,9 @@ module Mml
|
|
9
11
|
attribute :lspace, :string
|
10
12
|
attribute :depth, :string
|
11
13
|
attribute :width, :string
|
14
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
15
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
16
|
+
end
|
12
17
|
|
13
18
|
xml do
|
14
19
|
root "mpadded", mixed: true
|
@@ -20,6 +25,9 @@ module Mml
|
|
20
25
|
map_attribute "lspace", to: :lspace, namespace: nil
|
21
26
|
map_attribute "depth", to: :depth, namespace: nil
|
22
27
|
map_attribute "width", to: :width, namespace: nil
|
28
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
29
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
30
|
+
end
|
23
31
|
end
|
24
32
|
end
|
25
33
|
end
|
data/lib/mml/mphantom.rb
CHANGED
@@ -2,14 +2,22 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mphantom < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mphantom)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
9
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
10
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
11
|
+
end
|
7
12
|
|
8
13
|
xml do
|
9
14
|
root "mphantom", mixed: true
|
10
15
|
|
11
16
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
12
17
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
18
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
19
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
data/lib/mml/mprescripts.rb
CHANGED
data/lib/mml/mroot.rb
CHANGED
@@ -2,14 +2,22 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mroot < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mroot)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
9
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
10
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
11
|
+
end
|
7
12
|
|
8
13
|
xml do
|
9
14
|
root "mroot", mixed: true
|
10
15
|
|
11
16
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
12
17
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
18
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
19
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
data/lib/mml/mrow.rb
CHANGED
@@ -2,12 +2,18 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mrow < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mrow)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :mathcolor, :string
|
7
9
|
attribute :content, :string
|
8
10
|
attribute :intent, :string
|
9
11
|
attribute :dir, :string
|
10
12
|
|
13
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
14
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
15
|
+
end
|
16
|
+
|
11
17
|
xml do
|
12
18
|
root "mrow", mixed: true
|
13
19
|
|
@@ -16,6 +22,10 @@ module Mml
|
|
16
22
|
map_attribute "intent", to: :intent, namespace: nil
|
17
23
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
18
24
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
25
|
+
|
26
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
27
|
+
map_element tag, to: :"#{tag}_value"
|
28
|
+
end
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
data/lib/mml/ms.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Ms < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:ms)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :mathvariant, :string
|
7
9
|
attribute :fontfamily, :string
|
@@ -16,6 +18,9 @@ module Mml
|
|
16
18
|
attribute :color, :string
|
17
19
|
attribute :value, :string
|
18
20
|
attribute :dir, :string
|
21
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
22
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize)
|
23
|
+
end
|
19
24
|
|
20
25
|
xml do
|
21
26
|
root "ms", mixed: true
|
@@ -34,6 +39,9 @@ module Mml
|
|
34
39
|
map_attribute "rquote", to: :rquote, namespace: nil
|
35
40
|
map_attribute "color", to: :color, namespace: nil
|
36
41
|
map_attribute "dir", to: :dir, namespace: nil
|
42
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
43
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
44
|
+
end
|
37
45
|
end
|
38
46
|
end
|
39
47
|
end
|
data/lib/mml/mscarries.rb
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mscarries < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mscarries)
|
6
|
+
|
5
7
|
attribute :scriptsizemultiplier, :integer
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :mathcolor, :string
|
8
10
|
attribute :position, :integer
|
9
11
|
attribute :location, :string
|
10
12
|
attribute :crossout, :string
|
13
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
14
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
15
|
+
end
|
11
16
|
|
12
17
|
xml do
|
13
18
|
root "mscarries", mixed: true
|
@@ -18,6 +23,9 @@ module Mml
|
|
18
23
|
map_attribute "position", to: :position, namespace: nil
|
19
24
|
map_attribute "location", to: :location, namespace: nil
|
20
25
|
map_attribute "crossout", to: :crossout, namespace: nil
|
26
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
27
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
data/lib/mml/mscarry.rb
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mscarry < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mscarry)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :location, :string
|
8
10
|
attribute :crossout, :string
|
11
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
12
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
13
|
+
end
|
9
14
|
|
10
15
|
xml do
|
11
16
|
root "mscarry", mixed: true
|
@@ -14,6 +19,9 @@ module Mml
|
|
14
19
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
15
20
|
map_attribute "location", to: :location, namespace: nil
|
16
21
|
map_attribute "crossout", to: :crossout, namespace: nil
|
22
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
23
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
data/lib/mml/msgroup.rb
CHANGED
@@ -2,12 +2,20 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Msgroup < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:msgroup)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :position, :integer
|
8
10
|
attribute :shift, :integer
|
11
|
+
attribute :mscarries_value, Mscarries, collection: true
|
12
|
+
attribute :msrow_value, Msrow, collection: true
|
9
13
|
attribute :msgroup_text, :string
|
10
14
|
|
15
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
16
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
17
|
+
end
|
18
|
+
|
11
19
|
xml do
|
12
20
|
root "msgroup", mixed: true
|
13
21
|
|
@@ -16,6 +24,9 @@ module Mml
|
|
16
24
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
17
25
|
map_attribute "position", to: :position, namespace: nil
|
18
26
|
map_attribute "shift", to: :shift, namespace: nil
|
27
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
28
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
29
|
+
end
|
19
30
|
end
|
20
31
|
end
|
21
32
|
end
|
data/lib/mml/msline.rb
CHANGED
data/lib/mml/mspace.rb
CHANGED
data/lib/mml/msqrt.rb
CHANGED
@@ -2,14 +2,23 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Msqrt < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:msqrt)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
9
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
10
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
11
|
+
end
|
7
12
|
|
8
13
|
xml do
|
9
14
|
root "msqrt", mixed: true
|
10
15
|
|
11
16
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
12
17
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
18
|
+
|
19
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
20
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
21
|
+
end
|
13
22
|
end
|
14
23
|
end
|
15
24
|
end
|
data/lib/mml/msrow.rb
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Msrow < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:msrow)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :position, :integer
|
10
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
11
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
12
|
+
end
|
8
13
|
|
9
14
|
xml do
|
10
15
|
root "msrow", mixed: true
|
@@ -12,6 +17,10 @@ module Mml
|
|
12
17
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
13
18
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
14
19
|
map_attribute "position", to: :position, namespace: nil
|
20
|
+
|
21
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
22
|
+
map_element tag, to: :"#{tag}_value"
|
23
|
+
end
|
15
24
|
end
|
16
25
|
end
|
17
26
|
end
|
data/lib/mml/mstack.rb
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mstack < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mstack)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :align, :string
|
8
10
|
attribute :stackalign, :string
|
9
11
|
attribute :charalign, :string
|
10
12
|
attribute :charspacing, :string
|
13
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
14
|
+
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
15
|
+
end
|
11
16
|
|
12
17
|
xml do
|
13
18
|
root "mstack", mixed: true
|
@@ -18,6 +23,9 @@ module Mml
|
|
18
23
|
map_attribute "stackalign", to: :stackalign, namespace: nil
|
19
24
|
map_attribute "charalign", to: :charalign, namespace: nil
|
20
25
|
map_attribute "charspacing", to: :charspacing, namespace: nil
|
26
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
27
|
+
map_element tag, to: :"#{tag}_value"
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
data/lib/mml/mstyle.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
module Mml
|
4
4
|
# rubocop:disable Metrics/ClassLength
|
5
5
|
class Mstyle < Lutaml::Model::Serializable
|
6
|
+
model Mml::Configuration.class_for(:mstyle)
|
7
|
+
|
6
8
|
attribute :mathcolor, :string
|
7
9
|
attribute :mathbackground, :string
|
8
10
|
attribute :scriptlevel, :integer
|
@@ -99,6 +101,9 @@ module Mml
|
|
99
101
|
attribute :thickmathspace, :string
|
100
102
|
attribute :verythickmathspace, :string
|
101
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
|
102
107
|
|
103
108
|
# rubocop:disable Metrics/BlockLength
|
104
109
|
xml do
|
@@ -200,6 +205,9 @@ module Mml
|
|
200
205
|
map_attribute "thickmathspace", to: :thickmathspace, namespace: nil
|
201
206
|
map_attribute "verythickmathspace", to: :verythickmathspace, namespace: nil
|
202
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
|
203
211
|
end
|
204
212
|
# rubocop:enable Metrics/BlockLength
|
205
213
|
end
|
data/lib/mml/msub.rb
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Msub < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:msub)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :subscriptshift, :string
|
7
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
|
8
13
|
|
9
14
|
xml do
|
10
15
|
root "msub", mixed: true
|
@@ -12,6 +17,9 @@ module Mml
|
|
12
17
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
13
18
|
map_attribute "subscriptshift", to: :subscriptshift, namespace: nil
|
14
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
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
data/lib/mml/msubsup.rb
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Msubsup < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:msubsup)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :subscriptshift, :string
|
8
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
|
9
14
|
|
10
15
|
xml do
|
11
16
|
root "msubsup", mixed: true
|
@@ -14,6 +19,9 @@ module Mml
|
|
14
19
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
15
20
|
map_attribute "subscriptshift", to: :subscriptshift, namespace: nil
|
16
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
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
data/lib/mml/msup.rb
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Msup < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:msup)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
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
|
8
13
|
|
9
14
|
xml do
|
10
15
|
root "msup", mixed: true
|
@@ -12,6 +17,9 @@ module Mml
|
|
12
17
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
13
18
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
14
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
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
data/lib/mml/mtable.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Mml
|
4
|
-
autoload(:Mlabeledtr, "mml/mlabeledtr")
|
5
|
-
autoload(:Mtr, "mml/mtr")
|
6
4
|
class Mtable < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mtable)
|
6
|
+
|
7
7
|
attribute :mathcolor, :string
|
8
8
|
attribute :mathbackground, :string
|
9
9
|
attribute :align, :string
|
data/lib/mml/mtd.rb
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Mtd < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mtd)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :rowalign, :string
|
8
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
|
9
14
|
|
10
15
|
xml do
|
11
16
|
root "mtd", mixed: true
|
@@ -14,6 +19,9 @@ module Mml
|
|
14
19
|
map_attribute "mathbackground", to: :mathbackground, namespace: nil
|
15
20
|
map_attribute "rowalign", to: :rowalign, namespace: nil
|
16
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
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
data/lib/mml/mtext.rb
CHANGED
data/lib/mml/mtr.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Mml
|
4
|
-
autoload(:Mtd, "mml/mtd")
|
5
|
-
|
6
4
|
class Mtr < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:mtr)
|
6
|
+
|
7
7
|
attribute :mathcolor, :string
|
8
8
|
attribute :mathbackground, :string
|
9
9
|
attribute :rowalign, :string
|
data/lib/mml/munder.rb
CHANGED
@@ -2,11 +2,16 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Munder < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:munder)
|
6
|
+
|
5
7
|
attribute :mathbackground, :string
|
6
8
|
attribute :accentunder, :string
|
7
9
|
attribute :mathcolor, :string
|
8
10
|
attribute :content, :string
|
9
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
|
10
15
|
|
11
16
|
xml do
|
12
17
|
root "munder", mixed: true
|
@@ -16,6 +21,9 @@ module Mml
|
|
16
21
|
map_attribute "mathcolor", to: :mathcolor, namespace: nil
|
17
22
|
map_attribute "align", to: :align, namespace: nil
|
18
23
|
map_content to: :content
|
24
|
+
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
25
|
+
map_element tag.to_sym, to: :"#{tag}_value"
|
26
|
+
end
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
data/lib/mml/munderover.rb
CHANGED
@@ -2,11 +2,16 @@
|
|
2
2
|
|
3
3
|
module Mml
|
4
4
|
class Munderover < Lutaml::Model::Serializable
|
5
|
+
model Mml::Configuration.class_for(:munderover)
|
6
|
+
|
5
7
|
attribute :mathcolor, :string
|
6
8
|
attribute :mathbackground, :string
|
7
9
|
attribute :accent, :string
|
8
10
|
attribute :accentunder, :string
|
9
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
|
10
15
|
|
11
16
|
xml do
|
12
17
|
root "munderover", mixed: true
|
@@ -16,6 +21,9 @@ module Mml
|
|
16
21
|
map_attribute "accent", to: :accent, namespace: nil
|
17
22
|
map_attribute "accentunder", to: :accentunder, namespace: nil
|
18
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
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
data/lib/mml/none.rb
CHANGED
data/lib/mml/semantics.rb
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Mml
|
4
|
-
autoload(:Mi, "mml/mi")
|
5
|
-
|
6
4
|
class Semantics < Lutaml::Model::Serializable
|
7
|
-
|
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
|
8
11
|
|
9
12
|
xml do
|
10
13
|
root "semantics", mixed: true
|
11
14
|
|
12
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
|
13
19
|
end
|
14
20
|
end
|
15
21
|
end
|
data/lib/mml/version.rb
CHANGED
data/lib/mml.rb
CHANGED
@@ -1,49 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "zeitwerk"
|
3
4
|
require "lutaml/model"
|
4
|
-
|
5
|
-
if RUBY_ENGINE == "opal"
|
6
|
-
require_relative "mml/opal_setup"
|
7
|
-
else
|
8
|
-
files = Dir["lib/mml/*.rb"].reject { |file| File.basename(file, ".*") == "common_attributes" }
|
9
|
-
files.each { |file| require_relative "mml/#{File.basename(file, ".rb")}" }
|
10
|
-
end
|
11
|
-
require "mml/common_attributes"
|
5
|
+
require_relative "mml/mml"
|
12
6
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
else
|
17
|
-
require "lutaml/model/xml_adapter/ox_adapter"
|
18
|
-
:ox
|
19
|
-
end
|
20
|
-
|
21
|
-
Moxml::Config.default_adapter = DEFAULT_ADAPTER
|
22
|
-
|
23
|
-
module Mml
|
24
|
-
class Error < StandardError; end
|
25
|
-
|
26
|
-
module_function
|
27
|
-
|
28
|
-
def config
|
29
|
-
Configuration.config
|
30
|
-
end
|
31
|
-
|
32
|
-
def update_attributes
|
33
|
-
Configuration::COMMON_ATTRIBUTES_CLASSES.each do |klass|
|
34
|
-
const_get(klass).import_model(CommonAttributes)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def parse(input, namespace_exist: true)
|
39
|
-
Configuration.adapter = DEFAULT_ADAPTER unless Configuration.adapter
|
40
|
-
|
41
|
-
if namespace_exist
|
42
|
-
Mml::MathWithNamespace.from_xml(input)
|
43
|
-
else
|
44
|
-
Mml::MathWithNilNamespace.from_xml(input)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
Mml.update_attributes
|
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,6 +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"
|
34
|
-
spec.add_runtime_dependency "
|
33
|
+
spec.add_runtime_dependency "lutaml-model", "~> 0.3"
|
34
|
+
spec.add_runtime_dependency "zeitwerk"
|
35
35
|
end
|
metadata
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: zeitwerk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -59,7 +59,6 @@ files:
|
|
59
59
|
- bin/console
|
60
60
|
- bin/setup
|
61
61
|
- lib/mml.rb
|
62
|
-
- lib/mml/common_attributes.rb
|
63
62
|
- lib/mml/configuration.rb
|
64
63
|
- lib/mml/maction.rb
|
65
64
|
- lib/mml/maligngroup.rb
|
@@ -75,6 +74,7 @@ files:
|
|
75
74
|
- lib/mml/mi.rb
|
76
75
|
- lib/mml/mlabeledtr.rb
|
77
76
|
- lib/mml/mlongdiv.rb
|
77
|
+
- lib/mml/mml.rb
|
78
78
|
- lib/mml/mmultiscripts.rb
|
79
79
|
- lib/mml/mn.rb
|
80
80
|
- lib/mml/mo.rb
|
@@ -104,7 +104,6 @@ files:
|
|
104
104
|
- lib/mml/munder.rb
|
105
105
|
- lib/mml/munderover.rb
|
106
106
|
- lib/mml/none.rb
|
107
|
-
- lib/mml/opal_setup.rb.erb
|
108
107
|
- lib/mml/semantics.rb
|
109
108
|
- lib/mml/version.rb
|
110
109
|
- mml.gemspec
|
@@ -113,7 +112,7 @@ homepage: https://github.com/plurimath/mml
|
|
113
112
|
licenses:
|
114
113
|
- BSD-2-Clause
|
115
114
|
metadata: {}
|
116
|
-
post_install_message:
|
115
|
+
post_install_message:
|
117
116
|
rdoc_options: []
|
118
117
|
require_paths:
|
119
118
|
- lib
|
@@ -128,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
127
|
- !ruby/object:Gem::Version
|
129
128
|
version: '0'
|
130
129
|
requirements: []
|
131
|
-
rubygems_version: 3.
|
132
|
-
signing_key:
|
130
|
+
rubygems_version: 3.3.27
|
131
|
+
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: MathML parser by Plurimath.
|
135
134
|
test_files: []
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Mml
|
4
|
-
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
5
|
-
autoload(tag.to_s.capitalize.to_sym, tag.to_s)
|
6
|
-
end
|
7
|
-
|
8
|
-
class CommonAttributes < Lutaml::Model::Serializable
|
9
|
-
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
10
|
-
attribute :"#{tag}_value", Mml.const_get(tag.to_s.capitalize), collection: true
|
11
|
-
end
|
12
|
-
|
13
|
-
xml do
|
14
|
-
no_root
|
15
|
-
|
16
|
-
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
17
|
-
map_element tag, to: :"#{tag}_value"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|