mml 0.1.0 → 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.
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/mover.rb ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mover < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mover)
6
+
7
+ attribute :mathbackground, :string
8
+ attribute :mathcolor, :string
9
+ attribute :accent, :string
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
14
+
15
+ xml do
16
+ root "mover", mixed: true
17
+
18
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
19
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
20
+ map_attribute "accent", to: :accent, namespace: nil
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
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mpadded < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mpadded)
6
+
7
+ attribute :mathbackground, :string
8
+ attribute :mathcolor, :string
9
+ attribute :voffset, :string
10
+ attribute :height, :string
11
+ attribute :lspace, :string
12
+ attribute :depth, :string
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
17
+
18
+ xml do
19
+ root "mpadded", mixed: true
20
+
21
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
22
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
23
+ map_attribute "voffset", to: :voffset, namespace: nil
24
+ map_attribute "height", to: :height, namespace: nil
25
+ map_attribute "lspace", to: :lspace, namespace: nil
26
+ map_attribute "depth", to: :depth, namespace: nil
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
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mphantom < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mphantom)
6
+
7
+ attribute :mathcolor, :string
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
12
+
13
+ xml do
14
+ root "mphantom", mixed: true
15
+
16
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
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
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mprescripts < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mprescripts)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+
10
+ xml do
11
+ root "mprescripts"
12
+
13
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
14
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
15
+ end
16
+ end
17
+ end
data/lib/mml/mroot.rb ADDED
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mroot < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mroot)
6
+
7
+ attribute :mathcolor, :string
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
12
+
13
+ xml do
14
+ root "mroot", mixed: true
15
+
16
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
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
21
+ end
22
+ end
23
+ end
data/lib/mml/mrow.rb ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mrow < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mrow)
6
+
7
+ attribute :mathbackground, :string
8
+ attribute :mathcolor, :string
9
+ attribute :content, :string
10
+ attribute :intent, :string
11
+ attribute :dir, :string
12
+
13
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
14
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
15
+ end
16
+
17
+ xml do
18
+ root "mrow", mixed: true
19
+
20
+ map_content to: :content
21
+ map_attribute "dir", to: :dir, namespace: nil
22
+ map_attribute "intent", to: :intent, namespace: nil
23
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
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
29
+ end
30
+ end
31
+ end
data/lib/mml/ms.rb ADDED
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Ms < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:ms)
6
+
7
+ attribute :mathbackground, :string
8
+ attribute :mathvariant, :string
9
+ attribute :fontfamily, :string
10
+ attribute :background, :string
11
+ attribute :fontweight, :string
12
+ attribute :mathcolor, :string
13
+ attribute :fontstyle, :string
14
+ attribute :mathsize, :string
15
+ attribute :fontsize, :string
16
+ attribute :lquote, :string
17
+ attribute :rquote, :string
18
+ attribute :color, :string
19
+ attribute :value, :string
20
+ attribute :dir, :string
21
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
22
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize)
23
+ end
24
+
25
+ xml do
26
+ root "ms", mixed: true
27
+
28
+ map_content to: :value
29
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
30
+ map_attribute "mathvariant", to: :mathvariant, namespace: nil
31
+ map_attribute "fontfamily", to: :fontfamily, namespace: nil
32
+ map_attribute "fontweight", to: :fontweight, namespace: nil
33
+ map_attribute "background", to: :background, namespace: nil
34
+ map_attribute "fontstyle", to: :fontstyle, namespace: nil
35
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
36
+ map_attribute "fontsize", to: :fontsize, namespace: nil
37
+ map_attribute "mathsize", to: :mathsize, namespace: nil
38
+ map_attribute "lquote", to: :lquote, namespace: nil
39
+ map_attribute "rquote", to: :rquote, namespace: nil
40
+ map_attribute "color", to: :color, namespace: nil
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
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mscarries < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mscarries)
6
+
7
+ attribute :scriptsizemultiplier, :integer
8
+ attribute :mathbackground, :string
9
+ attribute :mathcolor, :string
10
+ attribute :position, :integer
11
+ attribute :location, :string
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
16
+
17
+ xml do
18
+ root "mscarries", mixed: true
19
+
20
+ map_attribute "scriptsizemultiplier", to: :scriptsizemultiplier, namespace: nil
21
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
22
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
23
+ map_attribute "position", to: :position, namespace: nil
24
+ map_attribute "location", to: :location, namespace: nil
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
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mscarry < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mscarry)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :location, :string
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
14
+
15
+ xml do
16
+ root "mscarry", mixed: true
17
+
18
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
19
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
20
+ map_attribute "location", to: :location, namespace: nil
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
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msgroup < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msgroup)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :position, :integer
10
+ attribute :shift, :integer
11
+ attribute :mscarries_value, Mscarries, collection: true
12
+ attribute :msrow_value, Msrow, collection: true
13
+ attribute :msgroup_text, :string
14
+
15
+ Mml::Configuration::SUPPORTED_TAGS.each do |tag|
16
+ attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
17
+ end
18
+
19
+ xml do
20
+ root "msgroup", mixed: true
21
+
22
+ map_content to: :msgroup_text
23
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
24
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
25
+ map_attribute "position", to: :position, namespace: nil
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
30
+ end
31
+ end
32
+ end
data/lib/mml/msline.rb ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msline < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msline)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :position, :integer
10
+ attribute :length, :integer
11
+ attribute :leftoverhang, :string
12
+ attribute :rightoverhang, :string
13
+ attribute :mslinethickness, :string
14
+
15
+ xml do
16
+ root "msline"
17
+
18
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
19
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
20
+ map_attribute "position", to: :position, namespace: nil
21
+ map_attribute "length", to: :length, namespace: nil
22
+ map_attribute "leftoverhang", to: :leftoverhang, namespace: nil
23
+ map_attribute "rightoverhang", to: :rightoverhang, namespace: nil
24
+ map_attribute "mslinethickness", to: :mslinethickness, namespace: nil
25
+ end
26
+ end
27
+ end
data/lib/mml/mspace.rb ADDED
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mspace < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mspace)
6
+
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 :width, :string
19
+ attribute :height, :string
20
+ attribute :depth, :string
21
+ attribute :linebreak, :string
22
+ attribute :indentalign, :string
23
+ attribute :indentshift, :string
24
+ attribute :indenttarget, :string
25
+ attribute :indentalignfirst, :string
26
+ attribute :indentshiftfirst, :string
27
+ attribute :indentalignlast, :string
28
+ attribute :indentshiftlast, :string
29
+
30
+ xml do
31
+ root "mspace"
32
+
33
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
34
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
35
+ map_attribute "mathvariant", to: :mathvariant, namespace: nil
36
+ map_attribute "mathsize", to: :mathsize, namespace: nil
37
+ map_attribute "dir", to: :dir, namespace: nil
38
+ map_attribute "fontfamily", to: :fontfamily, namespace: nil
39
+ map_attribute "fontweight", to: :fontweight, namespace: nil
40
+ map_attribute "fontstyle", to: :fontstyle, namespace: nil
41
+ map_attribute "fontsize", to: :fontsize, namespace: nil
42
+ map_attribute "color", to: :color, namespace: nil
43
+ map_attribute "background", to: :background, namespace: nil
44
+ map_attribute "width", to: :width, namespace: nil
45
+ map_attribute "height", to: :height, namespace: nil
46
+ map_attribute "depth", to: :depth, namespace: nil
47
+ map_attribute "linebreak", to: :linebreak, namespace: nil
48
+ map_attribute "indentalign", to: :indentalign, namespace: nil
49
+ map_attribute "indentshift", to: :indentshift, namespace: nil
50
+ map_attribute "indenttarget", to: :indenttarget, namespace: nil
51
+ map_attribute "indentalignfirst", to: :indentalignfirst, namespace: nil
52
+ map_attribute "indentshiftfirst", to: :indentshiftfirst, namespace: nil
53
+ map_attribute "indentalignlast", to: :indentalignlast, namespace: nil
54
+ map_attribute "indentshiftlast", to: :indentshiftlast, namespace: nil
55
+ end
56
+ end
57
+ end
data/lib/mml/msqrt.rb ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msqrt < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msqrt)
6
+
7
+ attribute :mathcolor, :string
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
12
+
13
+ xml do
14
+ root "msqrt", mixed: true
15
+
16
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
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
22
+ end
23
+ end
24
+ end
data/lib/mml/msrow.rb ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Msrow < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:msrow)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
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
13
+
14
+ xml do
15
+ root "msrow", mixed: true
16
+
17
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
18
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
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
24
+ end
25
+ end
26
+ end
data/lib/mml/mstack.rb ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mml
4
+ class Mstack < Lutaml::Model::Serializable
5
+ model Mml::Configuration.class_for(:mstack)
6
+
7
+ attribute :mathcolor, :string
8
+ attribute :mathbackground, :string
9
+ attribute :align, :string
10
+ attribute :stackalign, :string
11
+ attribute :charalign, :string
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
16
+
17
+ xml do
18
+ root "mstack", mixed: true
19
+
20
+ map_attribute "mathcolor", to: :mathcolor, namespace: nil
21
+ map_attribute "mathbackground", to: :mathbackground, namespace: nil
22
+ map_attribute "align", to: :align, namespace: nil
23
+ map_attribute "stackalign", to: :stackalign, namespace: nil
24
+ map_attribute "charalign", to: :charalign, namespace: nil
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
29
+ end
30
+ end
31
+ end