metanorma-itu 1.0.5 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -216,6 +216,24 @@ p.FooterQP, li.FooterQP, div.FooterQP
216
216
  mso-fareast-language:EN-US;
217
217
  font-weight:bold;
218
218
  mso-bidi-font-weight:normal;}
219
+ p.FooterQPLandscape, li.FooterQPLandscape, div.FooterQPLandscape
220
+ {
221
+ mso-style-unhide:no;
222
+ margin:0cm;
223
+ margin-bottom:.0001pt;
224
+ mso-pagination:widow-orphan;
225
+ tab-stops:45.35pt right 439.45pt 733.1pt;
226
+ mso-layout-grid-align:none;
227
+ punctuation-wrap:simple;
228
+ text-autospace:none;
229
+ font-size:11.0pt;
230
+ mso-bidi-font-size:10.0pt;
231
+ font-family:$bodyfont;
232
+ mso-fareast-font-family:$bodyfont;
233
+ mso-ansi-language:EN-GB;
234
+ mso-fareast-language:EN-US;
235
+ font-weight:bold;
236
+ mso-bidi-font-weight:normal;}
219
237
  p.FirstFooter, li.FirstFooter, div.FirstFooter
220
238
  {mso-style-name:FirstFooter;
221
239
  mso-style-unhide:no;
@@ -362,13 +380,36 @@ p.IntroTitle, li.IntroTitle, div.IntroTitle
362
380
  tab-stops:20.15pt;
363
381
  font-size:14.0pt;
364
382
  mso-bidi-font-size:11.0pt;
365
- page-break-before:always;
366
383
  font-family:$headerfont;
367
384
  mso-fareast-font-family:$headerfont;
368
385
  mso-bidi-font-family:$headerfont;
369
386
  mso-ansi-language:EN-GB;
370
387
  font-weight:bold;
388
+ page-break-before:always;
371
389
  mso-bidi-font-weight:normal;}
390
+ p.TitlePageSubhead, li.TitlePageSubhead, div.TitlePageSubhead {
391
+ mso-style-noshow:yes;
392
+ mso-style-unhide:no;
393
+ mso-style-parent:"Foreword Title";
394
+ margin-top:0cm;
395
+ margin-right:0cm;
396
+ margin-bottom:15.5pt;
397
+ margin-left:0cm;
398
+ text-align:center;
399
+ line-height:15.5pt;
400
+ mso-pagination:widow-orphan;
401
+ page-break-after:avoid;
402
+ mso-hyphenate:none;
403
+ tab-stops:20.15pt;
404
+ font-size:14.0pt;
405
+ mso-bidi-font-size:11.0pt;
406
+ font-family:$headerfont;
407
+ mso-fareast-font-family:$headerfont;
408
+ mso-bidi-font-family:$headerfont;
409
+ mso-ansi-language:EN-GB;
410
+ font-weight:bold;
411
+ mso-bidi-font-weight:normal;
412
+ }
372
413
  p.Terms, li.Terms, div.Terms
373
414
  {mso-style-name:"Term\(s\)";
374
415
  mso-style-priority:8;
@@ -823,6 +864,33 @@ div.WordSection1
823
864
  mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
824
865
  mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
825
866
  mso-paper-source:0;}
867
+ @page WordSection2L
868
+ {
869
+ size:842.0pt 21.0cm;
870
+ margin:54.45pt 54.45pt 54.45pt 54.45pt;
871
+ mso-header-margin:24.1pt;
872
+ mso-footer-margin:24.1pt;
873
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
874
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
875
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2l;
876
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2l;
877
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2l;
878
+ mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2l;
879
+ mso-paper-source:0;}
880
+ @page WordSection2P
881
+ {
882
+ size:21.0cm 842.0pt;
883
+ margin:54.45pt 54.45pt 54.45pt 54.45pt;
884
+ mso-header-margin:24.1pt;
885
+ mso-footer-margin:24.1pt;
886
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
887
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
888
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
889
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
890
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
891
+ mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
892
+ mso-paper-source:0;}
893
+
826
894
  div.WordSection2
827
895
  {page:WordSection2;}
828
896
  @page WordSection3
@@ -839,6 +907,32 @@ div.WordSection2
839
907
  mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
840
908
  mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
841
909
  mso-paper-source:0;}
910
+ @page WordSection3L
911
+ {
912
+ size:842.0pt 21.0cm;
913
+ margin:2.0cm 2.0cm 2.0cm 2.0cm;
914
+ mso-header-margin:1.0cm;
915
+ mso-footer-margin:1.0cm;
916
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
917
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
918
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3l;
919
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3l;
920
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2l;
921
+ mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2l;
922
+ mso-paper-source:0;}
923
+ @page WordSection3P
924
+ {
925
+ size:21.0cm 842.0pt;
926
+ margin:2.0cm 2.0cm 2.0cm 2.0cm;
927
+ mso-header-margin:1.0cm;
928
+ mso-footer-margin:1.0cm;
929
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
930
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
931
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
932
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
933
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
934
+ mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
935
+ mso-paper-source:0;}
842
936
  div.WordSection3
843
937
  {page:WordSection3;}
844
938
  table.MsoISOTable
@@ -125,9 +125,9 @@ style='mso-ansi-language:EN-US'> 

125
125
  <p><br clear=all
126
126
  style='page-break-before:always'></p>
127
127
 
128
- <div id="legal"/>
129
- <div id="license"/>
130
- <div id="copyright"/>
128
+ <div id="boilerplate-legal-destination"/>
129
+ <div id="boilerplate-license-destination"/>
130
+ <div id="boilerplate-copyright-destination"/>
131
131
 
132
132
  <b style='mso-bidi-font-weight:normal'><span lang=EN-US style='font-size:12.0pt;
133
133
  mso-bidi-font-size:10.0pt;font-family:"Times New Roman",serif;mso-fareast-font-family:
@@ -261,13 +261,13 @@
261
261
  </tr>
262
262
  </table>
263
263
 
264
- <p class="MsoNormal" align="right" style='margin-top:12.0pt;text-align:right;
264
+ <p class="MsoNormal" align="right" style='margin-top:0.0pt;text-align:right;
265
265
  tab-stops:39.7pt 59.55pt 79.4pt 99.25pt right 17.0cm'><span style='mso-bookmark:
266
266
  _Hlk526346232'><span lang="EN-US" style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
267
267
  font-family:"Arial",sans-serif;mso-bidi-font-family:"Times New Roman";
268
268
  mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-no-proof:yes'><v:shape
269
269
  id="Picture_x0020_1" o:spid="_x0000_i1033" type="#_x0000_t75" alt="logo_E"
270
- style='width:121pt;height:50pt;visibility:visible;mso-wrap-style:square'>
270
+ style='width:70pt;height:70pt;visibility:visible;mso-wrap-style:square'>
271
271
  <v:imagedata src="{{ logo_word }}" o:title="logo_E"/>
272
272
  </v:shape></span></span><span style='mso-bookmark:_Hlk526346232'><span
273
273
  lang="EN-US" style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Arial",sans-serif;
@@ -179,6 +179,20 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
179
179
  mso-fareast-font-family:"Times New Roman";
180
180
  mso-ansi-language:EN-US;
181
181
  mso-fareast-language:EN-US;}
182
+ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
183
+ {mso-style-unhide:no;
184
+ margin:0cm;
185
+ margin-bottom:.0001pt;
186
+ mso-pagination:widow-orphan;
187
+ mso-layout-grid-align:none;
188
+ punctuation-wrap:simple;
189
+ text-autospace:none;
190
+ font-size:9.0pt;
191
+ mso-bidi-font-size:10.0pt;
192
+ font-family:$bodyfont;
193
+ mso-fareast-font-family:"Times New Roman";
194
+ mso-ansi-language:EN-US;
195
+ mso-fareast-language:EN-US;}
182
196
  p.MsoFooter, li.MsoFooter, div.MsoFooter
183
197
  {mso-style-unhide:no;
184
198
  margin:0cm;
@@ -197,6 +211,24 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
197
211
  mso-ansi-language:EN-GB;
198
212
  mso-fareast-language:EN-US;
199
213
  mso-bidi-font-weight:normal;}
