isodoc 2.3.6 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +1 -1
- data/lib/isodoc/class_utils.rb +6 -1
- data/lib/isodoc/function/inline_simple.rb +2 -1
- data/lib/isodoc/function/utils.rb +4 -0
- data/lib/isodoc/html_function/html.rb +4 -2
- data/lib/isodoc/presentation_function/bibdata.rb +9 -9
- data/lib/isodoc/presentation_function/erefs.rb +49 -35
- data/lib/isodoc/presentation_function/refs.rb +1 -1
- data/lib/isodoc/presentation_function/section.rb +1 -1
- data/lib/isodoc/presentation_function/terms.rb +11 -11
- data/lib/isodoc/presentation_function/xrefs.rb +12 -6
- data/lib/isodoc/presentation_xml_convert.rb +2 -2
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_gen.rb +11 -11
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a7c100c4751a8d8bfe69eeaf31614c74bfeec4c56d188fd0d4a6a16c09d3257
|
4
|
+
data.tar.gz: '0858086207425a9c38bb6f12fba1a219599c4c7e469aea40e4f29255f152333b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc74e409e73b0b63f5a609e44b0a90a88cf4e83253604cbf6634f62b9c6ff12cccdc40fa2399acd4c373c44d3748ff311828890f319fc508c35e4993c88ff800
|
7
|
+
data.tar.gz: b6f7d0abe389ee3c0342fbdd862f0671bc94959eb9f7b3755e51c7aac1aad74e65127b8819f5b3f310a8e2c2ede29dd663642f9a16e12b5fdf563dd9e2e9bb4f
|
data/isodoc.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency "mathml2asciimath"
|
40
40
|
spec.add_dependency "metanorma-utils", "~> 1.4.5"
|
41
41
|
spec.add_dependency "mn2pdf"
|
42
|
-
spec.add_dependency "mn-requirements", "~> 0.
|
42
|
+
spec.add_dependency "mn-requirements", "~> 0.3.1"
|
43
43
|
spec.add_dependency "relaton-cli"
|
44
44
|
spec.add_dependency "relaton-render", "~> 0.5.2"
|
45
45
|
spec.add_dependency "roman-numerals"
|
data/lib/isodoc/class_utils.rb
CHANGED
@@ -47,6 +47,11 @@ module IsoDoc
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
def to_xml(node)
|
51
|
+
node&.to_xml(encoding: "UTF-8", indent: 0,
|
52
|
+
save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
|
53
|
+
end
|
54
|
+
|
50
55
|
def case_with_markup(linkend, casing, script, firstonly: true)
|
51
56
|
seen = false
|
52
57
|
xml = Nokogiri::XML("<root>#{linkend}</root>")
|
@@ -57,7 +62,7 @@ module IsoDoc
|
|
57
62
|
firstonly: firstonly))
|
58
63
|
seen = true if firstonly
|
59
64
|
end
|
60
|
-
xml.root.children
|
65
|
+
to_xml(xml.root.children)
|
61
66
|
end
|
62
67
|
|
63
68
|
def nearest_block_parent(node)
|
@@ -78,7 +78,7 @@ module IsoDoc
|
|
78
78
|
def html_button
|
79
79
|
return "" if @bare
|
80
80
|
|
81
|
-
'<button onclick="topFunction()" id="myBtn" '\
|
81
|
+
'<button onclick="topFunction()" id="myBtn" ' \
|
82
82
|
'title="Go to top">Top</button>'.freeze
|
83
83
|
end
|
84
84
|
|
@@ -121,7 +121,9 @@ module IsoDoc
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def underline_parse(node, out)
|
124
|
-
|
124
|
+
style = node["style"] ? " #{node['style']}" : ""
|
125
|
+
attr = { style: "text-decoration: underline#{style}" }
|
126
|
+
out.span **attr do |e|
|
125
127
|
node.children.each { |n| parse(n, e) }
|
126
128
|
end
|
127
129
|
end
|
@@ -10,7 +10,7 @@ module IsoDoc
|
|
10
10
|
address_precompose(a)
|
11
11
|
bibdata_i18n(a)
|
12
12
|
a.next =
|
13
|
-
"<localized-strings>#{i8n_name(trim_hash(@i18n.get), '').join}"\
|
13
|
+
"<localized-strings>#{i8n_name(trim_hash(@i18n.get), '').join}" \
|
14
14
|
"</localized-strings>"
|
15
15
|
end
|
16
16
|
|
@@ -24,7 +24,7 @@ module IsoDoc
|
|
24
24
|
@toctables and
|
25
25
|
ins << "<toc type='table'><title>#{@i18n.toc_tables}</title></toc>"
|
26
26
|
@tocfigures and
|
27
|
-
ins << "<toc type='recommendation'><title>#{@i18n.toc_recommendations}"\
|
27
|
+
ins << "<toc type='recommendation'><title>#{@i18n.toc_recommendations}" \
|
28
28
|
"</title></toc>"
|
29
29
|
end
|
30
30
|
|
@@ -50,17 +50,17 @@ module IsoDoc
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def presmeta(name, value)
|
53
|
-
"<presentation-metadata><name>#{name}</name><value>#{value}</value>"\
|
53
|
+
"<presentation-metadata><name>#{name}</name><value>#{value}</value>" \
|
54
54
|
"</presentation-metadata>"
|
55
55
|
end
|
56
56
|
|
57
57
|
def address_precompose1(addr)
|
58
58
|
ret = []
|
59
|
-
addr.xpath(ns("./street")).each { |s| ret << s.children
|
60
|
-
a = addr.at(ns("./city")) and ret << a.children
|
61
|
-
addr.xpath(ns("./state")).each { |s| ret << s.children
|
62
|
-
a = addr.at(ns("./country")) and ret << a.children
|
63
|
-
a = addr.at(ns("./postcode")) and ret[-1] += " #{a.children
|
59
|
+
addr.xpath(ns("./street")).each { |s| ret << to_xml(s.children) }
|
60
|
+
a = addr.at(ns("./city")) and ret << to_xml(a.children)
|
61
|
+
addr.xpath(ns("./state")).each { |s| ret << to_xml(s.children) }
|
62
|
+
a = addr.at(ns("./country")) and ret << to_xml(a.children)
|
63
|
+
a = addr.at(ns("./postcode")) and ret[-1] += " #{to_xml a.children}"
|
64
64
|
ret.join("<br/>")
|
65
65
|
end
|
66
66
|
|
@@ -118,7 +118,7 @@ module IsoDoc
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def i18n_tag(key, value)
|
121
|
-
"<localized-string key='#{key}' language='#{@lang}'>#{value}"\
|
121
|
+
"<localized-string key='#{key}' language='#{@lang}'>#{value}" \
|
122
122
|
"</localized-string>"
|
123
123
|
end
|
124
124
|
|
@@ -9,7 +9,7 @@ module IsoDoc
|
|
9
9
|
|
10
10
|
def erefstack1(elem)
|
11
11
|
locs = elem.xpath(ns("./eref")).map do |e|
|
12
|
-
[e["connective"], e
|
12
|
+
[e["connective"], to_xml(e)]
|
13
13
|
end.flatten
|
14
14
|
ret = resolve_eref_connectives(locs)
|
15
15
|
elem.replace(ret[1])
|
@@ -30,9 +30,9 @@ module IsoDoc
|
|
30
30
|
ret = resolve_eref_connectives(eref_locality_stacks(refs, target,
|
31
31
|
node))
|
32
32
|
node.delete("droploc") unless droploc
|
33
|
-
eref_localities1(target,
|
34
|
-
|
35
|
-
|
33
|
+
eref_localities1({ target: target, number: "pl",
|
34
|
+
type: refs.first.at(ns("./locality/@type")).text,
|
35
|
+
from: l10n(ret[1..-1].join), node: node, lang: @lang })
|
36
36
|
end
|
37
37
|
|
38
38
|
def can_conflate_eref_rendering?(refs)
|
@@ -61,19 +61,24 @@ module IsoDoc
|
|
61
61
|
locs1 = []
|
62
62
|
add = ""
|
63
63
|
until locs.empty?
|
64
|
-
|
65
|
-
add += locs[0..2].join
|
66
|
-
locs.shift(3)
|
67
|
-
else
|
68
|
-
locs1 << add unless add.empty?
|
69
|
-
add = ""
|
70
|
-
locs1 << locs.shift
|
71
|
-
end
|
64
|
+
locs, locs1, add = resolve_comma_connectives1(locs, locs1, add)
|
72
65
|
end
|
73
66
|
locs1 << add unless add.empty?
|
74
67
|
locs1
|
75
68
|
end
|
76
69
|
|
70
|
+
def resolve_comma_connectives1(locs, locs1, add)
|
71
|
+
if [", ", " "].include?(locs[1])
|
72
|
+
add += locs[0..2].join
|
73
|
+
locs.shift(3)
|
74
|
+
else
|
75
|
+
locs1 << add unless add.empty?
|
76
|
+
add = ""
|
77
|
+
locs1 << locs.shift
|
78
|
+
end
|
79
|
+
[locs, locs1, add]
|
80
|
+
end
|
81
|
+
|
77
82
|
def resolve_to_connectives(locs)
|
78
83
|
locs1 = []
|
79
84
|
until locs.empty?
|
@@ -108,12 +113,7 @@ module IsoDoc
|
|
108
113
|
def eref_locality_stack(ref, idx, target, node)
|
109
114
|
ret = []
|
110
115
|
if ref.name == "localityStack"
|
111
|
-
ref
|
112
|
-
l = eref_localities0(rr, j, target, node) or next
|
113
|
-
|
114
|
-
ret << l
|
115
|
-
ret << locality_delimiter(rr) unless j == ref.elements.size - 1
|
116
|
-
end
|
116
|
+
ret = eref_locality_stack1(ref, target, node, ret)
|
117
117
|
else
|
118
118
|
l = eref_localities0(ref, idx, target, node) and ret << l
|
119
119
|
end
|
@@ -121,6 +121,15 @@ module IsoDoc
|
|
121
121
|
ret
|
122
122
|
end
|
123
123
|
|
124
|
+
def eref_locality_stack1(ref, target, node, ret)
|
125
|
+
ref.elements.each_with_index do |rr, j|
|
126
|
+
l = eref_localities0(rr, j, target, node) or next
|
127
|
+
ret << l
|
128
|
+
ret << locality_delimiter(rr) unless j == ref.elements.size - 1
|
129
|
+
end
|
130
|
+
ret
|
131
|
+
end
|
132
|
+
|
124
133
|
def locality_delimiter(_loc)
|
125
134
|
", "
|
126
135
|
end
|
@@ -128,38 +137,43 @@ module IsoDoc
|
|
128
137
|
def eref_localities0(ref, _idx, target, node)
|
129
138
|
if ref["type"] == "whole" then @i18n.wholeoftext
|
130
139
|
else
|
131
|
-
eref_localities1(target, ref["type"],
|
132
|
-
|
133
|
-
|
140
|
+
eref_localities1({ target: target, type: ref["type"], number: "sg",
|
141
|
+
from: ref.at(ns("./referenceFrom"))&.text,
|
142
|
+
upto: ref.at(ns("./referenceTo"))&.text, node: node,
|
143
|
+
lang: @lang })
|
134
144
|
end
|
135
145
|
end
|
136
146
|
|
137
|
-
def eref_localities1_zh(_target, type, from, upto, node)
|
138
|
-
|
139
|
-
ret
|
140
|
-
|
141
|
-
|
147
|
+
# def eref_localities1_zh(_target, type, from, upto, node)
|
148
|
+
def eref_localities1_zh(opt)
|
149
|
+
ret = "第#{opt[:from]}" if opt[:from]
|
150
|
+
ret += "–#{opt[:upto]}" if opt[:upto]
|
151
|
+
loc = eref_locality_populate(opt[:type], opt[:node], "sg")
|
152
|
+
ret += " #{loc}" unless opt[:node]["droploc"] == "true"
|
142
153
|
ret
|
143
154
|
end
|
144
155
|
|
145
|
-
def eref_localities1(target, type, from, upto, node, lang = "en")
|
146
|
-
|
156
|
+
# def eref_localities1(target, type, from, upto, node, lang = "en")
|
157
|
+
def eref_localities1(opt)
|
158
|
+
return nil if opt[:type] == "anchor"
|
147
159
|
|
148
|
-
lang == "zh" and
|
149
|
-
return l10n(eref_localities1_zh(target, type, from, upto, node))
|
150
|
-
|
151
|
-
ret
|
152
|
-
ret += "
|
160
|
+
opt[:lang] == "zh" and
|
161
|
+
# return l10n(eref_localities1_zh(target, type, from, upto, node))
|
162
|
+
return l10n(eref_localities1_zh(opt))
|
163
|
+
ret = eref_locality_populate(opt[:type], opt[:node], opt[:number])
|
164
|
+
ret += " #{opt[:from]}" if opt[:from]
|
165
|
+
ret += "–#{opt[:upto]}" if opt[:upto]
|
153
166
|
l10n(ret)
|
154
167
|
end
|
155
168
|
|
156
|
-
def eref_locality_populate(type, node)
|
169
|
+
def eref_locality_populate(type, node, number)
|
157
170
|
return "" if node["droploc"] == "true"
|
158
171
|
|
159
172
|
loc = type.sub(/^locality:/, "")
|
160
173
|
ret = @i18n.locality[loc] || loc
|
174
|
+
number == "pl" and ret = @i18n.inflect(ret, number: "pl")
|
161
175
|
ret = case node["case"]
|
162
|
-
when "lowercase" then
|
176
|
+
when "lowercase" then ret.downcase
|
163
177
|
else Metanorma::Utils.strict_capitalize_first(ret)
|
164
178
|
end
|
165
179
|
" #{ret}"
|
@@ -20,7 +20,7 @@ module IsoDoc
|
|
20
20
|
d.remove_namespaces!
|
21
21
|
refs = d.xpath("//references/bibitem").each_with_object([]) do |b, m|
|
22
22
|
prep_for_rendering(b)
|
23
|
-
m << b
|
23
|
+
m << to_xml(b)
|
24
24
|
end.join
|
25
25
|
bibrenderer.render_all("<references>#{refs}</references>",
|
26
26
|
type: citestyle)
|
@@ -55,7 +55,7 @@ module IsoDoc
|
|
55
55
|
def annex1(elem)
|
56
56
|
lbl = @xrefs.anchor(elem["id"], :label)
|
57
57
|
if t = elem.at(ns("./title"))
|
58
|
-
t.children = "<strong>#{t.children
|
58
|
+
t.children = "<strong>#{to_xml(t.children)}</strong>"
|
59
59
|
end
|
60
60
|
prefix_name(elem, "<br/><br/>", lbl, "title")
|
61
61
|
end
|
@@ -24,7 +24,7 @@ module IsoDoc
|
|
24
24
|
concept1_linkmention(ref, render, opts)
|
25
25
|
concept1_ref(node, ref, opts)
|
26
26
|
concept1_nonital(node, opts)
|
27
|
-
node.replace(node.children
|
27
|
+
node.replace(node.children)
|
28
28
|
end
|
29
29
|
|
30
30
|
def concept1_nonital(node, opts)
|
@@ -68,8 +68,8 @@ module IsoDoc
|
|
68
68
|
!c.text? || /\S/.match(c)
|
69
69
|
end.empty?
|
70
70
|
ref.replace(@i18n.term_defined_in.sub(/%/,
|
71
|
-
ref
|
72
|
-
else ref.replace("[#{ref
|
71
|
+
to_xml(ref)))
|
72
|
+
else ref.replace("[#{to_xml(ref)}]")
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -83,7 +83,7 @@ module IsoDoc
|
|
83
83
|
label = @i18n.relatedterms[node["type"]].upcase
|
84
84
|
if p && ref
|
85
85
|
node.replace(l10n("<p><strong>#{label}:</strong> " \
|
86
|
-
"<em>#{p
|
86
|
+
"<em>#{to_xml(p)}</em> (#{Common::to_xml(ref)})</p>"))
|
87
87
|
else
|
88
88
|
node.replace(l10n("<p><strong>#{label}:</strong> " \
|
89
89
|
"<strong>**RELATED TERM NOT FOUND**</strong></p>"))
|
@@ -110,7 +110,7 @@ module IsoDoc
|
|
110
110
|
if merge_preferred_eligible?(pref, second)
|
111
111
|
n1 = pref.at(ns("./expression/name"))
|
112
112
|
n2 = second.remove.at(ns("./expression/name"))
|
113
|
-
n1.children = l10n("#{n1.children
|
113
|
+
n1.children = l10n("#{to_xml(n1.children)}; #{Common::to_xml(n2.children)}")
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
@@ -150,7 +150,7 @@ module IsoDoc
|
|
150
150
|
|
151
151
|
def designation_field(desgn, name)
|
152
152
|
f = desgn.xpath(ns("./field-of-application | ./usage-info"))
|
153
|
-
&.map { |u| u.children
|
153
|
+
&.map { |u| to_xml(u.children) }&.join(", ")
|
154
154
|
return nil if f&.empty?
|
155
155
|
|
156
156
|
name << ", <#{f}>"
|
@@ -181,7 +181,7 @@ module IsoDoc
|
|
181
181
|
def designation_pronunciation(desgn, name)
|
182
182
|
f = desgn.at(ns("./expression/pronunciation")) or return
|
183
183
|
|
184
|
-
name << ", /#{f.children
|
184
|
+
name << ", /#{to_xml(f.children)}/"
|
185
185
|
end
|
186
186
|
|
187
187
|
def termexample(docxml)
|
@@ -214,9 +214,9 @@ module IsoDoc
|
|
214
214
|
|
215
215
|
def multidef(elem)
|
216
216
|
d = elem.at(ns("./definition"))
|
217
|
-
d = d.replace("<ol><li>#{d.children
|
217
|
+
d = d.replace("<ol><li>#{to_xml(d.children)}</li></ol>").first
|
218
218
|
elem.xpath(ns("./definition")).each do |f|
|
219
|
-
f = f.replace("<li>#{f.children
|
219
|
+
f = f.replace("<li>#{to_xml(f.children)}</li>").first
|
220
220
|
d << f
|
221
221
|
end
|
222
222
|
d.wrap("<definition></definition>")
|
@@ -242,9 +242,9 @@ module IsoDoc
|
|
242
242
|
|
243
243
|
def termsource1(elem)
|
244
244
|
while elem&.next_element&.name == "termsource"
|
245
|
-
elem << "; #{elem.next_element.remove.children
|
245
|
+
elem << "; #{to_xml(elem.next_element.remove.children)}"
|
246
246
|
end
|
247
|
-
elem.children = l10n("[#{@i18n.source}: #{elem.children.
|
247
|
+
elem.children = l10n("[#{@i18n.source}: #{to_xml(elem.children).strip}]")
|
248
248
|
end
|
249
249
|
|
250
250
|
def termsource_modification(mod)
|
@@ -38,14 +38,20 @@ module IsoDoc
|
|
38
38
|
def anchor_xref(node, target)
|
39
39
|
x = @xrefs.anchor(target, :xref)
|
40
40
|
t = @xrefs.anchor(target, :title)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
case node["style"]
|
42
|
+
when "basic" then t || x
|
43
|
+
when "full" then t ? anchor_xref_full(x, t) : x
|
44
|
+
when "short", nil then x
|
45
|
+
else @xrefs.anchor(target, node[:style].to_sym)
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
49
|
+
def anchor_xref_full(num, title)
|
50
|
+
l10n("#{num}, #{title}")
|
51
|
+
end
|
52
|
+
|
48
53
|
def prefix_container?(container, node)
|
54
|
+
node["style"] == "modspec" and return false # TODO: move to mn-requirements?
|
49
55
|
type = @xrefs.anchor(node["target"], :type)
|
50
56
|
container &&
|
51
57
|
get_note_container_id(node, type) != container &&
|
@@ -66,8 +72,8 @@ module IsoDoc
|
|
66
72
|
def combine_conflated_xref_locations(locs)
|
67
73
|
out = locs.each { |l| l[:label] = anchor_value(l[:target]) }
|
68
74
|
label = @i18n.inflect(locs.first[:elem], number: "pl")
|
69
|
-
|
70
|
-
combine_conflated_xref_locations_container(locs,
|
75
|
+
out[0][:label] = l10n("#{label} #{out[0][:label]}")
|
76
|
+
combine_conflated_xref_locations_container(locs, l10n(combine_conn(out)))
|
71
77
|
end
|
72
78
|
|
73
79
|
def combine_conflated_xref_locations_container(locs, ret)
|
@@ -85,11 +85,11 @@ module IsoDoc
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def postprocess(result, filename, _dir)
|
88
|
-
|
88
|
+
to_xml_file(result, filename)
|
89
89
|
@files_to_delete.each { |f| FileUtils.rm_rf f }
|
90
90
|
end
|
91
91
|
|
92
|
-
def
|
92
|
+
def to_xml_file(result, filename)
|
93
93
|
File.open(filename, "w:UTF-8") { |f| f.write(result) }
|
94
94
|
end
|
95
95
|
end
|
data/lib/isodoc/version.rb
CHANGED
data/lib/isodoc/xref/xref_gen.rb
CHANGED
@@ -62,7 +62,7 @@ module IsoDoc
|
|
62
62
|
@anchors[n["id"]] =
|
63
63
|
{ label: termnote_label(c.print), type: "termnote",
|
64
64
|
value: c.print, elem: @labels["termnote"],
|
65
|
-
xref: l10n("#{anchor(t['id'], :xref)}, "\
|
65
|
+
xref: l10n("#{anchor(t['id'], :xref)}, " \
|
66
66
|
"#{@labels['note_xref']} #{c.print}") }
|
67
67
|
end
|
68
68
|
end
|
@@ -82,10 +82,10 @@ module IsoDoc
|
|
82
82
|
end
|
83
83
|
|
84
84
|
SECTIONS_XPATH =
|
85
|
-
"//foreword | //introduction | //acknowledgements | "\
|
86
|
-
"//preface/terms | preface/definitions | preface/references | "\
|
87
|
-
"//preface/clause | //sections/terms | //annex | "\
|
88
|
-
"//sections/clause | //sections/definitions | "\
|
85
|
+
"//foreword | //introduction | //acknowledgements | " \
|
86
|
+
"//preface/terms | preface/definitions | preface/references | " \
|
87
|
+
"//preface/clause | //sections/terms | //annex | " \
|
88
|
+
"//sections/clause | //sections/definitions | " \
|
89
89
|
"//bibliography/references | //bibliography/clause".freeze
|
90
90
|
|
91
91
|
def sections_xpath
|
@@ -93,8 +93,8 @@ module IsoDoc
|
|
93
93
|
end
|
94
94
|
|
95
95
|
CHILD_NOTES_XPATH =
|
96
|
-
"./*[not(self::xmlns:clause) and not(self::xmlns:appendix) and "\
|
97
|
-
"not(self::xmlns:terms) and not(self::xmlns:definitions)]//xmlns:note | "\
|
96
|
+
"./*[not(self::xmlns:clause) and not(self::xmlns:appendix) and " \
|
97
|
+
"not(self::xmlns:terms) and not(self::xmlns:definitions)]//xmlns:note | " \
|
98
98
|
"./xmlns:note".freeze
|
99
99
|
|
100
100
|
def note_anchor_names(sections)
|
@@ -117,11 +117,11 @@ module IsoDoc
|
|
117
117
|
end
|
118
118
|
|
119
119
|
CHILD_EXAMPLES_XPATH =
|
120
|
-
"./*[not(self::xmlns:clause) and not(self::xmlns:appendix) and "\
|
121
|
-
"not(self::xmlns:terms) and not(self::xmlns:definitions)]//"\
|
120
|
+
"./*[not(self::xmlns:clause) and not(self::xmlns:appendix) and " \
|
121
|
+
"not(self::xmlns:terms) and not(self::xmlns:definitions)]//" \
|
122
122
|
"xmlns:example | ./xmlns:example".freeze
|
123
123
|
|
124
|
-
CHILD_SECTIONS = "./clause | ./appendix | ./terms | ./definitions | "\
|
124
|
+
CHILD_SECTIONS = "./clause | ./appendix | ./terms | ./definitions | " \
|
125
125
|
"./references".freeze
|
126
126
|
|
127
127
|
def example_anchor_names(sections)
|
@@ -205,7 +205,7 @@ module IsoDoc
|
|
205
205
|
label = dterm.dup
|
206
206
|
label.xpath(ns(".//p")).each { |x| x.replace(x.children) }
|
207
207
|
label.xpath(ns(".//index")).each(&:remove)
|
208
|
-
label.children
|
208
|
+
Common::to_xml(label.children)
|
209
209
|
end
|
210
210
|
|
211
211
|
def bookmark_anchor_names(xml)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.3.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
138
|
+
version: 0.3.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: relaton-cli
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -497,7 +497,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
497
497
|
- !ruby/object:Gem::Version
|
498
498
|
version: '0'
|
499
499
|
requirements: []
|
500
|
-
rubygems_version: 3.3.
|
500
|
+
rubygems_version: 3.3.26
|
501
501
|
signing_key:
|
502
502
|
specification_version: 4
|
503
503
|
summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
|