stepmod-utils 0.4.14 → 0.6.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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +4 -3
  3. data/exe/stepmod-annotate-all +42 -5
  4. data/exe/stepmod-convert-express-description +4 -6
  5. data/exe/stepmod-convert-express-resource +4 -6
  6. data/exe/stepmod-extract-concepts +5 -4
  7. data/exe/stepmod-srl-migrate +21 -22
  8. data/exe/stepmod-validate-express +13 -15
  9. data/lib/stepmod/utils/change.rb +33 -5
  10. data/lib/stepmod/utils/change_collection.rb +1 -1
  11. data/lib/stepmod/utils/changes_extractor.rb +23 -3
  12. data/lib/stepmod/utils/concept.rb +12 -10
  13. data/lib/stepmod/utils/converters/blockquote.rb +0 -2
  14. data/lib/stepmod/utils/converters/def.rb +4 -4
  15. data/lib/stepmod/utils/converters/dt.rb +1 -1
  16. data/lib/stepmod/utils/converters/em_express_description.rb +8 -7
  17. data/lib/stepmod/utils/converters/eqn.rb +8 -6
  18. data/lib/stepmod/utils/converters/express_figure.rb +1 -1
  19. data/lib/stepmod/utils/converters/express_g.rb +1 -1
  20. data/lib/stepmod/utils/converters/express_table.rb +1 -1
  21. data/lib/stepmod/utils/converters/ext_description.rb +2 -1
  22. data/lib/stepmod/utils/converters/figure.rb +5 -5
  23. data/lib/stepmod/utils/converters/module_ref.rb +3 -5
  24. data/lib/stepmod/utils/converters/module_ref_express_description.rb +3 -7
  25. data/lib/stepmod/utils/converters/ol.rb +7 -7
  26. data/lib/stepmod/utils/converters/stepmod_ext_description.rb +3 -3
  27. data/lib/stepmod/utils/converters/strong.rb +12 -11
  28. data/lib/stepmod/utils/converters/term.rb +0 -1
  29. data/lib/stepmod/utils/express_bibdata.rb +6 -2
  30. data/lib/stepmod/utils/html_to_asciimath.rb +80 -80
  31. data/lib/stepmod/utils/parsers/mapping_table_parser.rb +31 -0
  32. data/lib/stepmod/utils/parsers/models/a.rb +40 -0
  33. data/lib/stepmod/utils/parsers/models/aa.rb +53 -0
  34. data/lib/stepmod/utils/parsers/models/ae.rb +54 -0
  35. data/lib/stepmod/utils/parsers/models/aimelt.rb +21 -0
  36. data/lib/stepmod/utils/parsers/models/alt.rb +19 -0
  37. data/lib/stepmod/utils/parsers/models/alt_map.rb +46 -0
  38. data/lib/stepmod/utils/parsers/models/alt_scmap.rb +34 -0
  39. data/lib/stepmod/utils/parsers/models/b.rb +58 -0
  40. data/lib/stepmod/utils/parsers/models/bigeqn.rb +55 -0
  41. data/lib/stepmod/utils/parsers/models/bold.rb +52 -0
  42. data/lib/stepmod/utils/parsers/models/bom_ref.rb +21 -0
  43. data/lib/stepmod/utils/parsers/models/constraint.rb +19 -0
  44. data/lib/stepmod/utils/parsers/models/dd.rb +86 -0
  45. data/lib/stepmod/utils/parsers/models/description.rb +86 -0
  46. data/lib/stepmod/utils/parsers/models/dl.rb +24 -0
  47. data/lib/stepmod/utils/parsers/models/dt.rb +86 -0
  48. data/lib/stepmod/utils/parsers/models/eqn.rb +57 -0
  49. data/lib/stepmod/utils/parsers/models/example.rb +84 -0
  50. data/lib/stepmod/utils/parsers/models/express_extref.rb +21 -0
  51. data/lib/stepmod/utils/parsers/models/express_ref.rb +21 -0
  52. data/lib/stepmod/utils/parsers/models/figure.rb +30 -0
  53. data/lib/stepmod/utils/parsers/models/i.rb +52 -0
  54. data/lib/stepmod/utils/parsers/models/img.rb +25 -0
  55. data/lib/stepmod/utils/parsers/models/imgarea.rb +23 -0
  56. data/lib/stepmod/utils/parsers/models/li.rb +86 -0
  57. data/lib/stepmod/utils/parsers/models/mapping_table.rb +26 -0
  58. data/lib/stepmod/utils/parsers/models/module_ref.rb +21 -0
  59. data/lib/stepmod/utils/parsers/models/note.rb +84 -0
  60. data/lib/stepmod/utils/parsers/models/ol.rb +25 -0
  61. data/lib/stepmod/utils/parsers/models/p.rb +56 -0
  62. data/lib/stepmod/utils/parsers/models/refpath.rb +23 -0
  63. data/lib/stepmod/utils/parsers/models/refpath_extend.rb +23 -0
  64. data/lib/stepmod/utils/parsers/models/rules.rb +19 -0
  65. data/lib/stepmod/utils/parsers/models/sc.rb +36 -0
  66. data/lib/stepmod/utils/parsers/models/screen.rb +55 -0
  67. data/lib/stepmod/utils/parsers/models/source.rb +21 -0
  68. data/lib/stepmod/utils/parsers/models/sub.rb +52 -0
  69. data/lib/stepmod/utils/parsers/models/sup.rb +52 -0
  70. data/lib/stepmod/utils/parsers/models/table.rb +29 -0
  71. data/lib/stepmod/utils/parsers/models/td.rb +98 -0
  72. data/lib/stepmod/utils/parsers/models/th.rb +98 -0
  73. data/lib/stepmod/utils/parsers/models/title.rb +53 -0
  74. data/lib/stepmod/utils/parsers/models/tr.rb +26 -0
  75. data/lib/stepmod/utils/parsers/models/tt.rb +68 -0
  76. data/lib/stepmod/utils/parsers/models/ul.rb +21 -0
  77. data/lib/stepmod/utils/parsers/models.rb +0 -0
  78. data/lib/stepmod/utils/parsers/types/string_without_indent.rb +17 -0
  79. data/lib/stepmod/utils/parsers.rb +4 -0
  80. data/lib/stepmod/utils/smrl_description_converter.rb +2 -1
  81. data/lib/stepmod/utils/smrl_resource_converter.rb +2 -1
  82. data/lib/stepmod/utils/stepmod_file_annotator.rb +14 -7
  83. data/lib/stepmod/utils/term.rb +1 -1
  84. data/lib/stepmod/utils/terms_extractor.rb +33 -31
  85. data/lib/stepmod/utils/version.rb +1 -1
  86. data/stepmod-utils.gemspec +4 -3
  87. metadata +76 -13