214
+ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
215
+ {mso-style-unhide:no;
216
+ margin:0cm;
217
+ margin-bottom:.0001pt;
218
+ text-align:justify;
219
+ text-justify:inter-ideograph;
220
+ mso-pagination:widow-orphan;
221
+ tab-stops:366.5pt right 733.1pt;
222
+ mso-layout-grid-align:none;
223
+ punctuation-wrap:simple;
224
+ text-autospace:none;
225
+ font-size:8.0pt;
226
+ mso-bidi-font-size:10.0pt;
227
+ font-family:$bodyfont;
228
+ mso-fareast-font-family:"Times New Roman";
229
+ mso-ansi-language:EN-GB;
230
+ mso-fareast-language:EN-US;
231
+ mso-bidi-font-weight:normal;}
200
232
  span.MsoCommentReference
201
233
  {mso-style-noshow:yes;
202
234
  mso-style-unhide:no;
@@ -58,26 +58,12 @@ module IsoDoc
58
58
  end
59
59
  end
60
60
 
61
- def html_preface(docxml)
61
+ def authority_cleanup(docxml)
62
+ authority_cleanup1(docxml, "draft-warning")
62
63
  super
63
- authority_cleanup(docxml)
64
- docxml
65
64
  end
66
65
 
67
- def authority_cleanup(docxml)
68
- dest = docxml.at("//div[@class = 'draft-warning']")
69
- auth = docxml.at("//div[@id = 'draft-warning']")
70
- auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
71
- dest and auth and dest.replace(auth.remove)
72
- %w(copyright license legal).each do |t|
73
- dest = docxml.at("//div[@id = '#{t}']")
74
- auth = docxml.at("//div[@class = '#{t}']")
75
- auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
76
- dest and auth and dest.replace(auth.remove)
77
- end
78
- end
79
-
80
- include BaseConvert
66
+ include BaseConvert
81
67
  end
82
68
  end
83
69
  end
@@ -8,10 +8,12 @@ module IsoDoc
8
8
  super
9
9
  here = File.dirname(__FILE__)
10
10
  set(:logo_html,
11
- File.expand_path(File.join(here, "html", "Logo_ITU.jpg")))
11
+ #File.expand_path(File.join(here, "html", "Logo_ITU.jpg")))
12
+ File.expand_path(File.join(here, "html", "International_Telecommunication_Union_Logo.svg")))
12
13
  set(:logo_comb,
13
14
  File.expand_path(File.join(here, "html", "itu-document-comb.png")))
14
- set(:logo_word, File.expand_path(File.join(here, "html", "logo.png")))
15
+ #set(:logo_word, File.expand_path(File.join(here, "html", "logo.png")))
16
+ set(:logo_word, File.expand_path(File.join(here, "html", "International_Telecommunication_Union_Logo.svg")))
15
17
  end
16
18
 
17
19
  def title(isoxml, _out)
@@ -41,8 +43,6 @@ module IsoDoc
41
43
  end
42
44
 
43
45
  def docid(isoxml, _out)
44
- dn = isoxml.at(ns("//bibdata/docnumber"))
45
- set(:docnumber, dn&.text)
46
46
  dn = isoxml.at(ns("//bibdata/docidentifier"))
47
47
  set(:docidentifier, dn&.text)
48
48
  dn = isoxml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
@@ -13,12 +13,6 @@ module IsoDoc
13
13
  super
14
14
  end
15
15
 
16
- #def convert1(docxml, filename, dir)
17
- # FileUtils.cp html_doc_path('Logo_ITU.jpg'), File.join(@localdir, "Logo_ITU.jpg")
18
- # @files_to_delete << File.join(@localdir, "Logo_ITU.jpg")
19
- # super
20
- #end
21
-
22
16
  def html_toc(docxml)
23
17
  docxml
24
18
  end
@@ -66,25 +60,6 @@ module IsoDoc
66
60
  end
67
61
  end
68
62
 
