metanorma-itu 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a54eb698e50f6263e965938de057f4a6d1810c294af798979d046c353c7522a3
4
- data.tar.gz: ae1f096b59b820ef7018fde4fd8f71a235ef831ce9ec55a6ed53ba49f29b6c05
3
+ metadata.gz: 73fc0f4c79809c4f7a0d4b07454e91fb1bb499181fde2d4f735105f5ad7cf9ff
4
+ data.tar.gz: d391f5b0477836a52185bfbfad39bdad30abdf433561d5ef5eb6d04609b0a534
5
5
  SHA512:
6
- metadata.gz: e11fbc40c7d9dc2abfccef6a55b304ab44c7cdd0670d4992d3b021890a663ed1a42c1431d80d8e826f3d7f618a62c37ca1470daf0b7bc45a730b6850f6b54062
7
- data.tar.gz: f0c0c9ffa691e38676224698909ad84964018533f7fc4dc815d8610c954f017db08979fad1523a73661d90deb850b12dc035300d5b686ed10959a59868bd1dcf
6
+ metadata.gz: 694344ce14992293bcabe295c17cb2935173cd8fa02e933300e305476c8b20b58d89750f7d1d791dfd327b5d3e27be7f80616de64a3526b25e011fba56438c8f
7
+ data.tar.gz: 0f33a89d17eb597d176b9d411b385242492676d49eedb84002c6015acd8d276b98597a56fbaae895da42b5826f4ed3fdfc5fe910c4b341bb5b8b075a860f3eba
@@ -8,11 +8,13 @@ require_relative "./macros.rb"
8
8
 
9
9
  module Asciidoctor
10
10
  module ITU
11
-
12
11
  # A {Converter} implementation that generates RSD output, and a document
13
12
  # schema encapsulation of the document for validation
14
13
  #
15
14
  class Converter < Standoc::Converter
15
+ XML_ROOT_TAG = "itu-standard".freeze
16
+ XML_NAMESPACE = "https://www.metanorma.com/ns/itu".freeze
17
+
16
18
  register_for "itu"
17
19
 
18
20
  Asciidoctor::Extensions.register do
@@ -30,16 +32,8 @@ module Asciidoctor
30
32
  end
31
33
 
32
34
  def makexml(node)
33
- result = ["<?xml version='1.0' encoding='UTF-8'?>\n<itu-standard>"]
34
35
  @draft = node.attributes.has_key?("draft")
35
- result << noko { |ixml| front node, ixml }
36
- result << noko { |ixml| middle node, ixml }
37
- result << "</itu-standard>"
38
- result = textcleanup(result)
39
- ret1 = cleanup(Nokogiri::XML(result))
40
- validate(ret1)
41
- ret1.root.add_namespace(nil, Metanorma::ITU::DOCUMENT_NAMESPACE)
42
- ret1
36
+ super
43
37
  end
44
38
 
45
39
  def doctype(node)
@@ -101,26 +95,25 @@ module Asciidoctor
101
95
  return
102
96
  end
103
97
 
98
+ def sectiontype_streamline(ret)
99
+ case ret
100
+ when "definitions" then "terms and definitions"
101
+ when "abbreviations and acronyms" then "symbols and abbreviated terms"
102
+ else
103
+ super
104
+ end
105
+ end
106
+
104
107
  def section(node)
105
108
  a = section_attributes(node)
106
109
  noko do |xml|
107
110
  case sectiontype(node)
108
111
  when "references" then norm_ref_parse(a, xml, node)
109
- when "terms and definitions",
110
- "terms, definitions, symbols and abbreviated terms",
111
- "terms, definitions, symbols and abbreviations",
112
- "terms, definitions and symbols",
113
- "terms, definitions and abbreviations",
114
- "terms, definitions and abbreviated terms",
115
- "definitions"
112
+ when "terms and definitions"
116
113
  @term_def = true
117
114
  term_def_parse(a, xml, node, true)
118
115
  @term_def = false
119
- when "symbols and abbreviated terms",
120
- "symbols",
121
- "abbreviated terms",
122
- "abbreviations",
123
- "abbreviations and acronyms"
116
+ when "symbols and abbreviated terms"
124
117
  symbols_parse(a, xml, node)
125
118
  when "bibliography" then bibliography_parse(a, xml, node)
126
119
  else
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns="https://www.metanorma.com/ns/itu" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
4
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
5
  we cannot have a new default namespace: we will end up with a grammar with two different
@@ -87,21 +87,26 @@ exactly'></p>
87
87
  </div>
88
88
 
89
89
  <div style='mso-element:header' id=eh2>
90
-
91
90
  <p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
92
91
  mso-line-height-rule:exactly'><span lang=EN-GB></span></p>
92
+ </div>
93
93
 
94
+ <div style='mso-element:header' id=eh2l>
95
+ <p class=MsoHeaderLandscape align=left style='text-align:left;line-height:12.0pt;
96
+ mso-line-height-rule:exactly'><span lang=EN-GB></span></p>
94
97
  </div>