@@ -0,0 +1,21 @@
1
+ require "shale"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ module Parsers
6
+ module Models
7
+ class Aimelt < Shale::Mapper
8
+ attribute :content, Shale::Type::String
9
+ attribute :space, Shale::Type::Value
10
+
11
+ xml do
12
+ root "aimelt"
13
+
14
+ map_content to: :content
15
+ map_attribute "space", to: :space
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ require "shale"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ module Parsers
6
+ module Models
7
+ class Alt < Shale::Mapper
8
+ attribute :content, Shale::Type::String
9
+
10
+ xml do
11
+ root "alt"
12
+
13
+ map_content to: :content
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,46 @@
1
+ require "shale"
2
+
3
+ require_relative "aimelt"
4
+ require_relative "alt"
5
+ require_relative "description"
6
+ require_relative "express_ref"
7
+ require_relative "refpath"
8
+ require_relative "refpath_extend"
9
+ require_relative "rules"
10
+ require_relative "source"
11
+
12
+ module Stepmod
13
+ module Utils
14
+ module Parsers
15
+ module Models
16
+ class AltMap < Shale::Mapper
17
+ attribute :id, Shale::Type::String
18
+ attribute :alt_map_inc, Shale::Type::String
19
+ attribute :alt, Alt
20
+ attribute :description, Description
21
+ attribute :aimelt, Aimelt
22
+ attribute :source, Source
23
+ attribute :rules, Rules
24
+ attribute :express_ref, ExpressRef, collection: true
25
+ attribute :refpath, Refpath
26
+ attribute :refpath_extend, RefpathExtend
27
+
28
+ xml do
29
+ root "alt_map"
30
+
31
+ map_attribute "id", to: :id
32
+ map_attribute "alt_map.inc", to: :alt_map_inc
33
+ map_element "alt", to: :alt
34
+ map_element "description", to: :description
35
+ map_element "aimelt", to: :aimelt
36
+ map_element "source", to: :source
37
+ map_element "rules", to: :rules
38
+ map_element "express_ref", to: :express_ref
39
+ map_element "refpath", to: :refpath
40
+ map_element "refpath_extend", to: :refpath_extend
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,34 @@
1
+ require "shale"
2
+
3
+ require_relative "constraint"
4
+ require_relative "description"
5
+ require_relative "rules"
6
+ require_relative "source"
7
+
8
+ module Stepmod
9
+ module Utils
10
+ module Parsers
11
+ module Models
12
+ class AltScmap < Shale::Mapper
13
+ attribute :id, Shale::Type::String
14
+ attribute :alt_scmap_inc, Shale::Type::String
15
+ attribute :description, Description
16
+ attribute :constraint, Constraint
17
+ attribute :rules, Rules
18
+ attribute :source, Source
19
+
20
+ xml do
21
+ root "alt_scmap"
22
+
23
+ map_attribute "id", to: :id
24
+ map_attribute "alt_scmap.inc", to: :alt_scmap_inc
25
+ map_element "description", to: :description
26
+ map_element "constraint", to: :constraint
27
+ map_element "rules", to: :rules
28
+ map_element "source", to: :source
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,58 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "bigeqn"
5
+ require_relative "bold"
6
+ require_relative "bom_ref"
7
+ require_relative "eqn"
8
+ require_relative "express_extref"
9
+ require_relative "express_ref"
10
+ require_relative "i"
11
+ require_relative "module_ref"
12
+ require_relative "sub"
13
+ require_relative "sup"
14
+ require_relative "tt"
15
+
16
+ module Stepmod
17
+ module Utils
18
+ module Parsers
19
+ module Models
20
+ class B < Shale::Mapper
21
+ attribute :content, Shale::Type::String
22
+ attribute :express_ref, ExpressRef, collection: true
23
+ attribute :express_extref, ExpressExtref, collection: true
24
+ attribute :module_ref, ModuleRef, collection: true
25
+ attribute :bom_ref, BomRef, collection: true
26
+ attribute :i, Italic, collection: true
27
+ attribute :b, B, collection: true
28
+ attribute :sub, Sub, collection: true
29
+ attribute :sup, Sup, collection: true
30
+ attribute :tt, Tt, collection: true
31
+ attribute :bold, Bold, collection: true
32
+ attribute :a, A, collection: true
33
+ attribute :eqn, Eqn, collection: true
34
+ attribute :bigeqn, Bigeqn, collection: true
35
+
36
+ xml do
37
+ root "b"
38
+
39
+ map_content to: :content
40
+ map_element "express_ref", to: :express_ref
41
+ map_element "express_extref", to: :express_extref
42
+ map_element "module_ref", to: :module_ref
43
+ map_element "bom_ref", to: :bom_ref
44
+ map_element "i", to: :i
45
+ map_element "b", to: :b
46
+ map_element "sub", to: :sub
47
+ map_element "sup", to: :sup
48
+ map_element "tt", to: :tt
49
+ map_element "bold", to: :bold
50
+ map_element "a", to: :a
51
+ map_element "eqn", to: :eqn
52
+ map_element "bigeqn", to: :bigeqn
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,55 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "b"
5
+ require_relative "bold"
6
+ require_relative "bom_ref"
7
+ require_relative "express_extref"
8
+ require_relative "express_ref"
9
+ require_relative "i"
10
+ require_relative "module_ref"
11
+ require_relative "sub"
12
+ require_relative "sup"
13
+ require_relative "tt"
14
+
15
+ module Stepmod
16
+ module Utils
17
+ module Parsers
18
+ module Models
19
+ class Bigeqn < Shale::Mapper
20
+ attribute :content, Shale::Type::String
21
+ attribute :number, Shale::Type::String
22
+ attribute :express_ref, ExpressRef, collection: true
23
+ attribute :express_extref, ExpressExtref, collection: true
24
+ attribute :module_ref, ModuleRef, collection: true
25
+ attribute :bom_ref, BomRef, collection: true
26
+ attribute :i, Italic, collection: true
27
+ attribute :b, B, collection: true
28
+ attribute :sub, Sub, collection: true
29
+ attribute :sup, Sup, collection: true
30
+ attribute :tt, Tt, collection: true
31
+ attribute :bold, Bold, collection: true
32
+ attribute :a, A, collection: true
33
+
34
+ xml do
35
+ root "bigeqn"
36
+
37
+ map_content to: :content
38
+ map_attribute "number", to: :number
39
+ map_element "express_ref", to: :express_ref
40
+ map_element "express_extref", to: :express_extref
41
+ map_element "module_ref", to: :module_ref
42
+ map_element "bom_ref", to: :bom_ref
43
+ map_element "i", to: :i
44
+ map_element "b", to: :b
45
+ map_element "sub", to: :sub
46
+ map_element "sup", to: :sup
47
+ map_element "tt", to: :tt
48
+ map_element "bold", to: :bold
49
+ map_element "a", to: :a
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,52 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "b"
5
+ require_relative "bom_ref"
6
+ require_relative "express_extref"
7
+ require_relative "express_ref"
8
+ require_relative "i"
9
+ require_relative "module_ref"
10
+ require_relative "sub"
11
+ require_relative "sup"
12
+ require_relative "tt"
13
+
14
+ module Stepmod
15
+ module Utils
16
+ module Parsers
17
+ module Models
18
+ class Bold < Shale::Mapper
19
+ attribute :content, Shale::Type::String
20
+ attribute :express_ref, ExpressRef, collection: true
21
+ attribute :express_extref, ExpressExtref, collection: true
22
+ attribute :module_ref, ModuleRef, collection: true
23
+ attribute :bom_ref, BomRef, collection: true
24
+ attribute :i, Italic, collection: true
25
+ attribute :b, B, collection: true
26
+ attribute :sub, Sub, collection: true
27
+ attribute :sup, Sup, collection: true
28
+ attribute :tt, Tt, collection: true
29
+ attribute :bold, Bold, collection: true
30
+ attribute :a, A, collection: true
31
+
32
+ xml do
33
+ root "bold"
34
+
35
+ map_content to: :content
36
+ map_element "express_ref", to: :express_ref
37
+ map_element "express_extref", to: :express_extref
38
+ map_element "module_ref", to: :module_ref
39
+ map_element "bom_ref", to: :bom_ref
40
+ map_element "i", to: :i
41
+ map_element "b", to: :b
42
+ map_element "sub", to: :sub
43
+ map_element "sup", to: :sup
44
+ map_element "tt", to: :tt
45
+ map_element "bold", to: :bold
46
+ map_element "a", to: :a
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,21 @@
1
+ require "shale"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ module Parsers
6
+ module Models
7
+ class BomRef < Shale::Mapper
8
+ attribute :content, Shale::Type::String
9
+ attribute :linkend, Shale::Type::String
10
+
11
+ xml do
12
+ root "bom_ref"
13
+
14
+ map_content to: :content
15
+ map_attribute "linkend", to: :linkend
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ require "shale"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ module Parsers
6
+ module Models
7
+ class Constraint < Shale::Mapper
8
+ attribute :content, Shale::Type::String
9
+
10
+ xml do
11
+ root "constraint"
12
+
13
+ map_content to: :content
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,86 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "b"
5
+ require_relative "bigeqn"
6
+ require_relative "bold"
7
+ require_relative "bom_ref"
8
+ require_relative "dl"
9
+ require_relative "eqn"
10
+ require_relative "example"
11
+ require_relative "express_extref"
12
+ require_relative "express_ref"
13
+ require_relative "figure"
14
+ require_relative "i"
15
+ require_relative "module_ref"
16
+ require_relative "note"
17
+ require_relative "ol"
18
+ require_relative "p"
19
+ require_relative "screen"
20
+ require_relative "sub"
21
+ require_relative "sup"
22
+ require_relative "table"
23
+ require_relative "tt"
24
+ require_relative "ul"
25
+
26
+ module Stepmod
27
+ module Utils
28
+ module Parsers
29
+ module Models
30
+ class Dd < Shale::Mapper
31
+ attribute :content, Shale::Type::String
32
+ attribute :express_ref, ExpressRef, collection: true
33
+ attribute :express_extref, ExpressExtref, collection: true
34
+ attribute :module_ref, ModuleRef, collection: true
35
+ attribute :bom_ref, BomRef, collection: true
36
+ attribute :i, Italic, collection: true
37
+ attribute :b, B, collection: true
38
+ attribute :sub, Sub, collection: true
39
+ attribute :sup, Sup, collection: true
40
+ attribute :tt, Tt, collection: true
41
+ attribute :bold, Bold, collection: true
42
+ attribute :a, A, collection: true
43
+ attribute :p, P, collection: true
44
+ attribute :ul, Ul, collection: true
45
+ attribute :ol, Ol, collection: true
46
+ attribute :dl, Dl, collection: true
47
+ attribute :screen, Screen, collection: true
48
+ attribute :note, Note, collection: true
49
+ attribute :example, Example, collection: true
50
+ attribute :eqn, Eqn, collection: true
51
+ attribute :bigeqn, Bigeqn, collection: true
52
+ attribute :figure, Figure, collection: true
53
+ attribute :table, Table, collection: true
54
+
55
+ xml do
56
+ root "dd"
57
+
58
+ map_content to: :content
59
+ map_element "express_ref", to: :express_ref
60
+ map_element "express_extref", to: :express_extref
61
+ map_element "module_ref", to: :module_ref
62
+ map_element "bom_ref", to: :bom_ref
63
+ map_element "i", to: :i
64
+ map_element "b", to: :b
65
+ map_element "sub", to: :sub
66
+ map_element "sup", to: :sup
67
+ map_element "tt", to: :tt
68
+ map_element "bold", to: :bold
69
+ map_element "a", to: :a
70
+ map_element "p", to: :p
71
+ map_element "ul", to: :ul
72
+ map_element "ol", to: :ol
73
+ map_element "dl", to: :dl
74
+ map_element "screen", to: :screen
75
+ map_element "note", to: :note
76
+ map_element "example", to: :example
77
+ map_element "eqn", to: :eqn
78
+ map_element "bigeqn", to: :bigeqn
79
+ map_element "figure", to: :figure
80
+ map_element "table", to: :table
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,86 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "b"
5
+ require_relative "bigeqn"
6
+ require_relative "bold"
7
+ require_relative "bom_ref"
8
+ require_relative "dl"
9
+ require_relative "eqn"
10
+ require_relative "example"
11
+ require_relative "express_extref"
12
+ require_relative "express_ref"
13
+ require_relative "figure"
14
+ require_relative "i"
15
+ require_relative "module_ref"
16
+ require_relative "note"
17
+ require_relative "ol"
18
+ require_relative "p"
19
+ require_relative "screen"
20
+ require_relative "sub"
21
+ require_relative "sup"
22
+ require_relative "table"
23
+ require_relative "tt"
24
+ require_relative "ul"
25
+
26
+ module Stepmod
27
+ module Utils
28
+ module Parsers
29
+ module Models
30
+ class Description < Shale::Mapper
31
+ attribute :content, Shale::Type::String
32
+ attribute :express_ref, ExpressRef, collection: true
33
+ attribute :express_extref, ExpressExtref, collection: true
34
+ attribute :module_ref, ModuleRef, collection: true
35
+ attribute :bom_ref, BomRef, collection: true
36
+ attribute :i, Italic, collection: true
37
+ attribute :b, B, collection: true
38
+ attribute :sub, Sub, collection: true
39
+ attribute :sup, Sup, collection: true
40
+ attribute :tt, Tt, collection: true
41
+ attribute :bold, Bold, collection: true
42
+ attribute :a, A, collection: true
43
+ attribute :p, P, collection: true
44
+ attribute :ul, Ul, collection: true
45
+ attribute :ol, Ol, collection: true
46
+ attribute :dl, Dl, collection: true
47
+ attribute :screen, Screen, collection: true
48
+ attribute :note, Note, collection: true
49
+ attribute :example, Example, collection: true
50
+ attribute :eqn, Eqn, collection: true
51
+ attribute :bigeqn, Bigeqn, collection: true
52
+ attribute :figure, Figure, collection: true
53
+ attribute :table, Table, collection: true
54
+
55
+ xml do
56
+ root "description"
57
+
58
+ map_content to: :content
59
+ map_element "express_ref", to: :express_ref
60
+ map_element "express_extref", to: :express_extref
61
+ map_element "module_ref", to: :module_ref
62
+ map_element "bom_ref", to: :bom_ref
63
+ map_element "i", to: :i
64
+ map_element "b", to: :b
65
+ map_element "sub", to: :sub
66
+ map_element "sup", to: :sup
67
+ map_element "tt", to: :tt
68
+ map_element "bold", to: :bold
69
+ map_element "a", to: :a
70
+ map_element "p", to: :p
71
+ map_element "ul", to: :ul
72
+ map_element "ol", to: :ol
73
+ map_element "dl", to: :dl
74
+ map_element "screen", to: :screen
75
+ map_element "note", to: :note
76
+ map_element "example", to: :example
77
+ map_element "eqn", to: :eqn
78
+ map_element "bigeqn", to: :bigeqn
79
+ map_element "figure", to: :figure
80
+ map_element "table", to: :table
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,24 @@
1
+ require "shale"
2
+
3
+ require_relative "dd"
4
+ require_relative "dt"
5
+
6
+ module Stepmod
7
+ module Utils
8
+ module Parsers
9
+ module Models
10
+ class Dl < Shale::Mapper
11
+ attribute :dt, Dt, collection: true
12
+ attribute :dd, Dd, collection: true
13
+
14
+ xml do
15
+ root "dl"
16
+
17
+ map_element "dt", to: :dt
18
+ map_element "dd", to: :dd
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,86 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "b"
5
+ require_relative "bigeqn"
6
+ require_relative "bold"
7
+ require_relative "bom_ref"
8
+ require_relative "dl"
9
+ require_relative "eqn"
10
+ require_relative "example"
11
+ require_relative "express_extref"
12
+ require_relative "express_ref"
13
+ require_relative "figure"
14
+ require_relative "i"
15
+ require_relative "module_ref"
16
+ require_relative "note"
17
+ require_relative "ol"
18
+ require_relative "p"
19
+ require_relative "screen"
20
+ require_relative "sub"
21
+ require_relative "sup"
22
+ require_relative "table"
23
+ require_relative "tt"
24
+ require_relative "ul"
25
+
26
+ module Stepmod
27
+ module Utils
28
+ module Parsers
29
+ module Models
30
+ class Dt < Shale::Mapper
31
+ attribute :content, Shale::Type::String
32
+ attribute :express_ref, ExpressRef, collection: true
33
+ attribute :express_extref, ExpressExtref, collection: true
34
+ attribute :module_ref, ModuleRef, collection: true
35
+ attribute :bom_ref, BomRef, collection: true
36
+ attribute :i, Italic, collection: true
37
+ attribute :b, B, collection: true
38
+ attribute :sub, Sub, collection: true
39
+ attribute :sup, Sup, collection: true
40
+ attribute :tt, Tt, collection: true
41
+ attribute :bold, Bold, collection: true
42
+ attribute :a, A, collection: true
43
+ attribute :p, P, collection: true
44
+ attribute :ul, Ul, collection: true
45
+ attribute :ol, Ol, collection: true
46
+ attribute :dl, Dl, collection: true
47
+ attribute :screen, Screen, collection: true
48
+ attribute :note, Note, collection: true
49
+ attribute :example, Example, collection: true
50
+ attribute :eqn, Eqn, collection: true
51
+ attribute :bigeqn, Bigeqn, collection: true
52
+ attribute :figure, Figure, collection: true
53
+ attribute :table, Table, collection: true
54
+
55
+ xml do
56
+ root "dt"
57
+
58
+ map_content to: :content
59
+ map_element "express_ref", to: :express_ref
60
+ map_element "express_extref", to: :express_extref
61
+ map_element "module_ref", to: :module_ref
62
+ map_element "bom_ref", to: :bom_ref
63
+ map_element "i", to: :i
64
+ map_element "b", to: :b
65
+ map_element "sub", to: :sub
66
+ map_element "sup", to: :sup
67
+ map_element "tt", to: :tt
68
+ map_element "bold", to: :bold
69
+ map_element "a", to: :a
70
+ map_element "p", to: :p
71
+ map_element "ul", to: :ul
72
+ map_element "ol", to: :ol
73
+ map_element "dl", to: :dl
74
+ map_element "screen", to: :screen
75
+ map_element "note", to: :note
76
+ map_element "example", to: :example
77
+ map_element "eqn", to: :eqn
78
+ map_element "bigeqn", to: :bigeqn
79
+ map_element "figure", to: :figure
80
+ map_element "table", to: :table
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,57 @@
1
+ require "shale"
2
+
3
+ require_relative "a"
4
+ require_relative "b"
5
+ require_relative "bold"
6
+ require_relative "bom_ref"
7
+ require_relative "express_extref"
8
+ require_relative "express_ref"
9
+ require_relative "i"
10
+ require_relative "module_ref"
11
+ require_relative "sub"
12
+ require_relative "sup"
13
+ require_relative "tt"
14
+
15
+ module Stepmod
16
+ module Utils
17
+ module Parsers
18
+ module Models
19
+ class Eqn < Shale::Mapper
20
+ attribute :content, Shale::Type::String
21
+ attribute :number, Shale::Type::String
22
+ attribute :id, Shale::Type::String
23
+ attribute :express_ref, ExpressRef, collection: true
24
+ attribute :express_extref, ExpressExtref, collection: true
25
+ attribute :module_ref, ModuleRef, collection: true
26
+ attribute :bom_ref, BomRef, collection: true
27
+ attribute :i, Italic, collection: true
28
+ attribute :b, B, collection: true
29
+ attribute :sub, Sub, collection: true
30
+ attribute :sup, Sup, collection: true
31
+ attribute :tt, Tt, collection: true
32
+ attribute :bold, Bold, collection: true
33
+ attribute :a, A, collection: true
34
+
35
+ xml do
36
+ root "eqn"
37
+
38
+ map_content to: :content
39
+ map_attribute "number", to: :number
40
+ map_attribute "id", to: :id
41
+ map_element "express_ref", to: :express_ref
42
+ map_element "express_extref", to: :express_extref
43
+ map_element "module_ref", to: :module_ref
44
+ map_element "bom_ref", to: :bom_ref
45
+ map_element "i", to: :i
46
+ map_element "b", to: :b
47
+ map_element "sub", to: :sub
48
+ map_element "sup", to: :sup
49
+ map_element "tt", to: :tt
50
+ map_element "bold", to: :bold
51
+ map_element "a", to: :a
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end