metanorma-itu 2.4.7 → 2.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/itu/base_convert.rb +3 -10
- data/lib/isodoc/itu/html/_coverpage.css +53 -0
- data/lib/isodoc/itu/html/htmlstyle.css +105 -0
- data/lib/isodoc/itu/itu.implementers-guide.xsl +1268 -883
- data/lib/isodoc/itu/itu.in-force.xsl +1268 -883
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +1268 -883
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +1268 -883
- data/lib/isodoc/itu/itu.recommendation.xsl +1268 -883
- data/lib/isodoc/itu/itu.resolution.xsl +1268 -883
- data/lib/isodoc/itu/itu.service-publication.xsl +1268 -883
- data/lib/isodoc/itu/itu.technical-paper.xsl +1268 -883
- data/lib/isodoc/itu/itu.technical-report.xsl +1268 -883
- data/lib/isodoc/itu/metadata.rb +52 -90
- data/lib/isodoc/itu/metadata_date.rb +45 -0
- data/lib/isodoc/itu/presentation_contribution.rb +153 -0
- data/lib/isodoc/itu/presentation_preface.rb +5 -71
- data/lib/isodoc/itu/presentation_xml_convert.rb +1 -6
- data/lib/metanorma/itu/basicdoc.rng +840 -419
- data/lib/metanorma/itu/biblio.rng +26 -27
- data/lib/metanorma/itu/converter.rb +3 -5
- data/lib/metanorma/itu/front.rb +26 -29
- data/lib/metanorma/itu/isodoc.rng +351 -510
- data/lib/metanorma/itu/itu.rng +5 -19
- data/lib/metanorma/itu/version.rb +1 -1
- metadata +5 -3
data/lib/isodoc/itu/metadata.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "twitter_cldr"
|
2
|
+
require_relative "metadata_date"
|
2
3
|
|
3
4
|
module IsoDoc
|
4
5
|
module ITU
|
@@ -35,20 +36,20 @@ module IsoDoc
|
|
35
36
|
slogantitle: "//bibdata/title[@type='slogan']",
|
36
37
|
positiontitle: "//bibdata/title[@type='position-sp']" }.freeze
|
37
38
|
|
38
|
-
def title(
|
39
|
+
def title(xml, _out)
|
39
40
|
TITLE_XPATHS.each do |k, v|
|
40
|
-
titleset(
|
41
|
+
titleset(xml, k, v.sub("@_lang", @lang))
|
41
42
|
end
|
42
|
-
titleset(
|
43
|
+
titleset(xml, :doctitle_en,
|
43
44
|
"//bibdata/title[@language='en'][@type = 'main']") or
|
44
|
-
titleset(
|
45
|
+
titleset(xml, :doctitle_en,
|
45
46
|
"//bibdata/title[@language='#{@lang}'][@type = 'main']")
|
46
47
|
end
|
47
48
|
|
48
|
-
def titleset(
|
49
|
-
value =
|
50
|
-
out = @isodoc.noko do |
|
51
|
-
|
49
|
+
def titleset(xml, key, xpath)
|
50
|
+
value = xml.at(ns(xpath)) or return
|
51
|
+
out = @isodoc.noko do |x|
|
52
|
+
x.span do |s|
|
52
53
|
value.children.each { |c| @isodoc.parse(c, s) }
|
53
54
|
end
|
54
55
|
end.join
|
@@ -56,7 +57,7 @@ module IsoDoc
|
|
56
57
|
true
|
57
58
|
end
|
58
59
|
|
59
|
-
def subtitle(
|
60
|
+
def subtitle(_xml, _out)
|
60
61
|
nil
|
61
62
|
end
|
62
63
|
|
@@ -101,12 +102,11 @@ module IsoDoc
|
|
101
102
|
@metadata[key] << value
|
102
103
|
end
|
103
104
|
|
104
|
-
PERSON_ATTRS =
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
phones: "./phone[not(@type = 'fax')]" }.freeze
|
105
|
+
PERSON_ATTRS =
|
106
|
+
{ affiliations: "./affiliation/organization/name",
|
107
|
+
addresses: "./affiliation/organization/address/formattedAddress",
|
108
|
+
emails: "./email", faxes: "./phone[@type = 'fax']",
|
109
|
+
phones: "./phone[not(@type = 'fax')]" }.freeze
|
110
110
|
|
111
111
|
def person_attributes(authors)
|
112
112
|
PERSON_ATTRS.each_key { |k| set(k, []) }
|
@@ -117,21 +117,21 @@ module IsoDoc
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
def docid(
|
120
|
+
def docid(xml, _out)
|
121
121
|
{ docnumber: "ITU", recommendationnumber: "ITU-Recommendation",
|
122
122
|
docnumber_lang: "ITU-lang", docnumber_td: "ITU-TemporaryDocument",
|
123
123
|
docnumber_provisional: "ITU-provisional" }
|
124
124
|
.each do |k, v|
|
125
|
-
dn =
|
125
|
+
dn = xml.at(ns("//bibdata/docidentifier[@type = '#{v}']")) and
|
126
126
|
set(k, dn.text)
|
127
127
|
end
|
128
|
-
dn =
|
129
|
-
oblig =
|
128
|
+
dn = xml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
|
129
|
+
oblig = xml.at(ns("//annex/@obligation"))&.text
|
130
130
|
lbl = oblig == "informative" ? @labels["appendix"] : @labels["annex"]
|
131
131
|
dn and set(:annexid, @i18n.l10n("#{lbl} #{dn.text}"))
|
132
|
-
dn =
|
132
|
+
dn = xml.at(ns("//bibdata/ext/structuredidentifier/amendment")) and
|
133
133
|
set(:amendmentid, @i18n.l10n("#{@labels['amendment']} #{dn.text}"))
|
134
|
-
dn =
|
134
|
+
dn = xml.at(ns("//bibdata/ext/structuredidentifier/corrigendum")) and
|
135
135
|
set(:corrigendumid,
|
136
136
|
@i18n.l10n("#{@labels['corrigendum']} #{dn.text}"))
|
137
137
|
end
|
@@ -140,36 +140,27 @@ module IsoDoc
|
|
140
140
|
%w(in-force-prepublished draft).include? status.downcase
|
141
141
|
end
|
142
142
|
|
143
|
-
def bibdate(
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
@labels["placedate"]
|
153
|
-
.sub("%", pubdate.text.sub(/^(\d\d\d\d).*$/, "\\1")))
|
143
|
+
def bibdate(xml, _out)
|
144
|
+
d = xml.at(ns("//bibdata/date[not(@format)][@type = 'published']"))
|
145
|
+
d and set(:pubdate_monthyear, monthyr(d.text))
|
146
|
+
d = xml.at(ns("//bibdata/date[@format = 'ddMMMyyyy'][@type = 'published']"))
|
147
|
+
d and set(:pubdate_ddMMMyyyy, monthyr(d.text))
|
148
|
+
d = xml.at(ns("//bibdata/date[not(@format)][@type = 'published']")) ||
|
149
|
+
xml.at(ns("//bibdata/copyright/from"))
|
150
|
+
d and set(:placedate_year, @labels["placedate"]
|
151
|
+
.sub("%", d.text.sub(/^(\d\d\d\d).*$/, "\\1")))
|
154
152
|
end
|
155
153
|
|
156
|
-
def
|
157
|
-
m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)/.match isodate
|
158
|
-
return isodate unless m && m[:yr] && m[:mo]
|
159
|
-
|
160
|
-
"#{m[:mo]}/#{m[:yr]}"
|
161
|
-
end
|
162
|
-
|
163
|
-
def keywords(isoxml, _out)
|
154
|
+
def keywords(xml, _out)
|
164
155
|
super
|
165
156
|
set(:keywords, get[:keywords].sort)
|
166
|
-
q =
|
157
|
+
q = xml.xpath(ns("//bibdata/ext/question/identifier"))
|
167
158
|
q.empty? or set(:questions,
|
168
159
|
q.map { |x| x.text.sub(/^Q/, "") }.join(", "))
|
169
160
|
end
|
170
161
|
|
171
|
-
def doctype(
|
172
|
-
d =
|
162
|
+
def doctype(xml, _out)
|
163
|
+
d = xml&.at(ns("//bibdata/ext/doctype"))&.text
|
173
164
|
set(:doctype_original, d)
|
174
165
|
set(:doctype_abbreviated, @labels.dig("doctype_abbrev", d))
|
175
166
|
if d == "recommendation-annex"
|
@@ -181,69 +172,40 @@ module IsoDoc
|
|
181
172
|
set(:draft_new_doctype, @labels["draft_new"].sub("%", d))
|
182
173
|
end
|
183
174
|
|
184
|
-
def ip_notice_received(
|
185
|
-
received =
|
175
|
+
def ip_notice_received(xml, _out)
|
176
|
+
received = xml.at(ns("//bibdata/ext/ip-notice-received"))&.text ||
|
186
177
|
"false"
|
187
178
|
set(:ip_notice_received, received)
|
188
179
|
end
|
189
180
|
|
190
|
-
def
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
mmm = DateTime.parse(isodate).localize(@lang.to_sym)
|
195
|
-
.to_additional_s("yMMM")
|
196
|
-
@i18n.l10n("#{m[:dd]} #{mmm}")
|
197
|
-
end
|
198
|
-
|
199
|
-
def ddMMMMYYYY(date1, date2)
|
200
|
-
m1 = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match date1
|
201
|
-
m2 = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match date2
|
202
|
-
if m1 && m1[:yr] && m1[:mo] && m1[:dd]
|
203
|
-
dd1 = m1[:dd].sub(/^0/, "")
|
204
|
-
if m2 && m2[:yr] && m2[:mo] && m2[:dd]
|
205
|
-
dd2 = m2[:dd].sub(/^0/, "")
|
206
|
-
if m1[:yr] == m2[:yr]
|
207
|
-
if m1[:mo] == m2[:mo]
|
208
|
-
@i18n.l10n("#{dd1}–#{dd2} #{months[m1[:mo].to_sym]} #{m1[:yr]}")
|
209
|
-
else
|
210
|
-
@i18n.l10n("#{dd1} #{months[m1[:mo].to_sym]} – " \
|
211
|
-
"#{dd2} #{months[m2[:mo].to_sym]} #{m1[:yr]}")
|
212
|
-
end
|
213
|
-
else
|
214
|
-
@i18n.l10n("#{dd1} #{months[m1[:mo].to_sym]} #{m1[:yr]} – " \
|
215
|
-
"#{dd2} #{months[m2[:mo].to_sym]} #{m2[:yr]}")
|
216
|
-
end
|
217
|
-
else
|
218
|
-
date2.nil? ? @i18n.l10n("#{dd1} #{months[m1[:mo].to_sym]} #{m1[:yr]}") : "#{date1}/#{date2}"
|
219
|
-
end
|
220
|
-
else
|
221
|
-
date2.nil? ? date1 : "#{date1}/#{date2}"
|
222
|
-
end
|
181
|
+
def contribution(xml, _out)
|
182
|
+
a = xml.at(ns("//bibdata/ext/timing")) and set(:timing, a.text)
|
183
|
+
a = xml.at(ns("//bibdata/ext/recommendationstatus/approvalstage/@process")) and
|
184
|
+
set(:approval_process, a.text)
|
223
185
|
end
|
224
186
|
|
225
|
-
def techreport(
|
226
|
-
if a =
|
187
|
+
def techreport(xml, _out)
|
188
|
+
if a = xml.at(ns("//bibdata/ext/meeting"))&.text
|
227
189
|
set(:meeting, a)
|
228
190
|
set(:meeting_acronym, a)
|
229
191
|
end
|
230
|
-
a =
|
192
|
+
a = xml.at(ns("//bibdata/ext/meeting/@acronym"))&.text and
|
231
193
|
set(:meeting_acronym, a)
|
232
|
-
a =
|
194
|
+
a = xml.at(ns("//bibdata/ext/meeting-place"))&.text and
|
233
195
|
set(:meeting_place, a)
|
234
|
-
a =
|
196
|
+
a = xml.at(ns("//bibdata/ext/intended-type"))&.text and
|
235
197
|
set(:intended_type, a)
|
236
|
-
a =
|
237
|
-
meeting(
|
198
|
+
a = xml.at(ns("//bibdata/ext/source"))&.text and set(:source, a)
|
199
|
+
meeting(xml)
|
238
200
|
end
|
239
201
|
|
240
|
-
def meeting(
|
202
|
+
def meeting(xml)
|
241
203
|
resolution =
|
242
|
-
|
243
|
-
if o =
|
204
|
+
xml.at(ns("//bibdata/ext/doctype"))&.text == "resolution"
|
205
|
+
if o = xml.at(ns("//bibdata/ext/meeting-date/on"))&.text
|
244
206
|
set(:meeting_date, resolution ? ddMMMMYYYY(o, nil) : ddMMMYYYY(o))
|
245
|
-
elsif f =
|
246
|
-
t =
|
207
|
+
elsif f = xml.at(ns("//bibdata/ext/meeting-date/from"))&.text
|
208
|
+
t = xml.at(ns("//bibdata/ext/meeting-date/to"))&.text
|
247
209
|
set(:meeting_date,
|
248
210
|
resolution ? ddMMMMYYYY(f, t) : "#{ddMMMYYYY(f)}/#{ddMMMYYYY(t)}")
|
249
211
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module ITU
|
3
|
+
class Metadata < IsoDoc::Metadata
|
4
|
+
def monthyr(isodate)
|
5
|
+
m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)/.match isodate
|
6
|
+
m && m[:yr] && m[:mo] or return isodate
|
7
|
+
"#{m[:mo]}/#{m[:yr]}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def ddMMMYYYY(isodate)
|
11
|
+
m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match isodate
|
12
|
+
m && m[:yr] && m[:mo] && m[:dd] or return isodate
|
13
|
+
mmm = DateTime.parse(isodate).localize(@lang.to_sym)
|
14
|
+
.to_additional_s("yMMM")
|
15
|
+
@i18n.l10n("#{m[:dd]} #{mmm}")
|
16
|
+
end
|
17
|
+
|
18
|
+
def ddMMMMYYYY(date1, date2)
|
19
|
+
m1 = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match date1
|
20
|
+
m2 = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match date2
|
21
|
+
if m1 && m1[:yr] && m1[:mo] && m1[:dd]
|
22
|
+
dd1 = m1[:dd].sub(/^0/, "")
|
23
|
+
if m2 && m2[:yr] && m2[:mo] && m2[:dd]
|
24
|
+
dd2 = m2[:dd].sub(/^0/, "")
|
25
|
+
if m1[:yr] == m2[:yr]
|
26
|
+
if m1[:mo] == m2[:mo]
|
27
|
+
@i18n.l10n("#{dd1}–#{dd2} #{months[m1[:mo].to_sym]} #{m1[:yr]}")
|
28
|
+
else
|
29
|
+
@i18n.l10n("#{dd1} #{months[m1[:mo].to_sym]} – " \
|
30
|
+
"#{dd2} #{months[m2[:mo].to_sym]} #{m1[:yr]}")
|
31
|
+
end
|
32
|
+
else
|
33
|
+
@i18n.l10n("#{dd1} #{months[m1[:mo].to_sym]} #{m1[:yr]} – " \
|
34
|
+
"#{dd2} #{months[m2[:mo].to_sym]} #{m2[:yr]}")
|
35
|
+
end
|
36
|
+
else
|
37
|
+
date2.nil? ? @i18n.l10n("#{dd1} #{months[m1[:mo].to_sym]} #{m1[:yr]}") : "#{date1}/#{date2}"
|
38
|
+
end
|
39
|
+
else
|
40
|
+
date2.nil? ? date1 : "#{date1}/#{date2}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module ITU
|
3
|
+
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
|
4
|
+
def contribution_table_insert_pt(docxml)
|
5
|
+
docxml.at(ns("//preface")) || docxml.at(ns("//sections"))
|
6
|
+
.add_previous_sibling("<preface> </preface>").first
|
7
|
+
docxml.at(ns("//preface")).children.first.before(" ").previous
|
8
|
+
end
|
9
|
+
|
10
|
+
def contribution_table(_doc)
|
11
|
+
@doctype == "contribution" or return
|
12
|
+
bureau = bold_and_upcase(@meta.get[:bureau_full])
|
13
|
+
<<~TABLE
|
14
|
+
<clause unnumbered="true" type="contribution-metadata">
|
15
|
+
<table class="contribution-metadata" unnumbered="true" width="100%">
|
16
|
+
<colgroup><col width="11.8%"/><col width="41.2%"/><col width="47.0%"/></colgroup>
|
17
|
+
<thead>
|
18
|
+
<tr><th rowspan="3"><image height="56" width="56" src="#{@meta.get[:logo_small]}"/></th>
|
19
|
+
<td rowspan="3"><p style="font-size:8pt;margin-top:6pt;margin-bottom:0pt;">#{@i18n.international_telecommunication_union.upcase}</p>
|
20
|
+
<p class="bureau_big" style="font-size:13pt;margin-top:6pt;margin-bottom:0pt;">#{bureau}</p>
|
21
|
+
<p style="font-size:10pt;margin-top:6pt;margin-bottom:0pt;">#{@i18n.studyperiod.sub('%', @meta.get[:study_group_period]).upcase}</p></th>
|
22
|
+
<th align="right"><p style="font-size:16pt;">#{@meta.get[:docnumber]}</p></th></tr>
|
23
|
+
<tr><th align="right"><p style="font-size:14pt;">#{@meta.get[:group].upcase}</p></th></tr>
|
24
|
+
<tr>
|
25
|
+
<th align="right"><p style="font-size:14pt;">#{@i18n.l10n("#{@i18n.original}: #{@i18n.current_language}")}</p></th>
|
26
|
+
</tr></thead>
|
27
|
+
<tbody>
|
28
|
+
<tr><th align="left" width="95">#{colon_i18n(@i18n.questions)}</th><td>#{@meta.get[:questions]}</td>
|
29
|
+
<td align="right">#{@i18n.l10n("#{@meta.get[:meeting_place]}, #{@meta.get[:meeting_date]}")}</td></tr>
|
30
|
+
<tr><th align="center" colspan="3">#{@i18n.get['doctype_dict']['contribution'].upcase}</th></tr>
|
31
|
+
<tr><th align="left" width="95">#{colon_i18n(@i18n.document_source)}</th><td colspan="2">#{@meta.get[:source]}</td></tr>
|
32
|
+
<tr><th align="left" width="95">#{colon_i18n(@i18n.title)}</th><td colspan="2">#{@meta.get[:doctitle_en]}</td></tr>
|
33
|
+
#{contribution_table_contacts}
|
34
|
+
</tbody></table>
|
35
|
+
</clause>
|
36
|
+
TABLE
|
37
|
+
end
|
38
|
+
|
39
|
+
def colon_i18n(text)
|
40
|
+
@i18n.l10n("#{text}:")
|
41
|
+
end
|
42
|
+
|
43
|
+
def bold_and_upcase(xml)
|
44
|
+
x = Nokogiri::XML("<root>#{xml}</root>")
|
45
|
+
x.traverse do |e|
|
46
|
+
e.text? or next
|
47
|
+
e.replace("<strong>#{e.text.upcase}</strong>")
|
48
|
+
end
|
49
|
+
x.root.children.to_xml
|
50
|
+
end
|
51
|
+
|
52
|
+
def contribution_table_contacts
|
53
|
+
n = (0..@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
|
54
|
+
ret << contribution_table_contact(i)
|
55
|
+
end
|
56
|
+
n.map do |x|
|
57
|
+
lbl = colon_i18n(@i18n.contact)
|
58
|
+
"<tr><th align='left' width='95'>#{lbl}</th>#{x}</tr>"
|
59
|
+
end.join("\n")
|
60
|
+
end
|
61
|
+
|
62
|
+
def contribution_table_contact(idx)
|
63
|
+
@meta.get[:emails][idx] and
|
64
|
+
e = "<br/>#{@i18n.email}<tab/>#{@meta.get[:emails][idx]}"
|
65
|
+
<<~CELL
|
66
|
+
<td>#{@meta.get[:authors][idx]}<br/>
|
67
|
+
#{@meta.get[:affiliations][idx]}<br/>
|
68
|
+
#{@meta.get[:addresses][idx]}</td>
|
69
|
+
<td>#{@i18n.tel_abbrev}<tab/>#{@meta.get[:phones][idx]}#{e}</td>
|
70
|
+
CELL
|
71
|
+
end
|
72
|
+
|
73
|
+
def extract_clause_data(clause, type)
|
74
|
+
x = clause.at(ns("./clause[@type = '#{type}']")) or return
|
75
|
+
ret = x.dup
|
76
|
+
ret.at(ns("./title"))&.remove
|
77
|
+
ret.children.to_xml
|
78
|
+
end
|
79
|
+
|
80
|
+
def contribution_justification_contact(idx)
|
81
|
+
@meta.get[:emails][idx] and
|
82
|
+
e = ", #{@i18n.email}<tab/>#{@meta.get[:emails][idx]}"
|
83
|
+
<<~CELL
|
84
|
+
#{@meta.get[:authors][idx]}<br/>
|
85
|
+
#{@meta.get[:affiliations][idx]}<br/>
|
86
|
+
#{@meta.get[:addresses][idx]}#{e}
|
87
|
+
CELL
|
88
|
+
end
|
89
|
+
|
90
|
+
def contrib_justification_contacts
|
91
|
+
(0..@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
|
92
|
+
ret << contribution_justification_contact(i)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def contribution_justification_title(_doc)
|
97
|
+
n = @meta.get[:docnumber]
|
98
|
+
if @meta.get[:subdoctype] == "recommendation"
|
99
|
+
"A.1 justification for proposed draft new Recommendation #{n}"
|
100
|
+
else
|
101
|
+
s = @meta.get[:subdoctype]
|
102
|
+
"A.13 justification for proposed draft new #{s} "\
|
103
|
+
"#{n} “#{@meta.get[:doctitle_en]}”"
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def contribution_justification_auths
|
108
|
+
auths = contrib_justification_contacts
|
109
|
+
auths_tail = auths[1..auths.size].map do |x|
|
110
|
+
"<tr><td colspan='2'>#{x}</td></td>"
|
111
|
+
end.join("\n")
|
112
|
+
[auths, auths_tail]
|
113
|
+
end
|
114
|
+
|
115
|
+
def contribution_justification(doc)
|
116
|
+
@doctype == "contribution" or return
|
117
|
+
annex = doc.at(ns("//annex[@type = 'justification']")) or return
|
118
|
+
auths, auths_tail = contribution_justification_auths
|
119
|
+
annex.children = <<~TABLE
|
120
|
+
<title>#{contribution_justification_title(doc)}</title>
|
121
|
+
<table class="contribution-metadata" unnumbered="true" width="100%">
|
122
|
+
<colgroup><col width="15.9%"/><col width="6.1%"/><col width="45.5%"/><col width="17.4%"/><col width="15.1%"/></colgroup>
|
123
|
+
<tbody>
|
124
|
+
<tr>
|
125
|
+
<th align="left">#{colon_i18n(@i18n.questions)}</th><td>#{@meta.get[:questions]}</td>
|
126
|
+
<th align="left">Proposed new ITU-T #{@meta.get[:subdoctype]}</th>
|
127
|
+
<td colspan="2">#{@i18n.l10n("#{@meta.get[:meeting_place]}, #{@meta.get[:meeting_date]}")}</td>
|
128
|
+
</tr>
|
129
|
+
<tr><th align="left">Reference and title:</th>
|
130
|
+
<td colspan="4">Draft new #{@meta.get[:subdoctype]} on “#{@meta.get[:doctitle_en]}”</td>
|
131
|
+
</tr>
|
132
|
+
<tr>
|
133
|
+
<th align="left">Base text:</th><td colspan="2">#{extract_clause_data(annex, 'basetext')}</td>
|
134
|
+
<th align="left">Timing:</th><td>#{@meta.get[:timing]}</td>
|
135
|
+
</tr>
|
136
|
+
<tr><th align="left" rowspan="#{auths.size - 1}">Editor(s):</th>
|
137
|
+
<td colspan="2">#{auths[0]}</td>
|
138
|
+
<th align="left" rowspan="#{auths.size - 1}">Approval process:</th>
|
139
|
+
<td rowspan="#{auths.size - 1}">#{@meta.get[:approval_process]}</td>
|
140
|
+
</tr>
|
141
|
+
#{auths_tail}
|
142
|
+
<tr><td colspan="5"><p><strong>Scope</strong> (defines the intent or object of the Recommendation and the aspects covered, thereby indicating the limits of its applicability):</p>#{extract_clause_data(annex, 'scope')}</td></tr>
|
143
|
+
<tr><td colspan="5"><p><strong>Summary</strong> (provides a brief overview of the purpose and contents of the Recommendation, thus permitting readers to judge its usefulness for their work):</p>#{extract_clause_data(annex, 'summary')}</td></tr>
|
144
|
+
<tr><td colspan="5"><p><strong>Relations to ITU-T Recommendations or to other standards</strong> (approved or under development):</p>#{extract_clause_data(annex, 'relatedstandards')}</td></tr>
|
145
|
+
<tr><td colspan="5"><p><strong>Liaisons with other study groups or with other standards bodies:</strong></p>#{extract_clause_data(annex, 'liaisons')}</td></tr>
|
146
|
+
<tr><td colspan="5"><p><strong>Supporting members that are committing to contributing actively to the work item:</strong></p>#{extract_clause_data(annex, 'supportingmembers')}</td></tr>
|
147
|
+
</tbody>
|
148
|
+
</table>
|
149
|
+
TABLE
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -3,6 +3,7 @@ module IsoDoc
|
|
3
3
|
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
|
4
4
|
def insert_preface_sections(docxml)
|
5
5
|
if @doctype == "contribution"
|
6
|
+
contribution_justification(docxml)
|
6
7
|
x = contribution_table(docxml) and
|
7
8
|
contribution_table_insert_pt(docxml).next = x
|
8
9
|
else
|
@@ -18,74 +19,6 @@ module IsoDoc
|
|
18
19
|
docxml.at(ns("//preface")).children[-1]
|
19
20
|
end
|
20
21
|
|
21
|
-
def contribution_table_insert_pt(docxml)
|
22
|
-
docxml.at(ns("//preface")) || docxml.at(ns("//sections"))
|
23
|
-
.add_previous_sibling("<preface> </preface>").first
|
24
|
-
docxml.at(ns("//preface")).children.first.before(" ").previous
|
25
|
-
end
|
26
|
-
|
27
|
-
def contribution_table(_doc)
|
28
|
-
@doctype == "contribution" or return
|
29
|
-
bureau = bold_and_upcase(@meta.get[:bureau_full])
|
30
|
-
<<~TABLE
|
31
|
-
<clause unnumbered="true" type="contribution-metadata">
|
32
|
-
<table class="contribution-metadata" unnumbered="true" width="100%">
|
33
|
-
<colgroup><col width="11.8%"/><col width="41.2%"/><col width="47.0%"/></colgroup>
|
34
|
-
<thead>
|
35
|
-
<tr><th rowspan="3"><image height="56" width="56" src="#{@meta.get[:logo_small]}"/></th>
|
36
|
-
<td rowspan="3"><p style="font-size:8pt;margin-top:6pt;margin-bottom:0pt;">#{@i18n.international_telecommunication_union.upcase}</p>
|
37
|
-
<p class="bureau_big" style="font-size:13pt;margin-top:6pt;margin-bottom:0pt;">#{bureau}</p>
|
38
|
-
<p style="font-size:10pt;margin-top:6pt;margin-bottom:0pt;">#{@i18n.studyperiod.sub('%', @meta.get[:study_group_period]).upcase}</p></th>
|
39
|
-
<th align="right"><p style="font-size:16pt;">#{@meta.get[:docnumber]}</p></th></tr>
|
40
|
-
<tr><th align="right"><p style="font-size:14pt;">#{@meta.get[:group].upcase}</p></th></tr>
|
41
|
-
<tr>
|
42
|
-
<th align="right"><p style="font-size:14pt;">#{@i18n.l10n("#{@i18n.original}: #{@i18n.current_language}")}</p></th>
|
43
|
-
</tr></thead>
|
44
|
-
<tbody>
|
45
|
-
<tr><th align="left" width="95">#{colon_i18n(@i18n.questions)}</th><td>#{@meta.get[:questions]}</td>
|
46
|
-
<td align="right">#{@i18n.l10n("#{@meta.get[:meeting_place]}, #{@meta.get[:meeting_date]}")}</td></tr>
|
47
|
-
<tr><th align="center" colspan="3">#{@i18n.get['doctype_dict']['contribution'].upcase}</th></tr>
|
48
|
-
<tr><th align="left" width="95">#{colon_i18n(@i18n.document_source)}</th><td colspan="2">#{@meta.get[:source]}</td></tr>
|
49
|
-
<tr><th align="left" width="95">#{colon_i18n(@i18n.title)}</th><td colspan="2">#{@meta.get[:doctitle_en]}</td></tr>
|
50
|
-
#{contribution_table_contacts}
|
51
|
-
</tbody></table>
|
52
|
-
</clause>
|
53
|
-
TABLE
|
54
|
-
end
|
55
|
-
|
56
|
-
def colon_i18n(text)
|
57
|
-
@i18n.l10n("#{text}:")
|
58
|
-
end
|
59
|
-
|
60
|
-
def bold_and_upcase(xml)
|
61
|
-
x = Nokogiri::XML("<root>#{xml}</root>")
|
62
|
-
x.traverse do |e|
|
63
|
-
e.text? or next
|
64
|
-
e.replace("<strong>#{e.text.upcase}</strong>")
|
65
|
-
end
|
66
|
-
x.root.children.to_xml
|
67
|
-
end
|
68
|
-
|
69
|
-
def contribution_table_contacts
|
70
|
-
n = (0..@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
|
71
|
-
ret << contribution_table_contact(i)
|
72
|
-
end
|
73
|
-
n.map do |x|
|
74
|
-
lbl = colon_i18n(@i18n.contact)
|
75
|
-
"<tr><th align='left' width='95'>#{lbl}</th>#{x}</tr>"
|
76
|
-
end.join("\n")
|
77
|
-
end
|
78
|
-
|
79
|
-
def contribution_table_contact(idx)
|
80
|
-
<<~CELL
|
81
|
-
<td>#{@meta.get[:authors][idx]}<br/>
|
82
|
-
#{@meta.get[:affiliations][idx]}<br/>
|
83
|
-
#{@meta.get[:addresses][idx]}</td>
|
84
|
-
<td>#{@i18n.tel_abbrev}<tab/>#{@meta.get[:phones][idx]}<br/>
|
85
|
-
#{@i18n.email}<tab/>#{@meta.get[:emails][idx]}</td>
|
86
|
-
CELL
|
87
|
-
end
|
88
|
-
|
89
22
|
def insert_editors_clause(doc)
|
90
23
|
ret = extract_editors(doc) or return
|
91
24
|
eds = ret[:names].each_with_object([]).with_index do |(_x, acc), i|
|
@@ -140,15 +73,16 @@ module IsoDoc
|
|
140
73
|
|
141
74
|
def keywords_abstract_swap(abstract, keywords, docxml)
|
142
75
|
@doctype == "contribution" and return
|
143
|
-
keywords or return
|
144
|
-
if abstract then abstract.next =
|
76
|
+
k = keywords or return
|
77
|
+
if abstract then abstract.next = k
|
145
78
|
else
|
146
79
|
p = contribution_table_insert_pt(docxml)
|
147
|
-
p.next =
|
80
|
+
p.next = k
|
148
81
|
end
|
149
82
|
end
|
150
83
|
|
151
84
|
def abstract_render(abstract)
|
85
|
+
abstract or return
|
152
86
|
@doctype == "contribution" or return
|
153
87
|
abstract.at(ns("./title"))&.remove
|
154
88
|
abstract.children = <<~TABLE
|
@@ -5,6 +5,7 @@ require_relative "../../relaton/render/general"
|
|
5
5
|
require_relative "presentation_bibdata"
|
6
6
|
require_relative "presentation_preface"
|
7
7
|
require_relative "presentation_ref"
|
8
|
+
require_relative "presentation_contribution"
|
8
9
|
|
9
10
|
module Nokogiri
|
10
11
|
module XML
|
@@ -127,12 +128,6 @@ module IsoDoc
|
|
127
128
|
type
|
128
129
|
end
|
129
130
|
|
130
|
-
def info(isoxml, out)
|
131
|
-
@meta.ip_notice_received isoxml, out
|
132
|
-
@meta.techreport isoxml, out
|
133
|
-
super
|
134
|
-
end
|
135
|
-
|
136
131
|
def middle_title(isoxml)
|
137
132
|
s = isoxml.at(ns("//sections")) or return
|
138
133
|
titfn = isoxml.at(ns("//note[@type = 'title-footnote']"))
|