metanorma-itu 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,18 +3,25 @@ module Metanorma
3
3
  class Converter < Standoc::Converter
4
4
  def metadata_id(node, xml)
5
5
  provisional_id(node, xml)
6
+ td_id(node, xml)
6
7
  itu_id(node, xml)
7
8
  recommendation_id(node, xml)
8
9
  end
9
10
 
10
11
  def provisional_id(node, xml)
11
- return unless node.attr("provisional-name")
12
-
13
- xml.docidentifier **{ type: "ITU-provisional" } do |i|
12
+ node.attr("provisional-name") or return
13
+ xml.docidentifier type: "ITU-provisional" do |i|
14
14
  i << node.attr("provisional-name")
15
15
  end
16
16
  end
17
17
 
18
+ def td_id(node, xml)
19
+ node.attr("td-number") or return
20
+ xml.docidentifier type: "ITU-TemporaryDocument" do |i|
21
+ i << node.attr("td-number")
22
+ end
23
+ end
24
+
18
25
  ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S",
19
26
  "zh" => "C", "ru" => "R" }.freeze
20
27
 
@@ -32,10 +39,10 @@ module Metanorma
32
39
  def itu_id(node, xml)
33
40
  return unless node.attr("docnumber")
34
41
 
35
- xml.docidentifier **{ type: "ITU" } do |i|
42
+ xml.docidentifier type: "ITU" do |i|
36
43
  i << itu_id1(node, false)
37
44
  end
38
- xml.docidentifier **{ type: "ITU-lang" } do |i|
45
+ xml.docidentifier type: "ITU-lang" do |i|
39
46
  i << itu_id1(node, true)
40
47
  end
41
48
  xml.docnumber { |i| i << node.attr("docnumber") }
@@ -45,7 +52,7 @@ module Metanorma
45
52
  return unless node.attr("recommendationnumber")
46
53
 
47
54
  node.attr("recommendationnumber").split("/").each do |s|
48
- xml.docidentifier **{ type: "ITU-Recommendation" } do |i|
55
+ xml.docidentifier type: "ITU-Recommendation" do |i|
49
56
  i << s
50
57
  end
51
58
  end
@@ -66,6 +66,7 @@
66
66
  <value>caution</value>
67
67
  <value>statement</value>
68
68
  <value>editorial</value>
69
+ <value>box</value>
69
70
  </choice>
70
71
  </define>
71
72
  <define name="index">
@@ -98,8 +98,8 @@ module Metanorma
98
98
 
99
99
  def itu_identifier_validate(xmldoc)
100
100
  xmldoc.xpath("//bibdata/docidentifier[@type = 'ITU']").each do |x|
101
- /^ITU-[RTD] [AD-VX-Z]\.[0-9]+$/.match(x.text) or
102
- @log.add("Style", nil, "#{x.text} does not match ITU document "\
101
+ /^ITU-[RTD] [AD-VX-Z]\.\d+(\.\d+)?$/.match(x.text) or
102
+ @log.add("Style", nil, "#{x.text} does not match ITU document " \
103
103
  "identifier conventions")
104
104
  end
105
105
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.2.4".freeze
3
+ VERSION = "2.2.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities