metanorma-itu 2.4.3 → 2.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Metanorma
7
7
  module ITU
8
8
  class Converter < Standoc::Converter
9
9
  def metadata_status(node, xml)
10
- stage = (node.attr("status") || node.attr("docstage") || "published")
10
+ stage = node.attr("status") || node.attr("docstage") || "published"
11
11
  stage = "draft" if node.attributes.has_key?("draft")
12
12
  xml.status do |s|
13
13
  s.stage stage
@@ -36,9 +36,8 @@ module Metanorma
36
36
 
37
37
  def title_otherlangs(node, xml)
38
38
  node.attributes.each do |k, v|
39
- next unless /^(annex)?title-(?<lang>.+)$/ =~ k
40
- next if lang == @lang
41
-
39
+ /^(?:annex)?title-(?<lang>.+)$/ =~ k or next
40
+ lang == @lang and next
42
41
  type = /^annex/.match?(k) ? "annex" : "main"
43
42
  xml.title **attr_code(title_attr(type, lang)) do |t|
44
43
  t << Metanorma::Utils::asciidoc_sub(v)
@@ -49,7 +48,8 @@ module Metanorma
49
48
  def title(node, xml)
50
49
  title_defaultlang(node, xml)
51
50
  title_otherlangs(node, xml)
52
- %w(subtitle amendment-title corrigendum-title).each do |t|
51
+ %w(subtitle amendment-title corrigendum-title collection-title
52
+ slogan-title).each do |t|
53
53
  other_title_defaultlang(node, xml, t)
54
54
  other_title_otherlangs(node, xml, t)
55
55
  end
@@ -64,9 +64,8 @@ module Metanorma
64
64
 
65
65
  def other_title_otherlangs(node, xml, type)
66
66
  node.attributes.each do |k, v|
67
- next unless m = /^#{type}-(?<lang>.+)$/.match(k)
68
- next if m[:lang] == @lang
69
-
67
+ m = /^#{type}-(?<lang>.+)$/.match(k) or next
68
+ m[:lang] == @lang and next
70
69
  xml.title **attr_code(title_attr(type.sub(/-title/, ""),
71
70
  m[:lang])) do |t|
72
71
  t << Metanorma::Utils::asciidoc_sub(v)
@@ -87,6 +86,7 @@ module Metanorma
87
86
  end
88
87
 
89
88
  def metadata_committee(node, xml)
89
+ metadata_sector(node, xml)
90
90
  metadata_committee1(node, xml, "")
91
91
  suffix = 2
92
92
  while node.attr("bureau_#{suffix}")
@@ -95,6 +95,13 @@ module Metanorma
95
95
  end
96
96
  end
97
97
 
98
+ def metadata_sector(node, xml)
99
+ s = node.attr("sector") or return
100
+ xml.editorialgroup do |a|
101
+ a.sector { |x| x << s }
102
+ end
103
+ end
104
+
98
105
  def metadata_committee1(node, xml, suffix)
99
106
  xml.editorialgroup do |a|
100
107
  a.bureau ( node.attr("bureau#{suffix}") || "T")
@@ -123,23 +130,17 @@ module Metanorma
123
130
  end
124
131
 
125
132
  def metadata_series(node, xml)
126
- node.attr("series") and
127
- xml.series **{ type: "main" } do |s|
128
- s.title node.attr("series")
129
- end
130
- node.attr("series1") and
131
- xml.series **{ type: "secondary" } do |s|
132
- s.title node.attr("series1")
133
- end
134
- node.attr("series2") and
135
- xml.series **{ type: "tertiary" } do |s|
136
- s.title node.attr("series2")
137
- end
133
+ { series: "main", series1: "secondary", series2: "tertiary" }
134
+ .each do |k, v|
135
+ node.attr(k.to_s) and
136
+ xml.series **{ type: v } do |s|
137
+ s.title node.attr(k.to_s)
138
+ end
139
+ end
138
140
  end
139
141
 
140
142
  def metadata_recommendationstatus(node, xml)
141
- return unless node.attr("recommendation-from")
142
-
143
+ node.attr("recommendation-from") or return
143
144
  xml.recommendationstatus do |s|
144
145
  s.from node.attr("recommendation-from")
145
146
  s.to node.attr("recommendation-to") if node.attr("recommendation-to")
@@ -190,6 +191,18 @@ module Metanorma
190
191
  end
191
192
  end
192
193
 
194
+ def metadata_coverpage_images(node, xml)
195
+ %w(coverpage-image).each do |n|
196
+ if a = node.attr(n)
197
+ xml.send n do |c|
198
+ a.split(",").each do |x|
199
+ c.image src: x
200
+ end
201
+ end
202
+ end
203
+ end
204
+ end
205
+
193
206
  def metadata_ext(node, xml)
194
207
  metadata_doctype(node, xml)
195
208
  metadata_subdoctype(node, xml)
@@ -199,6 +212,7 @@ module Metanorma
199
212
  metadata_ip_notice(node, xml)
200
213
  metadata_techreport(node, xml)
201
214
  structured_id(node, xml)
215
+ metadata_coverpage_images(node, xml)
202
216
  end
203
217
  end
204
218
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.4.3".freeze
3
+ VERSION = "2.4.4".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.4.3
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-04 00:00:00.000000000 Z
11
+ date: 2024-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -311,6 +311,7 @@ files:
311
311
  - lib/metanorma/itu/biblio.rng
312
312
  - lib/metanorma/itu/boilerplate.adoc
313
313
  - lib/metanorma/itu/cleanup.rb
314
+ - lib/metanorma/itu/cleanup_section.rb
314
315
  - lib/metanorma/itu/converter.rb
315
316
  - lib/metanorma/itu/front.rb
316
317
  - lib/metanorma/itu/front_id.rb