69
- def html_preface(docxml)
70
- super
71
- authority_cleanup(docxml)
72
- docxml
73
- end
74
-
75
- def authority_cleanup(docxml)
76
- dest = docxml.at("//div[@class = 'draft-warning']")
77
- auth = docxml.at("//div[@id = 'draft-warning']")
78
- auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
79
- dest and auth and dest.replace(auth.remove)
80
- %w(copyright license legal).each do |t|
81
- dest = docxml.at("//div[@id = '#{t}']")
82
- auth = docxml.at("//div[@class = '#{t}']")
83
- auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
84
- dest and auth and dest.replace(auth.remove)
85
- end
86
- end
87
-
88
63
  include BaseConvert
89
64
  end
90
65
  end
@@ -42,9 +42,8 @@ module IsoDoc
42
42
  end
43
43
 
44
44
  def bibitem_ref_code(b)
45
- id = b.at(ns("./docidentifier[@type = 'ITU']"))
46
- id ||= b.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'metanorma' "\
47
- "or @type = 'ISSN' or @type = 'ISBN')]"))
45
+ id = b.at(ns("./docidentifier[@type = 'metanorma']"))
46
+ id ||= b.at(ns("./docidentifier[@type = 'ITU']"))
48
47
  id ||= b.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'ISSN' or "\
49
48
  "@type = 'ISBN')]"))
50
49
  id ||= b.at(ns("./docidentifier"))
@@ -66,9 +65,10 @@ module IsoDoc
66
65
 
67
66
  def render_identifiers(ids)
68
67
  ids.map do |id|
69
- (id["type"] == "ITU" ? titlecase(id.parent&.at(ns("./ext/doctype"))&.text ||
70
- "recommendation") + " " : "") +
71
- docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
68
+ (id["type"] == "ITU" ?
69
+ titlecase(id.parent&.at(ns("./ext/doctype"))&.text ||
70
+ "recommendation") + " " : "") +
71
+ docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
72
72
  end.join(" | ")
73
73
  end
74
74
 
@@ -73,7 +73,6 @@ module IsoDoc
73
73
  word_history_cleanup(docxml)
74
74
  authority_hdr_cleanup(docxml)
75
75
  super
76
- authority_cleanup(docxml)
77
76
  docxml
78
77
  end
79
78
 
@@ -85,12 +84,14 @@ module IsoDoc
85
84
  end
86
85
 
87
86
  def word_title_cleanup(docxml)
88
- docxml.xpath("p[@class = 'h1Preface'] | p[@class = 'h2Annex'] | "\
89
- "//h1 | //h2 | //h3 | //h4 | //h5 | //h6 | "\
90
- "//p[@class = 'annex_obligation']").each do |h|
87
+ docxml.xpath("//p[@class = 'annex_obligation']").each do |h|
91
88
  h&.next_element&.name == "p" or next
92
89
  h.next_element["class"] ||= "Normalaftertitle"
93
90
  end
91
+ docxml.xpath("//p[@class = 'FigureTitle']").each do |h|
92
+ h&.parent&.next_element&.name == "p" or next
93
+ h.parent.next_element["class"] ||= "Normalaftertitle"
94
+ end
94
95
  end
95
96
 
96
97
  def word_history_cleanup(docxml)
@@ -158,6 +159,11 @@ module IsoDoc
158
159
  def toWord(result, filename, dir, header)
159
160
  result = populate_template(result, :word)
160
161
  result = from_xhtml(word_cleanup(to_xhtml(result)))
