metanorma-iec 0.1.6 → 0.1.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: 763286864b1673ad7efbe9530c3e76365f16613c84c859c57cbb3ac5467e733e
4
- data.tar.gz: 8070859546537d9e321c7cb9d70bed07b5ed9a815bc8e4ba4079e36c7b53b615
3
+ metadata.gz: 92b20defce24dab5f7107aad66e8e034a9be80529279c6dbe842300e39974af3
4
+ data.tar.gz: 206961dc8da8348e27b4e9a7c86efb0999f6ff6cdcac80e51881224db3a3ea63
5
5
  SHA512:
6
- metadata.gz: cc1681c77b64959b79c00520ca145155d6344d76e7dab18e4810d33f6982cc27efdf913853956f2028a3031a8019bbf49382cdc037682a0132fb2e869be6a7d9
7
- data.tar.gz: 149447762adb6eee1b36ada1db22e244702d5b176fb0a8ab58353b27dffeaba278050d02098de97098553fecfb56db5c3c57a5a8894ca0203098d21538d6417d
6
+ metadata.gz: 7b67680e01cf794537cc9d9d37c5765b061cef56ed49b22d2b9ba7e45220300de160396a382f5551ac5437f821c85f77ac629ee76df4a4d85a5a6fd571aea8a3
7
+ data.tar.gz: 14cf2ca4493fb7575358ba738c185011bb7b444d6cbd37d3bb94a7a8f25ed6d31a5a202c6b78ae11f69d4bb5de3a0fe151afc50e2a2f7a301ff6c3c32f754c21
@@ -4,9 +4,21 @@ require "metanorma-iso"
4
4
  module Asciidoctor
5
5
  module Iec
6
6
  class Converter < ISO::Converter
7
+ XML_ROOT_TAG = "iec-standard".freeze
8
+ XML_NAMESPACE = "https://www.metanorma.org/ns/iec".freeze
7
9
 
8
10
  register_for "iec"
9
11
 
12
+ def makexml(node)
13
+ @draft = node.attributes.has_key?("draft")
14
+ #super
15
+ result = makexml1(node)
16
+ ret1 = cleanup(Nokogiri::XML(result))
17
+ ret1.root.add_namespace(nil, self.class::XML_NAMESPACE)
18
+ validate(ret1) unless @novalid
19
+ ret1
20
+ end
21
+
10
22
  def metadata_author(node, xml)
11
23
  publishers = node.attr("publisher") || "IEC"
12
24
  publishers.split(/,[ ]?/).each do |p|
@@ -47,13 +59,6 @@ module Asciidoctor
47
59
  xml.docidentifier dn, **attr_code(type: "iso")
48
60
  end
49
61
 
50
- =begin
51
- def make_preface(x, s)
52
- s.previous = boilerplate(x)
53
- super
54
- end
55
- =end
56
-
57
62
  def boilerplate_file(x_orig)
58
63
  lang = case x_orig&.at("//bibdata/language")&.text
59
64
  when "fr" then "fr"
@@ -176,14 +181,6 @@ module Asciidoctor
176
181
  super.merge(y)
177
182
  end
178
183
 
179
- def makexml1(node)
180
- result = ["<?xml version='1.0' encoding='UTF-8'?>\n<iec-standard>"]
181
- result << noko { |ixml| front node, ixml }
182
- result << noko { |ixml| middle node, ixml }
183
- result << "</iec-standard>"
184
- textcleanup(result)
185
- end
186
-
187
184
  def html_converter(node)
188
185
  node.nil? ? IsoDoc::Iec::HtmlConvert.new({}) :
189
186
  IsoDoc::Iec::HtmlConvert.new(html_extract_attributes(node))
@@ -1,5 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="http://riboseinc.com/isoxml" xmlns="http://relaxng.org/ns/structure/1.0">
2
+ <grammar ns="https://www.metanorma.com/ns/iec" xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!-- default namespace = "https://www.metanorma.com/ns/iec" -->
3
4
  <include href="isostandard.rng">
4
5
  <start>
5
6
  <ref name="iec-standard"/>
@@ -1,5 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
3
4
  <include href="isodoc.rng">
4
5
  <start>
5
6
  <ref name="iso-standard"/>
@@ -97,7 +97,6 @@ lang=EN-GB> –<span style='mso-tab-count:1'>                 
97
97
  </div>
98
98
 
99
99
  <div style='mso-element:header' id=eh2>
100
-
101
100
  <p class=MsoHeader><span lang=EN-GB><span style='mso-tab-count:1'>                                                                        </span>–
102
101
  </span><!--[if supportFields]><span class=MsoPageNumber><span lang=EN-GB><span
103
102
  style='mso-element:field-begin'></span><span
@@ -106,11 +105,20 @@ class=MsoPageNumber><span lang=EN-GB><span style='mso-no-proof:yes'>2</span></sp
106
105
  class=MsoPageNumber><span lang=EN-GB><span style='mso-element:field-end'></span></span></span><![endif]--><span