95
98
 
96
99
  <div style='mso-element:header' id=h2>
97
-
98
100
  <p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
99
101
  mso-line-height-rule:exactly'><span lang=EN-GB></span></p>
102
+ </div>
100
103
 
104
+ <div style='mso-element:header' id=h2l>
105
+ <p class=MsoHeaderLandscape align=right style='text-align:right;line-height:12.0pt;
106
+ mso-line-height-rule:exactly'><span lang=EN-GB></span></p>
101
107
  </div>
102
108
 
103
109
  <div style='mso-element:footer' id=ef2>
104
-
105
110
  <p class=FooterQP style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span lang=EN-GB style='font-weight:
106
111
  normal'><span style='mso-element:field-begin'></span></span><span lang=FR-CH
107
112
  style='mso-ansi-language:FR-CH;font-weight:normal'><span
@@ -112,11 +117,22 @@ style='mso-ansi-language:FR-CH;font-weight:normal;mso-no-proof:yes'>ii</span><!-
112
117
  lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
113
118
  lang=FR-CH style='mso-ansi-language:FR-CH'><span style='mso-tab-count:1'>              </span>Rec.
114
119
  ITU‑{{ bureau }} {{ docnumber }} ({{ pubdate_monthyear }})<o:p></o:p></span></p>
120
+ </div>
115
121
 
122
+ <div style='mso-element:footer' id=ef2l>
123
+ <p class=FooterQP style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span lang=EN-GB style='font-weight:
124
+ normal'><span style='mso-element:field-begin'></span></span><span lang=FR-CH
125
+ style='mso-ansi-language:FR-CH;font-weight:normal'><span
126
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  </span>\*
127
+ MERGEFORMAT </span><span lang=EN-GB style='font-weight:normal'><span
128
+ style='mso-element:field-separator'></span></span><![endif]--><span lang=FR-CH
129
+ style='mso-ansi-language:FR-CH;font-weight:normal;mso-no-proof:yes'>ii</span><!--[if supportFields]><span
130
+ lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
131
+ lang=FR-CH style='mso-ansi-language:FR-CH'><span style='mso-tab-count:1'>              </span>Rec.
132
+ ITU‑{{ bureau }} {{ docnumber }} ({{ pubdate_monthyear }})<o:p></o:p></span></p>
116
133
  </div>
117
134
 
118
135
  <div style='mso-element:footer' id=f2>
119
-
120
136
  <p class=FooterQP style='line-height:12.0pt'><span lang=EN-GB><span style='mso-tab-count:2'>                                                                                                       </span>Rec.
121
137
  ITU‑{{ bureau }} {{docnumber}} ({{ pubdate_monthyear }})<span style='mso-tab-count:1'>             </span></span><!--[if supportFields]><span
122
138
  lang=EN-GB style='font-weight:normal'><span style='mso-element:field-begin'></span>
@@ -125,11 +141,20 @@ style='mso-element:field-separator'></span></span><![endif]--><span lang=EN-GB
125
141
  style='font-weight:normal'><span style='mso-no-proof:yes'>29</span></span><!--[if supportFields]><span
126
142
  lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
127
143
  lang=EN-GB style='font-weight:normal'><o:p></o:p></span></p>
144
+ </div>
128
145
 
146
+ <div style='mso-element:footer' id=f2l>
147
+ <p class=FooterQPLandscape style='line-height:12.0pt'><span lang=EN-GB><span style='mso-tab-count:2'>                                                                                                       </span>Rec.
148
+ ITU‑{{ bureau }} {{docnumber}} ({{ pubdate_monthyear }})<span style='mso-tab-count:1'>             </span></span><!--[if supportFields]><span
149
+ lang=EN-GB style='font-weight:normal'><span style='mso-element:field-begin'></span>
150
+ PAGE<span style='mso-spacerun:yes'>  </span>\* MERGEFORMAT <span
151
+ style='mso-element:field-separator'></span></span><![endif]--><span lang=EN-GB
152
+ style='font-weight:normal'><span style='mso-no-proof:yes'>29</span></span><!--[if supportFields]><span
153
+ lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
154
+ lang=EN-GB style='font-weight:normal'><o:p></o:p></span></p>
129
155
  </div>
130
156
 
131
157
  <div style='mso-element:footer' id=ef3>
132
-
133
158
  <p class=FooterQP style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span lang=EN-GB style='font-weight:
134
159
  normal'><span style='mso-element:field-begin'></span></span><span lang=FR-CH
135
160
  style='mso-ansi-language:FR-CH;font-weight:normal'><span
@@ -140,11 +165,22 @@ style='mso-ansi-language:FR-CH;font-weight:normal;mso-no-proof:yes'>ii</span><!-
140
165
  lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
141
166
  lang=FR-CH style='mso-ansi-language:FR-CH'><span style='mso-tab-count:1'>              </span>Rec.
