metanorma-bipm 1.1.7 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/bipm/basicdoc.rng +21 -4
- data/lib/asciidoctor/bipm/bipm.rng +22 -17
- data/lib/asciidoctor/bipm/isodoc.rng +241 -61
- data/lib/asciidoctor/bipm/reqt.rng +23 -2
- data/lib/isodoc/bipm/base_convert.rb +12 -1
- data/lib/isodoc/bipm/bipm.brochure.xsl +623 -77
- data/lib/isodoc/bipm/bipm.guide.xsl +623 -77
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +623 -77
- data/lib/isodoc/bipm/bipm.rapport.xsl +623 -77
- data/lib/isodoc/bipm/html/htmlstyle.css +7 -1
- data/lib/isodoc/bipm/html/htmlstyle.scss +8 -1
- data/lib/isodoc/bipm/html_convert.rb +4 -5
- data/lib/isodoc/bipm/jcgm.standard.xsl +365 -73
- data/lib/isodoc/bipm/presentation_xml_convert.rb +37 -20
- data/lib/isodoc/bipm/xref.rb +10 -9
- data/lib/metanorma/bipm/version.rb +1 -1
- metadata +2 -2
@@ -18,16 +18,13 @@ module IsoDoc
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def eref_localities1(target, type, from, to, delim, n, lang = "en")
|
21
|
-
|
22
|
-
@iso.eref_localities1(target, type, from, to, delim, n, lang)
|
23
|
-
|
24
|
-
super
|
25
|
-
end
|
21
|
+
@jcgm and
|
22
|
+
return @iso.eref_localities1(target, type, from, to, delim, n, lang)
|
23
|
+
super
|
26
24
|
end
|
27
25
|
|
28
26
|
def table1(elem)
|
29
|
-
return if labelled_ancestor(elem)
|
30
|
-
return if elem["unnumbered"]
|
27
|
+
return if labelled_ancestor(elem) || elem["unnumbered"]
|
31
28
|
|
32
29
|
n = @xrefs.anchor(elem["id"], :label, false)
|
33
30
|
prefix_name(elem, ".<tab/>",
|
@@ -47,27 +44,42 @@ module IsoDoc
|
|
47
44
|
return if elem["unnumbered"] == "true"
|
48
45
|
|
49
46
|
lbl = @xrefs.anchor(elem["id"], :label)
|
50
|
-
|
47
|
+
t = elem.at(ns("./title")) and
|
51
48
|
t.children = "<strong>#{t.children.to_xml}</strong>"
|
52
|
-
end
|
53
49
|
prefix_name(elem, ".<tab/>", lbl, "title")
|
54
50
|
end
|
55
51
|
|
56
52
|
def clause(docxml)
|
53
|
+
quotedtitles(docxml)
|
57
54
|
super
|
58
|
-
|
55
|
+
@jcgm and
|
59
56
|
docxml.xpath(ns("//preface/introduction[clause]")).each do |f|
|
60
57
|
clause1(f)
|
61
58
|
end
|
62
|
-
end
|
63
59
|
end
|
64
60
|
|
65
61
|
def clause1(elem)
|
66
|
-
|
67
|
-
|
62
|
+
elem.at(("./ancestor::*[@unnumbered = 'true']")) and
|
63
|
+
elem["unnumbered"] = "true"
|
64
|
+
|
68
65
|
super
|
69
66
|
end
|
70
67
|
|
68
|
+
def prefix_name(node, delim, number, elem)
|
69
|
+
return if number.nil? || number.empty?
|
70
|
+
|
71
|
+
unless name = node.at(ns("./#{elem}[not(@type = 'quoted')]"))
|
72
|
+
return if node.at(ns("./#{elem}[@type = 'quoted']"))
|
73
|
+
|
74
|
+
node.children.empty? and node.add_child("<#{elem}></#{elem}>") or
|
75
|
+
node.children.first.previous = "<#{elem}></#{elem}>"
|
76
|
+
name = node.children.first
|
77
|
+
end
|
78
|
+
if name.children.empty? then name.add_child(number)
|
79
|
+
else (name.children.first.previous = "#{number}#{delim}")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
71
83
|
def conversions(docxml)
|
72
84
|
super
|
73
85
|
doccontrol docxml
|
@@ -111,7 +123,7 @@ module IsoDoc
|
|
111
123
|
i = 3
|
112
124
|
while list_draft(xml, i) != ["", ""]
|
113
125
|
ret += "<tr>#{list_draft(xml, i).map { |x| "<td>#{x}</td>" }.join} "\
|
114
|
-
|
126
|
+
"<td/></tr>"
|
115
127
|
i += 1
|
116
128
|
end
|
117
129
|
ret
|
@@ -135,7 +147,7 @@ module IsoDoc
|
|
135
147
|
|
136
148
|
COCHAIR = "xmlns:role[contains(text(),'co-chair')]".freeze
|
137
149
|
CHAIR = "[xmlns:role[contains(text(),'chair')]"\
|
138
|
-
|
150
|
+
"[not(contains(text(),'co-chair'))]]".freeze
|
139
151
|
|
140
152
|
def list_cochairs(xml)
|
141
153
|
ret = list_people(xml, "//bibdata/contributor[#{COCHAIR}]/person")
|
@@ -167,11 +179,11 @@ module IsoDoc
|
|
167
179
|
end
|
168
180
|
|
169
181
|
def twitter_cldr_localiser_symbols
|
170
|
-
{ group: " ", fraction_group: " ",
|
171
|
-
fraction_group_digits: 3 }
|
182
|
+
{ group: " ", fraction_group: " ", fraction_group_digits: 3 }
|
172
183
|
end
|
173
184
|
|
174
185
|
def mathml1(elem, locale)
|
186
|
+
asciimath_dup(elem)
|
175
187
|
localize_maths(elem, locale)
|
176
188
|
end
|
177
189
|
|
@@ -208,9 +220,7 @@ module IsoDoc
|
|
208
220
|
def jcgm_eref(docxml, xpath)
|
209
221
|
return unless @jcgm
|
210
222
|
|
211
|
-
docxml.xpath(ns(xpath)).each
|
212
|
-
extract_brackets(x)
|
213
|
-
end
|
223
|
+
docxml.xpath(ns(xpath)).each { |x| extract_brackets(x) }
|
214
224
|
# merge adjacent text nodes
|
215
225
|
docxml.root.replace(Nokogiri::XML(docxml.root.to_xml).root)
|
216
226
|
docxml.xpath(ns(xpath)).each do |x| # rubocop: disable Style/CombinableLoops
|
@@ -233,6 +243,13 @@ module IsoDoc
|
|
233
243
|
end
|
234
244
|
end
|
235
245
|
|
246
|
+
def quotedtitles(docxml)
|
247
|
+
docxml.xpath(ns("//variant-title[@type = 'quoted']")).each do |t|
|
248
|
+
t.name = "title"
|
249
|
+
t.children.first.previous = "<blacksquare/>"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
236
253
|
include Init
|
237
254
|
end
|
238
255
|
end
|
data/lib/isodoc/bipm/xref.rb
CHANGED
@@ -61,16 +61,16 @@ module IsoDoc
|
|
61
61
|
end
|
62
62
|
|
63
63
|
NUMBERED_SUBCLAUSES = "./clause[not(@unnumbered = 'true')] | "\
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
"./references[not(@unnumbered = 'true')] | "\
|
65
|
+
"./term[not(@unnumbered = 'true')] | "\
|
66
|
+
"./terms[not(@unnumbered = 'true')] | "\
|
67
|
+
"./definitions[not(@unnumbered = 'true')]".freeze
|
68
68
|
|
69
69
|
UNNUMBERED_SUBCLAUSES = "./clause[@unnumbered = 'true'] | "\
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
70
|
+
"./references[@unnumbered = 'true'] | "\
|
71
|
+
"./term[@unnumbered = 'true'] | "\
|
72
|
+
"./terms[@unnumbered = 'true'] | "\
|
73
|
+
"./definitions[@unnumbered = 'true']".freeze
|
74
74
|
|
75
75
|
def section_name_anchors(clause, num, lvl)
|
76
76
|
lbl = @jcgm ? "clause_jcgm" : "clause"
|
@@ -157,9 +157,10 @@ module IsoDoc
|
|
157
157
|
annex_names1(a, num.to_s, 1)
|
158
158
|
else
|
159
159
|
i = Counter.new
|
160
|
+
prefix = @jcgm ? "" : "A"
|
160
161
|
clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
|
161
162
|
i.increment(c)
|
162
|
-
annex_names1(c, "#{num}.#{i.print}", 2)
|
163
|
+
annex_names1(c, "#{prefix}#{num}.#{i.print}", 2)
|
163
164
|
end
|
164
165
|
clause.xpath(ns(UNNUMBERED_SUBCLAUSES))
|
165
166
|
.each { |c| unnumbered_annex_names1(c, 2) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|