162
+ unless @landscapestyle.nil? || @landscapestyle.empty?
163
+ @wordstylesheet&.open
164
+ @wordstylesheet&.write(@landscapestyle)
165
+ @wordstylesheet&.close
166
+ end
161
167
  Html2Doc.process(result, filename: filename, stylesheet: @wordstylesheet&.path,
162
168
  header_file: header&.path, dir: dir,
163
169
  asciimathdelims: [@openmathdelim, @closemathdelim],
@@ -166,23 +172,6 @@ module IsoDoc
166
172
  @wordstylesheet&.unlink
167
173
  end
168
174
 
169
- =begin
170
- def eref_parse(node, out)
171
- linkend = get_linkend(node)
172
- if node["type"] == "footnote"
173
- out.sup { |s| s << linkend }
174
- else
175
- out << linkend
176
- end
177
- end
178
-
179
- def xref_parse(node, out)
180
- #target = /#/.match(node["target"]) ? node["target"].sub(/#/, ".html#") :
181
- # "##{node["target"]}"
182
- out << get_linkend(node)
183
- end
184
- =end
185
-
186
175
  def link_parse(node, out)
187
176
  out.a **attr_code(href: node["target"], title: node["alt"], class: "url") do |l|
188
177
  if node.text.empty?
@@ -201,7 +190,7 @@ module IsoDoc
201
190
  end
202
191
  end
203
192
  %w(copyright license legal).each do |t|
204
- docxml&.xpath("//div[@class = '#{t}']").each do |d|
193
+ docxml&.xpath("//div[@class = 'boilerplate-#{t}']").each do |d|
205
194
  p = d&.at("./descendant::h1[2]") and
206
195
  p.previous = "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>"
207
196
  d.xpath(".//h1 | .//h2").each do |p|
@@ -217,12 +206,12 @@ module IsoDoc
217
206
  auth = docxml.at("//div[@id = 'draft-warning']")
218
207
  dest and auth and dest.replace(auth.remove)
219
208
  %w(copyright license legal).each do |t|
220
- dest = docxml.at("//div[@id = '#{t}']")
221
- auth = docxml.at("//div[@class = '#{t}']")
209
+ dest = docxml.at("//div[@id = 'boilerplate-#{t}-destination']")
210
+ auth = docxml.at("//div[@class = 'boilerplate-#{t}']")
222
211
  next unless auth && dest
223
- t == "copyright" and p = auth&.at(".//p[@class = 'Normalaftertitle']") and
212
+ t == "copyright" and p = auth&.at(".//p") and
224
213
  p["class"] = "boilerplateHdr"
225
- auth&.xpath(".//p[not(@class) or @class = 'Normalaftertitle']")&.each do |p|
214
+ auth&.xpath(".//p[not(@class)]")&.each do |p|
226
215
  p["class"] = "boilerplate"
227
216
  end
228
217
  auth << "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>" unless t == "copyright"
@@ -70,9 +70,9 @@ module IsoDoc
70
70
  def middle_section_asset_names(d)
71
71
  return super unless @hierarchical_assets
72
72
  middle_sections = "//clause[title = 'Scope'] | "\
73
- "//foreword | //introduction | "\
73
+ "//foreword | //introduction | //acknowledgements | "\
74
74
  "//references[title = 'References' or title = 'references'] | "\
75
- "//sections/terms | "\
75
+ "//sections/terms | //preface/clause | "\
76
76
  "//sections/definitions | //clause[parent::sections]"
77
77
  d.xpath(ns(middle_sections)).each do |c|
78
78
  hierarchical_asset_names(c, @anchors[c["id"]][:label])
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.10"
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: 1.0.5
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -260,18 +260,19 @@ files:
260
260
  - lib/asciidoctor/itu.rb
261
261
  - lib/asciidoctor/itu/basicdoc.rng
262
262
  - lib/asciidoctor/itu/biblio.rng
263
+ - lib/asciidoctor/itu/boilerplate.xml
263
264
  - lib/asciidoctor/itu/cleanup.rb
264
265
  - lib/asciidoctor/itu/converter.rb
265
266
  - lib/asciidoctor/itu/front.rb
266
267
  - lib/asciidoctor/itu/i18n-en.yaml
267
268
  - lib/asciidoctor/itu/isodoc.rng
268
269
  - lib/asciidoctor/itu/itu.rng
269
- - lib/asciidoctor/itu/itu_intro.xml
270
270
  - lib/asciidoctor/itu/macros.rb
271
271
  - lib/asciidoctor/itu/reqt.rng
272
272
  - lib/asciidoctor/itu/validate.rb
273
273
  - lib/isodoc/itu.rb
274
274
  - lib/isodoc/itu/base_convert.rb
275
+ - lib/isodoc/itu/html/International_Telecommunication_Union_Logo.svg
275
276
  - lib/isodoc/itu/html/Logo_ITU.jpg
276
277
  - lib/isodoc/itu/html/_coverpage.scss
277
278
  - lib/isodoc/itu/html/header.html