metanorma-bipm 2.1.13 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ module IsoDoc
9
9
  module BIPM
10
10
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
11
11
  def convert1(docxml, filename, dir)
12
- @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/"\
12
+ @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
13
13
  "@acronym"))&.value == "JCGM"
14
14
  @iso = IsoDoc::Iso::PresentationXMLConvert
15
15
  .new({ language: @lang, script: @script })
@@ -18,9 +18,8 @@ module IsoDoc
18
18
  super
19
19
  end
20
20
 
21
- def eref_localities1(target, type, from, upto, node, lang = "en")
22
- @jcgm and return @iso.eref_localities1(target, type, from, upto,
23
- node, lang)
21
+ def eref_localities1(opt)
22
+ @jcgm and return @iso.eref_localities1(opt)
24
23
  super
25
24
  end
26
25
 
@@ -46,7 +45,7 @@ module IsoDoc
46
45
 
47
46
  lbl = @xrefs.anchor(elem["id"], :label)
48
47
  t = elem.at(ns("./title")) and
49
- t.children = "<strong>#{t.children.to_xml}</strong>"
48
+ t.children = "<strong>#{to_xml(t.children)}</strong>"
50
49
  prefix_name(elem, ".<tab/>", lbl, "title")
51
50
  end
52
51
 
@@ -118,7 +117,7 @@ module IsoDoc
118
117
  end
119
118
 
120
119
  def bibdata_titles(bibdata)
121
- return unless app = bibdata.at(ns("//bibdata/ext/"\
120
+ return unless app = bibdata.at(ns("//bibdata/ext/" \
122
121
  "structuredidentifier/part"))
123
122
 
124
123
  bibdata.xpath(ns("//bibdata/title[@type = 'part']")).each do |t|
@@ -126,7 +125,7 @@ module IsoDoc
126
125
  t["type"] = "part-with-numbering"
127
126
  part = t["language"] == "en" ? "Part" : "Partie"
128
127
  # not looking up in YAML
129
- t.children = l10n("#{part} #{app.text}: #{t.children.to_xml}",
128
+ t.children = l10n("#{part} #{app.text}: #{to_xml(t.children)}",
130
129
  t["language"])
131
130
  end
132
131
  end
@@ -204,9 +203,27 @@ module IsoDoc
204
203
 
205
204
  def termsource1(elem)
206
205
  while elem&.next_element&.name == "termsource"
207
- elem << "; #{elem.next_element.remove.children.to_xml}"
206
+ elem << "; #{to_xml(elem.next_element.remove.children)}"
208
207
  end
209
- elem.children = l10n("[#{@i18n.source} #{elem.children.to_xml.strip}]")
208
+ elem.children = l10n("[#{@i18n.source} #{to_xml(elem.children).strip}]")
209
+ end
210
+
211
+ def norm_ref_entry_code(_ordinal, identifiers, _ids, _standard, datefn)
212
+ ret = (identifiers[0] || identifiers[1])
213
+ ret += " #{identifiers[1]}" if identifiers[0] && identifiers[1]
214
+ "#{ret}#{datefn} "
215
+ end
216
+
217
+ def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn)
218
+ standard and id = nil
219
+ ret = (ids[:ordinal] || ids[:metanorma] || "[#{ordinal}]")
220
+ if ids[:sdo]
221
+ ret = prefix_bracketed_ref(ret)
222
+ ret += "#{ids[:sdo]}#{datefn} "
223
+ else
224
+ ret = prefix_bracketed_ref("#{ret}#{datefn}")
225
+ end
226
+ ret
210
227
  end
211
228
 
212
229
  include Init
@@ -683,6 +683,9 @@
683
683
  </define>
684
684
  <define name="underline">
685
685
  <element name="underline">
686
+ <optional>
687
+ <attribute name="style"/>
688
+ </optional>
686
689
  <zeroOrMore>
687
690
  <ref name="PureTextElement"/>
688
691
  </zeroOrMore>
@@ -47,7 +47,7 @@
47
47
  </element>
48
48
  </define>
49
49
  <define name="DocumentType">
50
- <value>document</value>
50
+ <text/>
51
51
  </define>
52
52
  <define name="docsubtype">
53
53
  <element name="subdoctype">
@@ -571,6 +571,11 @@
571
571
  <ref name="MultilingualRenderingType"/>
572
572
  </attribute>
573
573
  </optional>
574
+ <optional>
575
+ <attribute name="linenums">
576
+ <data type="boolean"/>
577
+ </attribute>
578
+ </optional>
574
579
  <optional>
575
580
  <ref name="tname"/>
576
581
  </optional>
@@ -1238,6 +1243,11 @@
1238
1243
  </define>
1239
1244
  <define name="concept">
1240
1245
  <element name="concept">
1246
+ <optional>
1247
+ <attribute name="bold">
1248
+ <data type="boolean"/>
1249
+ </attribute>
1250
+ </optional>
1241
1251
  <optional>
1242
1252
  <attribute name="ital">
1243
1253
  <data type="boolean"/>
@@ -2653,6 +2663,7 @@
2653
2663
  <value>full</value>
2654
2664
  <value>short</value>
2655
2665
  <value>id</value>
2666
+ <text/>
2656
2667
  </choice>
2657
2668
  </define>
2658
2669
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.1.13".freeze
3
+ VERSION = "2.2.1".freeze
4
4
  end
5
5
  end
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.2.2"
31
- spec.add_dependency "metanorma-iso", "~> 2.2.0"
30
+ spec.add_dependency "metanorma-generic", "~> 2.3.0"
31
+ spec.add_dependency "metanorma-iso", "~> 2.3.0"
32
32
 
33
33
  spec.add_development_dependency "debug"
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.1.13
4
+ version: 2.2.1
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-11-21 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.2
19
+ version: 2.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.2
26
+ version: 2.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: metanorma-iso
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.0
33
+ version: 2.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.2.0
40
+ version: 2.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  - !ruby/object:Gem::Version
298
298
  version: '0'
299
299
  requirements: []
300
- rubygems_version: 3.3.7
300
+ rubygems_version: 3.3.26
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: metanorma-bipm lets you write BIPM standards in Metanorma.