107
106
  lang=EN-GB> –<span style='mso-tab-count:1'>     </span> {{ docnumber }} </span> © <span
108
107
  lang=EN-GB> {{ agency }}:{{docyear}}</span></p>
108
+ </div>
109
109
 
110
+ <div style='mso-element:header' id=eh2l>
111
+ <p class=MsoHeaderLandscape><span lang=EN-GB><span style='mso-tab-count:1'>                                                                        </span>–
112
+ </span><!--[if supportFields]><span class=MsoPageNumber><span lang=EN-GB><span
113
+ style='mso-element:field-begin'></span><span
114
+ style='mso-spacerun:yes'> </span>PAGE <span style='mso-element:field-separator'></span></span></span><![endif]--><span
115
+ class=MsoPageNumber><span lang=EN-GB><span style='mso-no-proof:yes'>2</span></span></span><!--[if supportFields]><span
116
+ class=MsoPageNumber><span lang=EN-GB><span style='mso-element:field-end'></span></span></span><![endif]--><span
117
+ lang=EN-GB> –<span style='mso-tab-count:1'>     </span> {{ docnumber }} </span> © <span
118
+ lang=EN-GB> {{ agency }}:{{docyear}}</span></p>
110
119
  </div>
111
120
 
112
121
  <div style='mso-element:header' id=h2>
113
-
114
122
  <p class=MsoHeader><span lang=EN-GB>{{ docnumber }}
115
123
  </span> © <span
116
124
  lang=EN-GB> {{ agency }}:{{docyear}}<span style='mso-tab-count:
@@ -120,31 +128,50 @@ style='mso-spacerun:yes'> </span>PAGE <span style='mso-element:field-separator'
120
128
  class=MsoPageNumber><span lang=EN-GB><span style='mso-no-proof:yes'>1</span></span></span><!--[if supportFields]><span
121
129
  class=MsoPageNumber><span lang=EN-GB><span style='mso-element:field-end'></span></span></span><![endif]--><span
122
130
  lang=EN-GB> –<span style='mso-tab-count:1'>                                                                        </span></span></p>
131
+ </div>
123
132
 
133
+ <div style='mso-element:header' id=h2l>
134
+ <p class=MsoHeaderLandscape><span lang=EN-GB>{{ docnumber }}
135
+ </span> © <span
136
+ lang=EN-GB> {{ agency }}:{{docyear}}<span style='mso-tab-count:
137
+ 1'>      </span>– </span><!--[if supportFields]><span class=MsoPageNumber><span
138
+ lang=EN-GB><span style='mso-element:field-begin'></span><span
139
+ style='mso-spacerun:yes'> </span>PAGE <span style='mso-element:field-separator'></span></span></span><![endif]--><span
140
+ class=MsoPageNumber><span lang=EN-GB><span style='mso-no-proof:yes'>1</span></span></span><!--[if supportFields]><span
141
+ class=MsoPageNumber><span lang=EN-GB><span style='mso-element:field-end'></span></span></span><![endif]--><span
142
+ lang=EN-GB> –<span style='mso-tab-count:1'>                                                                        </span></span></p>
124
143
  </div>
125
144
 
126
145
  <div style='mso-element:footer' id=ef2>
127
-
128
146
  <p class=MsoFooter><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
147
+ </div>
129
148
 
149
+ <div style='mso-element:footer' id=ef2l>
150
+ <p class=MsoFooterLandscape><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
130
151
  </div>
131
152
 
132
153
  <div style='mso-element:footer' id=f2>
133
-
134
154
  <p class=MsoFooter><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
155
+ </div>
135
156
 
157
+ <div style='mso-element:footer' id=f2l>
158
+ <p class=MsoFooterLandscape><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
136
159
  </div>
137
160
 
138
161
  <div style='mso-element:footer' id=ef3>
139
-
140
162
  <p class=MsoFooter><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
163
+ </div>
141
164
 
165
+ <div style='mso-element:footer' id=ef3l>
166
+ <p class=MsoFooterLandscape><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
142
167
  </div>
143
168
 
144
169
  <div style='mso-element:footer' id=f3>
145
-
146
170
  <p class=MsoFooter><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
171
+ </div>
147
172
 
173
+ <div style='mso-element:footer' id=f3l>
174
+ <p class=MsoFooterLandscape><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>
148
175
  </div>
149
176
 
150
177
  <div style='mso-element:footer' id=f4>
@@ -643,6 +643,20 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
643
643
  letter-spacing:.4pt;
644
644
  mso-ansi-language:EN-GB;
645
645
  mso-fareast-language:ZH-CN;}
646
+ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
647
+ {mso-style-unhide:no;
648
+ margin:0cm;
649
+ margin-bottom:.0001pt;
650
+ text-align:justify;
651
+ mso-pagination:widow-orphan;
652
+ tab-stops:center 331.0pt right 662.0pt;
653
+ layout-grid-mode:char;
654
+ font-size:10.0pt;
655
+ font-family:"Arial",sans-serif;
656
+ mso-fareast-font-family:"Times New Roman";
657
+ letter-spacing:.4pt;
658
+ mso-ansi-language:EN-GB;
659
+ mso-fareast-language:ZH-CN;}
646
660
  p.MsoFooter, li.MsoFooter, div.MsoFooter