142
167
  ITU‑{{ bureau }} {{ docnumber }} ({{ pubdate_monthyear }})<o:p></o:p></span></p>
168
+ </div>
143
169
 
170
+ <div style='mso-element:footer' id=ef3l>
171
+ <p class=FooterQPLandscape style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span lang=EN-GB style='font-weight:
172
+ normal'><span style='mso-element:field-begin'></span></span><span lang=FR-CH
173
+ style='mso-ansi-language:FR-CH;font-weight:normal'><span
174
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  </span>\*
175
+ MERGEFORMAT </span><span lang=EN-GB style='font-weight:normal'><span
176
+ style='mso-element:field-separator'></span></span><![endif]--><span lang=FR-CH
177
+ style='mso-ansi-language:FR-CH;font-weight:normal;mso-no-proof:yes'>ii</span><!--[if supportFields]><span
178
+ lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
179
+ lang=FR-CH style='mso-ansi-language:FR-CH'><span style='mso-tab-count:1'>              </span>Rec.
180
+ ITU‑{{ bureau }} {{ docnumber }} ({{ pubdate_monthyear }})<o:p></o:p></span></p>
144
181
  </div>
145
182
 
146
183
  <div style='mso-element:footer' id=f3>
147
-
148
184
  <p class=FooterQP style='line-height:12.0pt'><span lang=EN-GB><span style='mso-tab-count:2'>                                                                                                       </span>Rec.
149
185
  ITU‑{{ bureau }} {{docnumber}} ({{ pubdate_monthyear }})<span style='mso-tab-count:1'>             </span></span><!--[if supportFields]><span
150
186
  lang=EN-GB style='font-weight:normal'><span style='mso-element:field-begin'></span>
@@ -153,8 +189,17 @@ style='mso-element:field-separator'></span></span><![endif]--><span lang=EN-GB
153
189
  style='font-weight:normal'><span style='mso-no-proof:yes'>29</span></span><!--[if supportFields]><span
154
190
  lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
155
191
  lang=EN-GB style='font-weight:normal'><o:p></o:p></span></p>
192
+ </div>
156
193
 
157
-
194
+ <div style='mso-element:footer' id=f3l>
195
+ <p class=FooterQPLandscape style='line-height:12.0pt'><span lang=EN-GB><span style='mso-tab-count:2'>                                                                                                       </span>Rec.
196
+ ITU‑{{ bureau }} {{docnumber}} ({{ pubdate_monthyear }})<span style='mso-tab-count:1'>             </span></span><!--[if supportFields]><span
197
+ lang=EN-GB style='font-weight:normal'><span style='mso-element:field-begin'></span>
198
+ PAGE<span style='mso-spacerun:yes'>  </span>\* MERGEFORMAT <span
199
+ style='mso-element:field-separator'></span></span><![endif]--><span lang=EN-GB
200
+ style='font-weight:normal'><span style='mso-no-proof:yes'>29</span></span><!--[if supportFields]><span
201
+ lang=EN-GB style='font-weight:normal'><span style='mso-element:field-end'></span></span><![endif]--><span
202
+ lang=EN-GB style='font-weight:normal'><o:p></o:p></span></p>
158
203
  </div>
159
204
 
160
205
  </body>
@@ -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;
@@ -852,12 +870,12 @@ div.WordSection1
852
870
  margin:54.45pt 54.45pt 54.45pt 54.45pt;
853
871
  mso-header-margin:24.1pt;
854
872
  mso-footer-margin:24.1pt;
855
- mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
856
- mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
857
- mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
858
- mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
859
- mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
860
- mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
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;
861
879
  mso-paper-source:0;}
862
880
  @page WordSection2P
863
881
  {
@@ -895,12 +913,12 @@ div.WordSection2
895
913
  margin:2.0cm 2.0cm 2.0cm 2.0cm;
896
914
  mso-header-margin:1.0cm;
897
915
  mso-footer-margin:1.0cm;
898
- mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
899
- mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
900
- mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
901
- mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
902
- mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
903
- mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
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;
904
922
  mso-paper-source:0;}
905
923
  @page WordSection3P
906
924
  {
@@ -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;
@@ -157,6 +157,11 @@ module IsoDoc
157
157
  def toWord(result, filename, dir, header)
158
158
  result = populate_template(result, :word)
159
159
  result = from_xhtml(word_cleanup(to_xhtml(result)))
160
+ unless @landscapestyle.nil? || @landscapestyle.empty?
161
+ @wordstylesheet&.open
162
+ @wordstylesheet&.write(@landscapestyle)
163
+ @wordstylesheet&.close
164
+ end
160
165
  Html2Doc.process(result, filename: filename, stylesheet: @wordstylesheet&.path,
161
166
  header_file: header&.path, dir: dir,
162
167
  asciimathdelims: [@openmathdelim, @closemathdelim],
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
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.6
4
+ version: 1.0.7
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-30 00:00:00.000000000 Z
11
+ date: 2020-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities