metanorma-bipm 2.0.3 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,12 +31,12 @@ module IsoDoc
31
31
  if docxml.root.name == "metanorma-collection" &&
32
32
  docxml.at("#{q}[. = 'fr']", "m" => n) &&
33
33
  docxml.at("#{q}[. = 'en']", "m" => n)
34
- "#{super} --split-by-language"
35
- else
36
- super
34
+ return super.tap do |h|
35
+ h["--split-by-language"] = nil
36
+ end
37
37
  end
38
+ super
38
39
  end
39
40
  end
40
41
  end
41
42
  end
42
-
@@ -17,9 +17,9 @@ module IsoDoc
17
17
  super
18
18
  end
19
19
 
20
- def eref_localities1(target, type, from, to, delim, n, lang = "en")
21
- @jcgm and
22
- return @iso.eref_localities1(target, type, from, to, delim, n, lang)
20
+ def eref_localities1(target, type, from, upto, node, lang = "en")
21
+ @jcgm and return @iso.eref_localities1(target, type, from, upto,
22
+ node, lang)
23
23
  super
24
24
  end
25
25
 
@@ -142,7 +142,7 @@ module IsoDoc
142
142
  ret = list_people(
143
143
  xml, "//bibdata/contributor[xmlns:role/@type = 'author']/person"
144
144
  )
145
- @i18n.multiple_and(ret, @i18n.get["and"])
145
+ @i18n.boolean_conj(ret, "and")
146
146
  end
147
147
 
148
148
  COCHAIR = "xmlns:role[contains(text(),'co-chair')]".freeze
@@ -154,7 +154,7 @@ module IsoDoc
154
154
  ret.empty? and return ""
155
155
  role = xml&.at(ns("//bibdata/contributor[#{COCHAIR}]/role"))&.text
156
156
  label = ret.size > 1 && role ? "#{role}s" : role
157
- "#{label}: #{@i18n.multiple_and(ret, @i18n.get['and'])}"
157
+ "#{label}: #{@i18n.boolean_conj(ret, 'and')}"
158
158
  end
159
159
 
160
160
  def list_chairs(xml)
@@ -162,7 +162,7 @@ module IsoDoc
162
162
  ret.empty? and return ""
163
163
  role = xml&.at(ns("//bibdata/contributor#{CHAIR}/role"))&.text
164
164
  label = ret.size > 1 && role ? "#{role}s" : role
165
- "#{label}: #{@i18n.multiple_and(ret, @i18n.get['and'])}"
165
+ "#{label}: #{@i18n.boolean_conj(ret, 'and')}"
166
166
  end
167
167
 
168
168
  def list_people(xml, xpath)
@@ -76,7 +76,7 @@ module IsoDoc
76
76
  lbl = @jcgm ? "clause_jcgm" : "clause"
77
77
  @anchors[clause["id"]] =
78
78
  { label: num.print, xref: l10n("#{@labels[lbl]} #{num.print}"),
79
- level: lvl, type: "clause" }
79
+ level: lvl, type: "clause", elem: @labels[lbl] }
80
80
  end
81
81
 
82
82
  def section_names(clause, num, lvl)
@@ -110,7 +110,7 @@ module IsoDoc
110
110
  lbl = @jcgm ? "" : "#{@labels['subclause']} "
111
111
  @anchors[clause["id"]] =
112
112
  { label: num, level: level, xref: l10n("#{lbl}#{num}"),
113
- type: "clause" }
113
+ type: "clause", elem: lbl }
114
114
  end
115
115
 
116
116
  def section_names1(clause, num, level)
@@ -148,7 +148,7 @@ module IsoDoc
148
148
 
149
149
  def annex_name_anchors(clause, num)
150
150
  { label: annex_name_lbl(clause, num), type: "clause", value: num.to_s,
151
- xref: l10n("#{@annexlbl} #{num}"), level: 1 }
151
+ xref: l10n("#{@annexlbl} #{num}"), level: 1, elem: @annexlbl }
152
152
  end
153
153
 
154
154
  def annex_names(clause, num)
@@ -188,7 +188,7 @@ module IsoDoc
188
188
  def annex_names1_anchors(num, level)
189
189
  lbl = @jcgm ? "" : "#{@annexlbl} "
190
190
  { label: num, xref: l10n("#{lbl}#{num}"),
191
- level: level, type: "clause" }
191
+ level: level, type: "clause", elem: lbl }
192
192
  end
193
193
 
194
194
  def annex_names1(clause, num, level)
@@ -59,7 +59,7 @@
59
59
  <data type="boolean"/>
60
60
  </attribute>
61
61
  </optional>
62
- <text/>
62
+ <ref name="XrefBody"/>
63
63
  </element>
64
64
  </define>
65
65
  <define name="Clause-Section">
@@ -152,9 +152,7 @@
152
152
  <data type="boolean"/>
153
153
  </attribute>
154
154
  </optional>
155
- <oneOrMore>
156
- <ref name="PureTextElement"/>
157
- </oneOrMore>
155
+ <ref name="XrefBody"/>
158
156
  </element>
159
157
  </define>
160
158
  <define name="erefType">
@@ -188,6 +186,42 @@
188
186
  <ref name="PureTextElement"/>
189
187
  </oneOrMore>
190
188
  </define>
189
+ <define name="localityStack">
190
+ <element name="localityStack">
191
+ <optional>
192
+ <attribute name="connective">
193
+ <choice>
194
+ <value>and</value>
195
+ <value>or</value>
196
+ <value>from</value>
197
+ <value>to</value>
198
+ <value/>
199
+ </choice>
200
+ </attribute>
201
+ </optional>
202
+ <zeroOrMore>
203
+ <ref name="locality"/>
204
+ </zeroOrMore>
205
+ </element>
206
+ </define>
207
+ <define name="sourceLocalityStack">
208
+ <element name="sourceLocalityStack">
209
+ <optional>
210
+ <attribute name="connective">
211
+ <choice>
212
+ <value>and</value>
213
+ <value>or</value>
214
+ <value>from</value>
215
+ <value>to</value>
216
+ <value/>
217
+ </choice>
218
+ </attribute>
219
+ </optional>
220
+ <zeroOrMore>
221
+ <ref name="sourceLocality"/>
222
+ </zeroOrMore>
223
+ </element>
224
+ </define>
191
225
  <define name="ul">
192
226
  <element name="ul">
193
227
  <attribute name="id">
@@ -1098,6 +1132,16 @@
1098
1132
  </define>
1099
1133
  </include>
1100
1134
  <!-- end overrides -->
1135
+ <define name="image" combine="choice">
1136
+ <element name="svg">
1137
+ <oneOrMore>
1138
+ <choice>
1139
+ <text/>
1140
+ <ref name="AnyElement"/>
1141
+ </choice>
1142
+ </oneOrMore>
1143
+ </element>
1144
+ </define>
1101
1145
  <define name="MultilingualRenderingType">
1102
1146
  <choice>
1103
1147
  <value>common</value>
@@ -2631,4 +2675,30 @@
2631
2675
  </zeroOrMore>
2632
2676
  </element>
2633
2677
  </define>
2678
+ <define name="XrefBody">
2679
+ <zeroOrMore>
2680
+ <ref name="XrefTarget"/>
2681
+ </zeroOrMore>
2682
+ <oneOrMore>
2683
+ <ref name="PureTextElement"/>
2684
+ </oneOrMore>
2685
+ </define>
2686
+ <define name="XrefTarget">
2687
+ <element name="location">
2688
+ <attribute name="target">
2689
+ <data type="string">
2690
+ <param name="pattern">\i\c*|\c+#\c+</param>
2691
+ </data>
2692
+ </attribute>
2693
+ <attribute name="connective">
2694
+ <choice>
2695
+ <value>and</value>
2696
+ <value>or</value>
2697
+ <value>from</value>
2698
+ <value>to</value>
2699
+ <value/>
2700
+ </choice>
2701
+ </attribute>
2702
+ </element>
2703
+ </define>
2634
2704
  </grammar>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.0.3".freeze
3
+ VERSION = "2.0.6".freeze
4
4
  end
5
5
  end
@@ -39,4 +39,6 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "sassc", "2.4.0"
40
40
  spec.add_development_dependency "simplecov", "~> 0.15"
41
41
  spec.add_development_dependency "timecop", "~> 0.9"
42
+ spec.add_development_dependency "vcr", "~> 6.1.0"
43
+ spec.add_development_dependency "webmock"
42
44
  end
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: 2.0.3
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
11
+ date: 2022-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -178,6 +178,34 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0.9'
181
+ - !ruby/object:Gem::Dependency
182
+ name: vcr
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 6.1.0
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 6.1.0
195
+ - !ruby/object:Gem::Dependency
196
+ name: webmock
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
181
209
  description: |
182
210
  metanorma-vg lets you write Bureau International de Poids et Mesures (BIPM) standards in Metanorma syntax.
183
211
 
@@ -270,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
298
  - !ruby/object:Gem::Version
271
299
  version: '0'
272
300
  requirements: []
273
- rubygems_version: 3.2.32
301
+ rubygems_version: 3.3.9
274
302
  signing_key:
275
303
  specification_version: 4
276
304
  summary: metanorma-bipm lets you write BIPM standards in Metanorma.