647
661
  {mso-style-noshow:yes;
648
662
  mso-style-priority:29;
@@ -660,6 +674,23 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
660
674
  letter-spacing:.4pt;
661
675
  mso-ansi-language:EN-GB;
662
676
  mso-fareast-language:ZH-CN;}
677
+ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
678
+ {mso-style-noshow:yes;
679
+ mso-style-priority:29;
680
+ mso-style-unhide:no;
681
+ mso-style-parent:Header;
682
+ margin:0cm;
683
+ margin-bottom:.0001pt;
684
+ text-align:justify;
685
+ mso-pagination:widow-orphan;
686
+ tab-stops:center 331.0pt right 662.0pt;
687
+ layout-grid-mode:char;
688
+ font-size:10.0pt;
689
+ font-family:"Arial",sans-serif;
690
+ mso-fareast-font-family:"Times New Roman";
691
+ letter-spacing:.4pt;
692
+ mso-ansi-language:EN-GB;
693
+ mso-fareast-language:ZH-CN;}
663
694
  span.MsoFootnoteReference
664
695
  {mso-style-noshow:yes;
665
696
  mso-style-unhide:no;
@@ -1305,12 +1336,12 @@ div.WordSection1
1305
1336
  margin:3.0cm 2.5cm 1.5cm 2.5cm;
1306
1337
  mso-header-margin:35.45pt;
1307
1338
  mso-footer-margin:14.2pt;
1308
- mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
1309
- mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
1310
- mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
1311
- mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
1312
- mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2;
1313
- mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2;
1339
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
1340
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
1341
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2l;
1342
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2l;
1343
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh2l;
1344
+ mso-first-footer:url("file:///C:/Doc/FILENAME_files/header.html") ff2l;
1314
1345
  mso-paper-source:0;}
1315
1346
  @page WordSection2P
1316
1347
  {size:595.3pt 841.9pt;
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  end
5
5
  end
6
6
 
@@ -89,7 +89,7 @@ RSpec.describe Asciidoctor::Iec do
89
89
  :library-ics: 1,2,3
90
90
  INPUT
91
91
  <?xml version="1.0" encoding="UTF-8"?>
92
- <iec-standard xmlns="http://riboseinc.com/isoxml">
92
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
93
93
  <bibdata type="standard">
94
94
  <title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</title>
95
95
  <title language="en" format="text/plain" type="title-intro">Introduction</title>
@@ -186,7 +186,7 @@ RSpec.describe Asciidoctor::Iec do
186
186
  :docstage: A2CD
187
187
  INPUT
188
188
  <?xml version="1.0" encoding="UTF-8"?>
189
- <iec-standard xmlns="http://riboseinc.com/isoxml">
189
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
190
190
  <bibdata type="standard">
191
191
  <docidentifier type="iso">ISO/IEC/IETF/2CD 1000-1-1</docidentifier>
192
192
  <docidentifier type="iso-tc">2000</docidentifier>
@@ -333,7 +333,7 @@ RSpec.describe Asciidoctor::Iec do
333
333
  :docnumber: 1000
334
334
  :docstage: 50
335
335
  INPUT
336
- <iec-standard xmlns="http://riboseinc.com/isoxml">
336
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
337
337
  <bibdata type="standard">
338
338
  <docidentifier type="iso">IEC/FDIS 1000</docidentifier>
339
339
  <docnumber>1000</docnumber>
@@ -396,7 +396,7 @@ OUTPUT
396
396
  :docnumber: 1000
397
397
  :docstage: 60
398
398
  INPUT
399
- <iec-standard xmlns="http://riboseinc.com/isoxml">
399
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
400
400
  <bibdata type="standard">
401
401
  <docidentifier type="iso">IEC 1000</docidentifier>
402
402
  <docnumber>1000</docnumber>
@@ -460,7 +460,7 @@ OUTPUT
460
460
  :docstage: 60
461
461
  :docsubstage: 00
462
462
  INPUT
463
- <iec-standard xmlns="http://riboseinc.com/isoxml">
463
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
464
464
  <bibdata type="standard">
465
465
  <docidentifier type="iso">IEC 1000</docidentifier>
466
466
  <docnumber>1000</docnumber>
data/spec/spec_helper.rb CHANGED
@@ -140,7 +140,7 @@ UNPUBLISHED_BOILERPLATE = BOILERPLATE.sub(/<\/boilerplate>/, "#{BOILERPLATE_LICE
140
140
 
141
141
  BLANK_HDR = <<~"HDR"
142
142
  <?xml version="1.0" encoding="UTF-8"?>
143
- <iec-standard xmlns="http://riboseinc.com/isoxml">
143
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
144
144
  <bibdata type="standard">
145
145
  <contributor>
146
146
  <role type="author"/>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
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: ruby-jing