sts 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.rubocop.yml +12 -0
- data/Gemfile +6 -0
- data/lib/sts/mapper.rb +442 -0
- data/lib/sts/niso_sts/adoption.rb +30 -0
- data/lib/sts/niso_sts/adoption_front.rb +16 -0
- data/lib/sts/niso_sts/app.rb +49 -0
- data/lib/sts/niso_sts/app_group.rb +19 -0
- data/lib/sts/niso_sts/back.rb +12 -2
- data/lib/sts/niso_sts/body.rb +2 -2
- data/lib/sts/niso_sts/caption.rb +47 -0
- data/lib/sts/niso_sts/custom_meta.rb +23 -0
- data/lib/sts/niso_sts/custom_meta_group.rb +18 -0
- data/lib/sts/niso_sts/def.rb +19 -0
- data/lib/sts/niso_sts/def_item.rb +24 -0
- data/lib/sts/niso_sts/def_list.rb +28 -0
- data/lib/sts/niso_sts/display_formula.rb +27 -0
- data/lib/sts/niso_sts/document_identification.rb +7 -7
- data/lib/sts/niso_sts/ext_link.rb +20 -0
- data/lib/sts/niso_sts/figure.rb +40 -0
- data/lib/sts/niso_sts/fn.rb +24 -0
- data/lib/sts/niso_sts/fn_group.rb +19 -0
- data/lib/sts/niso_sts/front.rb +8 -2
- data/lib/sts/niso_sts/graphic.rb +29 -0
- data/lib/sts/niso_sts/inline_formula.rb +22 -0
- data/lib/sts/niso_sts/list.rb +9 -1
- data/lib/sts/niso_sts/list_item.rb +25 -0
- data/lib/sts/niso_sts/meta_note.rb +24 -0
- data/lib/sts/niso_sts/metadata_iso.rb +2 -2
- data/lib/sts/niso_sts/metadata_std.rb +59 -0
- data/lib/sts/niso_sts/mixed_citation.rb +27 -0
- data/lib/sts/niso_sts/non_normative_example.rb +22 -0
- data/lib/sts/niso_sts/non_normative_note.rb +8 -2
- data/lib/sts/niso_sts/object_id.rb +23 -0
- data/lib/sts/niso_sts/page_count.rb +2 -2
- data/lib/sts/niso_sts/paragraph.rb +36 -2
- data/lib/sts/niso_sts/permissions.rb +20 -0
- data/lib/sts/niso_sts/reference.rb +4 -1
- data/lib/sts/niso_sts/reference_list.rb +6 -1
- data/lib/sts/niso_sts/reference_standard.rb +17 -6
- data/lib/sts/niso_sts/section.rb +37 -9
- data/lib/sts/niso_sts/standard.rb +14 -1
- data/lib/sts/niso_sts/standard_identification.rb +13 -7
- data/lib/sts/niso_sts/standard_ref.rb +2 -2
- data/lib/sts/niso_sts/std_cross_reference.rb +18 -0
- data/lib/sts/niso_sts/std_id.rb +24 -0
- data/lib/sts/niso_sts/std_id_group.rb +19 -0
- data/lib/sts/niso_sts/term_display.rb +2 -2
- data/lib/sts/niso_sts/term_section.rb +10 -3
- data/lib/sts/niso_sts/title.rb +22 -0
- data/lib/sts/niso_sts/title_wrap.rb +27 -3
- data/lib/sts/niso_sts.rb +3 -0
- data/lib/sts/tbx_iso_tml/bold.rb +18 -0
- data/lib/sts/tbx_iso_tml/caption.rb +17 -0
- data/lib/sts/tbx_iso_tml/col.rb +23 -0
- data/lib/sts/tbx_iso_tml/definition.rb +24 -1
- data/lib/sts/tbx_iso_tml/entailed_term.rb +26 -0
- data/lib/sts/tbx_iso_tml/example.rb +16 -1
- data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -2
- data/lib/sts/tbx_iso_tml/external_source.rb +2 -2
- data/lib/sts/tbx_iso_tml/fn.rb +23 -0
- data/lib/sts/tbx_iso_tml/fn_group.rb +19 -0
- data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -2
- data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -2
- data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -2
- data/lib/sts/tbx_iso_tml/italic.rb +20 -0
- data/lib/sts/tbx_iso_tml/lang_set.rb +11 -7
- data/lib/sts/tbx_iso_tml/math.rb +62 -0
- data/lib/sts/tbx_iso_tml/mfenced.rb +43 -0
- data/lib/sts/tbx_iso_tml/mfrac.rb +33 -0
- data/lib/sts/tbx_iso_tml/mi.rb +19 -0
- data/lib/sts/tbx_iso_tml/mrow.rb +46 -0
- data/lib/sts/tbx_iso_tml/mspace.rb +18 -0
- data/lib/sts/tbx_iso_tml/mstyle.rb +29 -0
- data/lib/sts/tbx_iso_tml/msub.rb +34 -0
- data/lib/sts/tbx_iso_tml/msup.rb +27 -0
- data/lib/sts/tbx_iso_tml/munder.rb +20 -0
- data/lib/sts/tbx_iso_tml/munderover.rb +24 -0
- data/lib/sts/tbx_iso_tml/named_content.rb +20 -0
- data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -2
- data/lib/sts/tbx_iso_tml/note.rb +31 -2
- data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -2
- data/lib/sts/tbx_iso_tml/see.rb +2 -2
- data/lib/sts/tbx_iso_tml/semantics.rb +29 -0
- data/lib/sts/tbx_iso_tml/source.rb +6 -1
- data/lib/sts/tbx_iso_tml/sup.rb +24 -0
- data/lib/sts/tbx_iso_tml/table.rb +32 -0
- data/lib/sts/tbx_iso_tml/table_wrap.rb +33 -0
- data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +19 -0
- data/lib/sts/tbx_iso_tml/tbody.rb +26 -0
- data/lib/sts/tbx_iso_tml/td.rb +60 -0
- data/lib/sts/tbx_iso_tml/term.rb +31 -2
- data/lib/sts/tbx_iso_tml/term_entry.rb +2 -3
- data/lib/sts/tbx_iso_tml/term_information_group.rb +5 -2
- data/lib/sts/tbx_iso_tml/term_type.rb +2 -2
- data/lib/sts/tbx_iso_tml/th.rb +50 -0
- data/lib/sts/tbx_iso_tml/thead.rb +26 -0
- data/lib/sts/tbx_iso_tml/tr.rb +22 -0
- data/lib/sts/tbx_iso_tml/xref.rb +26 -0
- data/lib/sts/tbx_iso_tml.rb +8 -0
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -0
- data/sts.gemspec +2 -8
- metadata +67 -63
data/lib/sts/tbx_iso_tml/see.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "mrow"
|
6
|
+
require_relative "munder"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module TbxIsoTml
|
10
|
+
class Semantics < Sts::Mapper
|
11
|
+
attribute :mrow, Mrow, collection: true
|
12
|
+
attribute :mo, Shale::Type::String
|
13
|
+
attribute :mtext, Shale::Type::String
|
14
|
+
attribute :munder, Sts::TbxIsoTml::Munder
|
15
|
+
|
16
|
+
xml do
|
17
|
+
root "math"
|
18
|
+
namespace "http://www.w3.org/1998/Math/MathML", "mml"
|
19
|
+
|
20
|
+
map_element "mrow", to: :mrow
|
21
|
+
map_element "mo", to: :mo
|
22
|
+
map_element "munder", to: :munder
|
23
|
+
map_element "mtext", to: :mtext
|
24
|
+
|
25
|
+
map_content to: :content
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -2,16 +2,21 @@
|
|
2
2
|
|
3
3
|
require "shale"
|
4
4
|
|
5
|
+
require_relative "italic"
|
6
|
+
require_relative "../mapper"
|
7
|
+
|
5
8
|
module Sts
|
6
9
|
module TbxIsoTml
|
7
|
-
class Source <
|
10
|
+
class Source < Sts::Mapper
|
8
11
|
attribute :value, Shale::Type::String
|
12
|
+
attribute :italic, Italic
|
9
13
|
|
10
14
|
xml do
|
11
15
|
root "source"
|
12
16
|
namespace "urn:iso:std:iso:30042:ed-1", "tbx"
|
13
17
|
|
14
18
|
map_content to: :value
|
19
|
+
map_element "italic", to: :italic, namespace: nil, prefix: nil
|
15
20
|
end
|
16
21
|
end
|
17
22
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
require_relative "../mapper"
|
6
|
+
require_relative "xref"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module TbxIsoTml
|
10
|
+
class Xref < Sts::Mapper; end
|
11
|
+
|
12
|
+
class Sup < Sts::Mapper
|
13
|
+
attribute :value, Shale::Type::String
|
14
|
+
attribute :xref, Xref
|
15
|
+
|
16
|
+
xml do
|
17
|
+
root "sup"
|
18
|
+
|
19
|
+
map_element "xref", to: :xref, namespace: nil, prefix: nil
|
20
|
+
map_content to: :value
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "col"
|
6
|
+
require_relative "thead"
|
7
|
+
require_relative "tbody"
|
8
|
+
|
9
|
+
module Sts
|
10
|
+
module TbxIsoTml
|
11
|
+
class Table < Sts::Mapper
|
12
|
+
attribute :col, Sts::TbxIsoTml::Col, collection: true
|
13
|
+
attribute :thead, Sts::TbxIsoTml::Thead
|
14
|
+
attribute :tbody, Sts::TbxIsoTml::Tbody
|
15
|
+
attribute :border, Shale::Type::String
|
16
|
+
attribute :rules, Shale::Type::String
|
17
|
+
attribute :frame, Shale::Type::String
|
18
|
+
|
19
|
+
xml do
|
20
|
+
root "table"
|
21
|
+
|
22
|
+
map_attribute "border", to: :border
|
23
|
+
map_attribute "rules", to: :rules
|
24
|
+
map_attribute "frame", to: :frame
|
25
|
+
|
26
|
+
map_element "col", to: :col
|
27
|
+
map_element "thead", to: :thead
|
28
|
+
map_element "tbody", to: :tbody
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "table"
|
6
|
+
require_relative "table_wrap_foot"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module TbxIsoTml
|
10
|
+
class TableWrap < Sts::Mapper
|
11
|
+
attribute :id, Shale::Type::String
|
12
|
+
attribute :orientation, Shale::Type::String
|
13
|
+
attribute :label, Shale::Type::String
|
14
|
+
attribute :table, Sts::TbxIsoTml::Table, collection: true
|
15
|
+
attribute :table_wrap_foot, Sts::TbxIsoTml::TableWrapFoot
|
16
|
+
|
17
|
+
# TODO: This require will cause a loop when defined in header
|
18
|
+
require_relative "../niso_sts/caption"
|
19
|
+
attribute :caption, Sts::NisoSts::Caption
|
20
|
+
|
21
|
+
xml do
|
22
|
+
root "table-wrap"
|
23
|
+
|
24
|
+
map_attribute "id", to: :id
|
25
|
+
map_attribute "orientation", to: :orientation
|
26
|
+
map_element "label", to: :label
|
27
|
+
map_element "caption", to: :caption
|
28
|
+
map_element "table", to: :table
|
29
|
+
map_element "table-wrap-foot", to: :table_wrap_foot
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "fn_group"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module TbxIsoTml
|
9
|
+
class TableWrapFoot < Sts::Mapper
|
10
|
+
attribute :fn_group, Sts::TbxIsoTml::FnGroup
|
11
|
+
|
12
|
+
xml do
|
13
|
+
root "table-wrap-foot"
|
14
|
+
|
15
|
+
map_element "fn-group", to: :fn_group
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "tr"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module TbxIsoTml
|
9
|
+
class Tbody < Sts::Mapper
|
10
|
+
attribute :tr, Sts::TbxIsoTml::Tr, collection: true
|
11
|
+
attribute :char, Shale::Type::String
|
12
|
+
attribute :charoff, Shale::Type::String
|
13
|
+
attribute :valign, Shale::Type::String
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "tbody"
|
17
|
+
|
18
|
+
map_attribute "char", to: :char
|
19
|
+
map_attribute "charoff", to: :charoff
|
20
|
+
map_attribute "valign", to: :valign
|
21
|
+
|
22
|
+
map_element "tr", to: :tr
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "italic"
|
6
|
+
require_relative "xref"
|
7
|
+
require_relative "bold"
|
8
|
+
require_relative "../niso_sts/reference_standard"
|
9
|
+
require_relative "../niso_sts/inline_formula"
|
10
|
+
require_relative "../niso_sts/non_normative_note"
|
11
|
+
require_relative "../niso_sts/graphic"
|
12
|
+
require_relative "../niso_sts/def_list"
|
13
|
+
|
14
|
+
module Sts
|
15
|
+
module TbxIsoTml
|
16
|
+
class Td < Sts::Mapper
|
17
|
+
attribute :content, Shale::Type::String
|
18
|
+
attribute :align, Shale::Type::String
|
19
|
+
attribute :bold, Bold
|
20
|
+
attribute :italic, Italic
|
21
|
+
attribute :content_type, Shale::Type::String
|
22
|
+
attribute :char, Shale::Type::String
|
23
|
+
attribute :charoff, Shale::Type::String
|
24
|
+
attribute :colspan, Shale::Type::String
|
25
|
+
attribute :rowspan, Shale::Type::String
|
26
|
+
attribute :valign, Shale::Type::String
|
27
|
+
attribute :inline_formula, Sts::NisoSts::InlineFormula, collection: true
|
28
|
+
attribute :non_normative_note, Sts::NisoSts::NonNormativeNote
|
29
|
+
attribute :list, Sts::NisoSts::List
|
30
|
+
attribute :xref, Xref
|
31
|
+
attribute :std, Sts::NisoSts::ReferenceStandard
|
32
|
+
attribute :graphic, Sts::NisoSts::Graphic
|
33
|
+
attribute :def_list, Sts::NisoSts::DefList
|
34
|
+
|
35
|
+
xml do
|
36
|
+
root "tr"
|
37
|
+
|
38
|
+
map_content to: :content
|
39
|
+
|
40
|
+
map_attribute "align", to: :align
|
41
|
+
map_attribute "content-type", to: :content_type
|
42
|
+
map_attribute "char", to: :char
|
43
|
+
map_attribute "charoff", to: :charoff
|
44
|
+
map_attribute "colspan", to: :colspan
|
45
|
+
map_attribute "rowspan", to: :rowspan
|
46
|
+
map_attribute "valign", to: :valign
|
47
|
+
|
48
|
+
map_element "italic", to: :italic
|
49
|
+
map_element "bold", to: :bold
|
50
|
+
map_element "xref", to: :xref
|
51
|
+
map_element "std", to: :std
|
52
|
+
map_element "list", to: :list
|
53
|
+
map_element "inline-formula", to: :inline_formula
|
54
|
+
map_element "non-normative-note", to: :non_normative_note
|
55
|
+
map_element "graphic", to: :graphic
|
56
|
+
map_element "def-list", to: :def_list
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/lib/sts/tbx_iso_tml/term.rb
CHANGED
@@ -1,18 +1,47 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "italic"
|
6
|
+
require_relative "math"
|
7
|
+
require_relative "named_content"
|
8
|
+
require_relative "xref"
|
9
|
+
|
10
|
+
require_relative "../niso_sts/inline_formula"
|
4
11
|
|
5
12
|
module Sts
|
6
13
|
module TbxIsoTml
|
7
|
-
class Term <
|
14
|
+
class Term < Sts::Mapper
|
8
15
|
attribute :id, Shale::Type::String
|
16
|
+
attribute :script, Shale::Type::String
|
9
17
|
attribute :value, Shale::Type::String
|
18
|
+
attribute :italic, Sts::TbxIsoTml::Italic
|
19
|
+
attribute :bold, Shale::Type::String
|
20
|
+
attribute :sub, Shale::Type::String
|
21
|
+
attribute :math, Sts::TbxIsoTml::Math
|
22
|
+
attribute :xref, Sts::TbxIsoTml::Xref
|
23
|
+
attribute :inline_formula, Sts::NisoSts::InlineFormula
|
24
|
+
attribute :named_content, Sts::TbxIsoTml::NamedContent
|
10
25
|
|
11
26
|
xml do
|
12
27
|
root "term"
|
13
28
|
namespace "urn:iso:std:iso:30042:ed-1", "tbx"
|
14
29
|
|
15
30
|
map_attribute "id", to: :id
|
31
|
+
map_attribute "script", to: :script
|
32
|
+
map_element "inline-formula", to: :inline_formula,
|
33
|
+
namespace: nil,
|
34
|
+
prefix: nil
|
35
|
+
map_element "named-content", to: :named_content,
|
36
|
+
namespace: nil,
|
37
|
+
prefix: nil
|
38
|
+
map_element "italic", to: :italic, namespace: nil, prefix: nil
|
39
|
+
map_element "bold", to: :bold, namespace: nil, prefix: nil
|
40
|
+
map_element "sub", to: :sub, namespace: nil, prefix: nil
|
41
|
+
map_element "xref", to: :xref, namespace: nil, prefix: nil
|
42
|
+
map_element "math", to: :math,
|
43
|
+
namespace: "http://www.w3.org/1998/Math/MathML",
|
44
|
+
prefix: "mml"
|
16
45
|
map_content to: :value
|
17
46
|
end
|
18
47
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
require_relative "lang_set"
|
6
6
|
require_relative "external_graphic"
|
7
7
|
|
8
8
|
module Sts
|
9
9
|
module TbxIsoTml
|
10
|
-
class TermEntry <
|
10
|
+
class TermEntry < Sts::Mapper
|
11
11
|
attribute :id, Shale::Type::String
|
12
12
|
attribute :lang_set, LangSet, collection: true
|
13
13
|
attribute :x_graphic, ExternalGraphic, collection: true
|
@@ -20,7 +20,6 @@ module Sts
|
|
20
20
|
map_element "langSet", to: :lang_set
|
21
21
|
map_element "xGraphic", to: :x_graphic
|
22
22
|
end
|
23
|
-
|
24
23
|
end
|
25
24
|
end
|
26
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
require_relative "term"
|
6
6
|
require_relative "part_of_speech"
|
@@ -12,9 +12,10 @@ require_relative "term_type"
|
|
12
12
|
|
13
13
|
module Sts
|
14
14
|
module TbxIsoTml
|
15
|
-
class TermInformationGroup <
|
15
|
+
class TermInformationGroup < Sts::Mapper
|
16
16
|
attribute :term, Term
|
17
17
|
attribute :pos, PartOfSpeech
|
18
|
+
attribute :id, Shale::Type::String
|
18
19
|
attribute :usage_note, Shale::Type::String
|
19
20
|
attribute :normative_authorization, NormativeAuthorization
|
20
21
|
attribute :geographical_usage, GeographicalUsage
|
@@ -27,6 +28,8 @@ module Sts
|
|
27
28
|
root "tig"
|
28
29
|
namespace "urn:iso:std:iso:30042:ed-1", "tbx"
|
29
30
|
|
31
|
+
map_attribute "id", to: :id
|
32
|
+
|
30
33
|
map_element "term", to: :term
|
31
34
|
map_element "partOfSpeech", to: :pos
|
32
35
|
map_element "usageNote", to: :usage_note
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "italic"
|
6
|
+
require_relative "bold"
|
7
|
+
require_relative "xref"
|
8
|
+
require_relative "../niso_sts/reference_standard"
|
9
|
+
require_relative "../niso_sts/inline_formula"
|
10
|
+
|
11
|
+
module Sts
|
12
|
+
module TbxIsoTml
|
13
|
+
class Th < Sts::Mapper
|
14
|
+
attribute :content, Shale::Type::String
|
15
|
+
attribute :colspan, Shale::Type::String
|
16
|
+
attribute :align, Shale::Type::String
|
17
|
+
attribute :rowspan, Shale::Type::String
|
18
|
+
attribute :break, Shale::Type::String
|
19
|
+
attribute :content_type, Shale::Type::String
|
20
|
+
attribute :char, Shale::Type::String
|
21
|
+
attribute :charoff, Shale::Type::String
|
22
|
+
attribute :valign, Shale::Type::String
|
23
|
+
attribute :italic, Italic
|
24
|
+
attribute :bold, Bold
|
25
|
+
attribute :std, Sts::NisoSts::ReferenceStandard
|
26
|
+
attribute :xref, Xref
|
27
|
+
attribute :inline_formula, Sts::NisoSts::InlineFormula, collection: true
|
28
|
+
|
29
|
+
xml do
|
30
|
+
root "th"
|
31
|
+
|
32
|
+
map_content to: :content
|
33
|
+
map_attribute "colspan", to: :colspan
|
34
|
+
map_attribute "align", to: :align
|
35
|
+
map_attribute "rowspan", to: :rowspan
|
36
|
+
map_attribute "content-type", to: :content_type
|
37
|
+
map_attribute "char", to: :char
|
38
|
+
map_attribute "charoff", to: :charoff
|
39
|
+
map_attribute "valign", to: :valign
|
40
|
+
|
41
|
+
map_element "break", to: :break, render_nil: true
|
42
|
+
map_element "italic", to: :italic
|
43
|
+
map_element "bold", to: :bold
|
44
|
+
map_element "std", to: :std
|
45
|
+
map_element "xref", to: :xref
|
46
|
+
map_element "inline-formula", to: :inline_formula
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "tr"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module TbxIsoTml
|
9
|
+
class Thead < Sts::Mapper
|
10
|
+
attribute :tr, Sts::TbxIsoTml::Tr, collection: true
|
11
|
+
attribute :char, Shale::Type::String
|
12
|
+
attribute :charoff, Shale::Type::String
|
13
|
+
attribute :valign, Shale::Type::String
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "tbody"
|
17
|
+
|
18
|
+
map_attribute "char", to: :char
|
19
|
+
map_attribute "charoff", to: :charoff
|
20
|
+
map_attribute "valign", to: :valign
|
21
|
+
|
22
|
+
map_element "tr", to: :tr
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "th"
|
6
|
+
require_relative "td"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module TbxIsoTml
|
10
|
+
class Tr < Sts::Mapper
|
11
|
+
attribute :th, Sts::TbxIsoTml::Th, collection: true
|
12
|
+
attribute :td, Sts::TbxIsoTml::Td, collection: true
|
13
|
+
|
14
|
+
xml do
|
15
|
+
root "tr"
|
16
|
+
|
17
|
+
map_element "th", to: :th
|
18
|
+
map_element "td", to: :td
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
require_relative "../mapper"
|
6
|
+
require_relative "sup"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module TbxIsoTml
|
10
|
+
class Xref < Sts::Mapper
|
11
|
+
attribute :ref_type, Shale::Type::String
|
12
|
+
attribute :rid, Shale::Type::String
|
13
|
+
attribute :value, Shale::Type::String
|
14
|
+
attribute :sup, Sup
|
15
|
+
|
16
|
+
xml do
|
17
|
+
root "xref"
|
18
|
+
|
19
|
+
map_attribute "ref-type", to: :ref_type
|
20
|
+
map_attribute "rid", to: :rid
|
21
|
+
map_element "sup", to: :sup
|
22
|
+
map_content to: :value
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/sts/tbx_iso_tml.rb
CHANGED
@@ -5,7 +5,9 @@ module Sts
|
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
|
+
require_relative "tbx_iso_tml/caption"
|
8
9
|
require_relative "tbx_iso_tml/definition"
|
10
|
+
require_relative "tbx_iso_tml/entailed_term"
|
9
11
|
require_relative "tbx_iso_tml/example"
|
10
12
|
require_relative "tbx_iso_tml/external_graphic"
|
11
13
|
require_relative "tbx_iso_tml/external_source"
|
@@ -17,6 +19,12 @@ require_relative "tbx_iso_tml/note"
|
|
17
19
|
require_relative "tbx_iso_tml/part_of_speech"
|
18
20
|
require_relative "tbx_iso_tml/see"
|
19
21
|
require_relative "tbx_iso_tml/source"
|
22
|
+
require_relative "tbx_iso_tml/table_wrap"
|
23
|
+
require_relative "tbx_iso_tml/table_wrap_foot"
|
24
|
+
require_relative "tbx_iso_tml/tbody"
|
25
|
+
require_relative "tbx_iso_tml/tr"
|
26
|
+
require_relative "tbx_iso_tml/th"
|
27
|
+
require_relative "tbx_iso_tml/td"
|
20
28
|
require_relative "tbx_iso_tml/term"
|
21
29
|
require_relative "tbx_iso_tml/term_entry"
|
22
30
|
require_relative "tbx_iso_tml/term_information_group"
|
data/lib/sts/version.rb
CHANGED
data/lib/sts.rb
CHANGED
data/sts.gemspec
CHANGED
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
|
23
23
|
|
24
24
|
# Specify which files should be added to the gem when it is released.
|
25
|
-
spec.files
|
26
|
-
|
25
|
+
spec.files = all_files_in_git
|
26
|
+
.reject { |f| f.match(%r{\A(?:test|spec|features|bin|\.)/}) }
|
27
27
|
|
28
28
|
spec.bindir = "exe"
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
@@ -32,10 +32,4 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency "nokogiri"
|
33
33
|
spec.add_dependency "shale"
|
34
34
|
# spec.add_dependency "thor"
|
35
|
-
|
36
|
-
spec.add_development_dependency "pry", "~> 0.14.0"
|
37
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
38
|
-
spec.add_development_dependency "rspec", "~> 3.10"
|
39
|
-
# spec.add_development_dependency "rubocop"
|
40
|
-
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
41
35
|
end
|