metanorma-iec 1.2.17 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +12 -11
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +3 -7
  5. data/lib/asciidoctor/iec/biblio.rng +1 -0
  6. data/lib/asciidoctor/iec/front.rb +11 -5
  7. data/lib/asciidoctor/iec/iec.rng +4 -0
  8. data/lib/asciidoctor/iec/iec_intro_en.xml +1 -1
  9. data/lib/asciidoctor/iec/isodoc.rng +321 -4
  10. data/lib/asciidoctor/iec/isostandard.rng +12 -0
  11. data/lib/isodoc/iec/html/htmlstyle.css +7 -0
  12. data/lib/isodoc/iec/html_convert.rb +0 -1
  13. data/lib/isodoc/iec/iec.international-standard.xsl +503 -67
  14. data/lib/metanorma/iec/version.rb +1 -1
  15. data/metanorma-iec.gemspec +4 -4
  16. data/spec/asciidoctor/base_spec.rb +1062 -0
  17. data/spec/{asciidoctor-iec → asciidoctor}/blocks_spec.rb +214 -154
  18. data/spec/{asciidoctor-iec → asciidoctor}/cleanup_spec.rb +0 -0
  19. data/spec/{asciidoctor-iec → asciidoctor}/iev_spec.rb +0 -0
  20. data/spec/{asciidoctor-iec → asciidoctor}/inline_spec.rb +0 -0
  21. data/spec/{asciidoctor-iec → asciidoctor}/lists_spec.rb +0 -0
  22. data/spec/{asciidoctor-iec → asciidoctor}/section_spec.rb +0 -38
  23. data/spec/{asciidoctor-iec → asciidoctor}/validate_spec.rb +0 -0
  24. data/spec/isodoc/postproc_spec.rb +2 -20
  25. metadata +44 -53
  26. data/spec/asciidoctor-iec/base_spec.rb +0 -1045
  27. data/spec/examples/rice.adoc +0 -723
  28. data/spec/examples/rice.doc +0 -19162
  29. data/spec/examples/rice.html +0 -1787
  30. data/spec/examples/rice.xml +0 -1951
  31. data/spec/examples/rice_img/rice_image1.png +0 -0
  32. data/spec/examples/rice_img/rice_image2.png +0 -0
  33. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  34. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  35. data/spec/examples/rice_img/rice_image3_3.png +0 -0
File without changes
File without changes
@@ -80,25 +80,6 @@ end
80
80
  </terms>
81
81
  <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="_" obligation="normative">
82
82
  <title>Normal Terms</title>
83
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
84
- <p id='_'>
85
- ISO and IEC maintain terminological databases for use in
86
- standardization at the following addresses:
87
- </p>
88
- <ul id='_'>
89
- <li>
90
- <p id='_'>
91
- IEC Electropedia: available at
92
- <link target='http://www.electropedia.org'/>
93
- </p>
94
- </li>
95
- <li>
96
- <p id='_'>
97
- ISO Online browsing platform: available at
98
- <link target='http://www.iso.org/obp'/>
99
- </p>
100
- </li>
101
- </ul>
102
83
  <term id="term-term2">
103
84
  <preferred>Term2</preferred>
104
85
  </term>
@@ -223,25 +204,6 @@ end
223
204
  <title>Terms, definitions, symbols and abbreviated terms</title>
224
205
  <terms id='_' obligation='normative'>
225
206
  <title>Normal Terms</title>
226
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
227
- <p id='_'>
228
- ISO and IEC maintain terminological databases for use in
229
- standardization at the following addresses:
230
- </p>
231
- <ul id='_'>
232
- <li>
233
- <p id='_'>
234
- IEC Electropedia: available at
235
- <link target='http://www.electropedia.org'/>
236
- </p>
237
- </li>
238
- <li>
239
- <p id='_'>
240
- ISO Online browsing platform: available at
241
- <link target='http://www.iso.org/obp'/>
242
- </p>
243
- </li>
244
- </ul>
245
207
  <term id='term-term2'>
246
208
  <preferred>Term2</preferred>
247
209
  </term>
@@ -74,7 +74,7 @@ RSpec.describe IsoDoc do
74
74
  it "generates HTML output docs with null configuration from file" do
75
75
  FileUtils.rm_f "spec/assets/iso.doc"
76
76
  FileUtils.rm_f "spec/assets/iso.html"
77
- IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
77
+ IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.css"}).convert("spec/assets/iso.xml", nil, false)
78
78
  expect(File.exist?("spec/assets/iso.html")).to be true
79
79
  html = File.read("spec/assets/iso.html", encoding: "UTF-8")
80
80
  expect(html).to match(/<style>/)
@@ -84,7 +84,7 @@ RSpec.describe IsoDoc do
84
84
 
85
85
  it "generates Word output docs with null configuration from file" do
86
86
  FileUtils.rm_f "spec/assets/iso.doc"
87
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
87
+ IsoDoc::Iec::WordConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.css"}).convert("spec/assets/iso.xml", nil, false)
88
88
  expect(File.exist?("spec/assets/iso.doc")).to be true
89
89
  word = File.read("spec/assets/iso.doc", encoding: "UTF-8")
90
90
  expect(word).to match(/<w:WordDocument>/)
@@ -134,24 +134,6 @@ RSpec.describe IsoDoc do
134
134
  OUTPUT
135
135
  end
136
136
 
137
- it "populates Word header" do
138
- FileUtils.rm_f "test.doc"
139
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", header: "spec/assets/header.html"}).convert("test", <<~"INPUT", false)
140
- <iso-standard xmlns="http://riboseinc.com/isoxml">
141
- <bibdata type="article">
142
- <docidentifier>
143
- <project-number part="1">1000</project-number>
144
- </docidentifier>
145
- </bibdata>
146
- </iso-standard>
147
-
148
- INPUT
149
- word = File.read("test.doc", encoding: "UTF-8").sub(%r{^.*Content-Location: file:///C:/Doc/test_files/header.html}m, "Content-Location: file:///C:/Doc/test_files/header.html").
150
- sub(/------=_NextPart.*$/m, "")
151
- #expect(word).to include(%{Content-Location: file:///C:/Doc/test_files/header.html\nContent-Transfer-Encoding: base64\nContent-Type: text/html charset="utf-8" })
152
- expect(word).to include(%{Content-Location: file:///C:/Doc/test_files/header.html})
153
- end
154
-
155
137
  it "processes IsoXML terms for HTML" do
156
138
  FileUtils.rm_f "test.html"
157
139
  FileUtils.rm_f "test.doc"
metadata CHANGED
@@ -1,51 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.17
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: ruby-jing
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: metanorma-iso
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: 1.7.0
19
+ version: 1.8.0
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 1.7.0
26
+ version: 1.8.0
41
27
  - !ruby/object:Gem::Dependency
42
- name: byebug
28
+ name: ruby-jing
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: '0'
48
- type: :development
34
+ type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
@@ -53,19 +39,19 @@ dependencies:
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
- name: sassc
42
+ name: byebug
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - '='
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
- version: 2.4.0
47
+ version: '0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - '='
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: 2.4.0
54
+ version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: equivalent-xml
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +94,20 @@ dependencies:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
96
  version: '4.7'
97
+ - !ruby/object:Gem::Dependency
98
+ name: iev
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -151,47 +151,47 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: 1.5.2
153
153
  - !ruby/object:Gem::Dependency
154
- name: simplecov
154
+ name: sassc
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: '0.15'
159
+ version: 2.4.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: '0.15'
166
+ version: 2.4.0
167
167
  - !ruby/object:Gem::Dependency
168
- name: timecop
168
+ name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0.9'
173
+ version: '0.15'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0.9'
180
+ version: '0.15'
181
181
  - !ruby/object:Gem::Dependency
182
- name: iev
182
+ name: timecop
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.2.0
187
+ version: '0.9'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.2.0
194
+ version: '0.9'
195
195
  description: |
196
196
  metanorma-iec lets you write IEC standards in AsciiDoc syntax.
197
197
 
@@ -252,14 +252,14 @@ files:
252
252
  - lib/metanorma/iec/processor.rb
253
253
  - lib/metanorma/iec/version.rb
254
254
  - metanorma-iec.gemspec
255
- - spec/asciidoctor-iec/base_spec.rb
256
- - spec/asciidoctor-iec/blocks_spec.rb
257
- - spec/asciidoctor-iec/cleanup_spec.rb
258
- - spec/asciidoctor-iec/iev_spec.rb
259
- - spec/asciidoctor-iec/inline_spec.rb
260
- - spec/asciidoctor-iec/lists_spec.rb
261
- - spec/asciidoctor-iec/section_spec.rb
262
- - spec/asciidoctor-iec/validate_spec.rb
255
+ - spec/asciidoctor/base_spec.rb
256
+ - spec/asciidoctor/blocks_spec.rb
257
+ - spec/asciidoctor/cleanup_spec.rb
258
+ - spec/asciidoctor/iev_spec.rb
259
+ - spec/asciidoctor/inline_spec.rb
260
+ - spec/asciidoctor/lists_spec.rb
261
+ - spec/asciidoctor/section_spec.rb
262
+ - spec/asciidoctor/validate_spec.rb
263
263
  - spec/assets/header.html
264
264
  - spec/assets/html.css
265
265
  - spec/assets/iso.xml
@@ -267,15 +267,6 @@ files:
267
267
  - spec/assets/word.css
268
268
  - spec/assets/wordintro.html
269
269
  - spec/assets/xref_error.adoc
270
- - spec/examples/rice.adoc
271
- - spec/examples/rice.doc
272
- - spec/examples/rice.html
273
- - spec/examples/rice.xml
274
- - spec/examples/rice_img/rice_image1.png
275
- - spec/examples/rice_img/rice_image2.png
276
- - spec/examples/rice_img/rice_image3_1.png
277
- - spec/examples/rice_img/rice_image3_2.png
278
- - spec/examples/rice_img/rice_image3_3.png
279
270
  - spec/isodoc/blocks_spec.rb
280
271
  - spec/isodoc/i18n_spec.rb
281
272
  - spec/isodoc/iev_spec.rb
@@ -1,1045 +0,0 @@
1
- require "spec_helper"
2
- require "fileutils"
3
-
4
- RSpec.describe Asciidoctor::Iec do
5
- before(:all) do
6
- @blank_hdr = blank_hdr_gen
7
- end
8
-
9
-
10
- it "has a version number" do
11
- expect(Metanorma::Iec::VERSION).not_to be nil
12
- end
13
-
14
- #it "generates output for the Rice document" do
15
- #FileUtils.rm_f %w(spec/examples/rice.xml spec/examples/rice.doc spec/examples/rice.html spec/examples/rice_alt.html)
16
- #FileUtils.cd "spec/examples"
17
- #Asciidoctor.convert_file "rice.adoc", {:attributes=>{"backend"=>"iso"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-iso"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
18
- #FileUtils.cd "../.."
19
- #expect(File.exist?("spec/examples/rice.xml")).to be true
20
- #expect(File.exist?("spec/examples/rice.doc")).to be true
21
- #expect(File.exist?("spec/examples/rice.html")).to be true
22
- #expect(File.exist?("spec/examples/rice_alt.html")).to be true
23
- #end
24
-
25
- it "processes a blank document" do
26
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
27
- #{ASCIIDOC_BLANK_HDR}
28
- INPUT
29
- #{@blank_hdr}
30
- <sections/>
31
- </iec-standard>
32
- OUTPUT
33
- end
34
-
35
- it "converts a blank document" do
36
- FileUtils.rm_f "test.doc"
37
- FileUtils.rm_f "test.html"
38
- FileUtils.rm_f "test.pdf"
39
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
40
- = Document title
41
- Author
42
- :docfile: test.adoc
43
- :novalid:
44
- :no-isobib:
45
- INPUT
46
- #{@blank_hdr}
47
- <sections/>
48
- </iec-standard>
49
- OUTPUT
50
- expect(File.exist?("test.pdf")).to be true
51
- expect(File.exist?("test.html")).to be true
52
- expect(File.exist?("test.doc")).to be true
53
- expect(File.exist?("htmlstyle.css")).to be false
54
- end
55
-
56
- it "processes default metadata" do
57
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
58
- = Document title
59
- Author
60
- :docfile: test.adoc
61
- :nodoc:
62
- :novalid:
63
- :no-isobib:
64
- :docnumber: 1000
65
- :partnumber: 1
66
- :edition: 2
67
- :revdate: 2000-01-01
68
- :draft: 0.3.4
69
- :technical-committee: TC
70
- :technical-committee-number: 1
71
- :technical-committee-type: A
72
- :subcommittee: SC
73
- :subcommittee-number: 2
74
- :subcommittee-type: B
75
- :workgroup: WG
76
- :workgroup-number: 3
77
- :workgroup-type: C
78
- :technical-committee_2: TC1
79
- :technical-committee-number_2: 11
80
- :technical-committee-type_2: A1
81
- :subcommittee_2: SC1
82
- :subcommittee-number_2: 21
83
- :subcommittee-type_2: B1
84
- :workgroup_2: WG1
85
- :workgroup-number_2: 31
86
- :workgroup-type_2: C1
87
- :secretariat: SECRETARIAT
88
- :docstage: 10
89
- :docsubstage: 20
90
- :iteration: 3
91
- :language: en
92
- :title-intro-en: Introduction
93
- :title-main-en: Main Title -- Title
94
- :title-part-en: Title Part
95
- :title-intro-fr: Introduction Française
96
- :title-main-fr: Titre Principal
97
- :title-part-fr: Part du Titre
98
- :library-ics: 1,2,3
99
- :accessibility-color-inside: true
100
- :price-code: XC
101
- :cen-processing: true
102
- :secretary: Fred Nerk
103
- :interest-to-committees: TC 6121, SC 12
104
- :obsoletes: ABC; DEF
105
- INPUT
106
- <?xml version="1.0" encoding="UTF-8"?>
107
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
108
- <bibdata type="standard">
109
- <title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</title>
110
- <title language="en" format="text/plain" type="title-intro">Introduction</title>
111
- <title language="en" format="text/plain" type="title-main">Main Title — Title</title>
112
- <title language="en" format="text/plain" type="title-part">Title Part</title>
113
- <title language="fr" format="text/plain" type="main">Introduction Française — Titre Principal — Part du Titre</title>
114
- <title language="fr" format="text/plain" type="title-intro">Introduction Française</title>
115
- <title language="fr" format="text/plain" type="title-main">Titre Principal</title>
116
- <title language="fr" format="text/plain" type="title-part">Part du Titre</title>
117
- <docidentifier type="ISO">IEC/3NWIP 1000-1 ED 2</docidentifier>
118
- <docnumber>1000</docnumber>
119
- <contributor>
120
- <role type="author"/>
121
- <organization>
122
- <name>International Electrotechnical Commission</name>
123
- <abbreviation>IEC</abbreviation>
124
- </organization>
125
- </contributor>
126
- <contributor>
127
- <role type="publisher"/>
128
- <organization>
129
- <name>International Electrotechnical Commission</name>
130
- <abbreviation>IEC</abbreviation>
131
- </organization>
132
- </contributor>
133
- <edition>2</edition>
134
- <version>
135
- <revision-date>2000-01-01</revision-date>
136
- <draft>0.3.4</draft>
137
- </version>
138
- <language>en</language>
139
- <script>Latn</script>
140
- <status>
141
- <stage abbreviation="NWIP">10</stage>
142
- <substage abbreviation="??">20</substage>
143
- <iteration>3</iteration>
144
- </status>
145
- <copyright>
146
- <from>#{Date.today.year}</from>
147
- <owner>
148
- <organization>
149
- <name>International Electrotechnical Commission</name>
150
- <abbreviation>IEC</abbreviation>
151
- </organization>
152
- </owner>
153
- </copyright>
154
- <relation type='obsoletes'>
155
- <bibitem>
156
- <title>--</title>
157
- <docidentifier>ABC</docidentifier>
158
- </bibitem>
159
- </relation>
160
- <relation type='obsoletes'>
161
- <bibitem>
162
- <title>--</title>
163
- <docidentifier>DEF</docidentifier>
164
- </bibitem>
165
- </relation>
166
- <ext>
167
- <doctype>article</doctype>
168
- <horizontal>false</horizontal>
169
- <editorialgroup>
170
- <technical-committee number="1" type="A">TC</technical-committee>
171
- <technical-committee number="11" type="A1">TC1</technical-committee>
172
- <subcommittee number="2" type="B">SC</subcommittee>
173
- <subcommittee number="21" type="B1">SC1</subcommittee>
174
- <workgroup number="3" type="C">WG</workgroup>
175
- <workgroup number="31" type="C1">WG1</workgroup>
176
- <secretariat>SECRETARIAT</secretariat>
177
- </editorialgroup>
178
- <ics>
179
- <code>1</code>
180
- </ics>
181
- <ics>
182
- <code>2</code>
183
- </ics>
184
- <ics>
185
- <code>3</code>
186
- </ics>
187
- <structuredidentifier>
188
- <project-number part="1">IEC 1000</project-number>
189
- </structuredidentifier>
190
- <stagename>New work item proposal</stagename>
191
- <accessibility-color-inside>true</accessibility-color-inside>
192
- <price-code>XC</price-code>
193
- <cen-processing>true</cen-processing>
194
- <secretary>Fred Nerk</secretary>
195
- <interest-to-committees>TC 6121, SC 12</interest-to-committees>
196
- </ext>
197
- </bibdata>
198
- <boilerplate>
199
- <copyright-statement>
200
- <clause>
201
- <p id='_'>
202
- <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
203
- All rights reserved. It is permitted to download this electronic
204
- file, to make a copy and to print out the content for the sole purpose
205
- of preparing National Committee positions. You may not copy or
206
- “mirror” the file or printed version of the document, or any part of
207
- it, for any other purpose without permission in writing from IEC.
208
- </p>
209
- </clause>
210
- </copyright-statement>
211
- <legal-statement>
212
- <clause>
213
- <ol id='_'>
214
- <li>
215
- <p id='_'>
216
- The International Electrotechnical Commission (IEC) is a worldwide
217
- organization for standardization comprising all national
218
- electrotechnical committees (IEC National Committees). The object
219
- of IEC is to promote international co-operation on all questions
220
- concerning standardization in the electrical and electronic
221
- fields. To this end and in addition to other activities, IEC
222
- publishes International Standards, Technical Specifications,
223
- Technical Reports, Publicly Available Specifications (PAS) and
224
- Guides (hereafter referred to as “IEC Publication(s)”). Their
225
- preparation is entrusted to technical committees; any IEC National
226
- Committee interested in the subject dealt with may participate in
227
- this preparatory work. International, governmental and
228
- non-governmental organizations liaising with the IEC also
229
- participate in this preparation. IEC collaborates closely with the
230
- International Organization for Standardization (ISO) in accordance
231
- with conditions determined by agreement between the two
232
- organizations.
233
- </p>
234
- </li>
235
- <li>
236
- <p id='_'>
237
- The formal decisions or agreements of IEC on technical matters
238
- express, as nearly as possible, an international consensus of
239
- opinion on the relevant subjects since each technical committee
240
- has representation from all interested IEC National Committees.
241
- </p>
242
- </li>
243
- <li>
244
- <p id='_'>
245
- IEC Publications have the form of recommendations for
246
- international use and are accepted by IEC National Committees in
247
- that sense. While all reasonable efforts are made to ensure that
248
- the technical content of IEC Publications is accurate, IEC cannot
249
- be held responsible for the way in which they are used or for any
250
- misinterpretation by any end user.
251
- </p>
252
- </li>
253
- <li>
254
- <p id='_'>
255
- In order to promote international uniformity, IEC National
256
- Committees undertake to apply IEC Publications transparently to
257
- the maximum extent possible in their national and regional
258
- publications. Any divergence between any IEC Publication and the
259
- corresponding national or regional publication shall be clearly
260
- indicated in the latter.
261
- </p>
262
- </li>
263
- <li>
264
- <p id='_'>
265
- IEC itself does not provide any attestation of conformity.
266
- Independent certification bodies provide conformity assessment
267
- services and, in some areas, access to IEC marks of conformity.
268
- IEC is not responsible for any services carried out by independent
269
- certification bodies.
270
- </p>
271
- </li>
272
- <li>
273
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
274
- </li>
275
- <li>
276
- <p id='_'>
277
- No liability shall attach to IEC or its directors, employees,
278
- servants or agents including individual experts and members of its
279
- technical committees and IEC National Committees for any personal
280
- injury, property damage or other damage of any nature whatsoever,
281
- whether direct or indirect, or for costs (including legal fees)
282
- and expenses arising out of the publication, use of, or reliance
283
- upon, this IEC Publication or any other IEC Publications.
284
- </p>
285
- </li>
286
- <li>
287
- <p id='_'>
288
- Attention is drawn to the Normative references cited in this
289
- publication. Use of the referenced publications is indispensable
290
- for the correct application of this publication.
291
- </p>
292
- </li>
293
- <li>
294
- <p id='_'>
295
- Attention is drawn to the possibility that some of the elements of
296
- this IEC Publication may be the subject of patent rights. IEC
297
- shall not be held responsible for identifying any or all such
298
- patent rights.
299
- </p>
300
- </li>
301
- </ol>
302
- </clause>
303
- </legal-statement>
304
- <license-statement>
305
- <clause>
306
- <p id='_'>
307
- This document is still under study and subject to change. It should
308
- not be used for reference purposes.
309
- </p>
310
- until published as such.
311
- <p id='_'>
312
- Recipients of this document are invited to submit, with their
313
- comments, notification of any relevant patent rights of which they are
314
- aware and to provide supporting documentation.
315
- </p>
316
- </clause>
317
- </license-statement>
318
- <feedback-statement>
319
- <clause id='boilerplate-cenelec-attention'>
320
- <title>Attention IEC-CENELEC parallel voting</title>
321
- <p id='_'>
322
- The attention of IEC National Committees, members of CENELEC, is drawn
323
- to the fact that this (NWIP) is submitted for parallel voting.
324
- </p>
325
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
326
- </clause>
327
- </feedback-statement>
328
- </boilerplate>
329
- <sections/>
330
- </iec-standard>
331
- OUTPUT
332
- end
333
-
334
-
335
- it "processes complex metadata" do
336
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
337
- = Document title
338
- Author
339
- :docfile: test.adoc
340
- :nodoc:
341
- :novalid:
342
- :no-isobib:
343
- :docnumber: 1000
344
- :partnumber: 1-1
345
- :tc-docnumber: 2000
346
- :language: el
347
- :script: Grek
348
- :publisher: IEC;IETF;ISO
349
- :copyright-year: 2001
350
- :docstage: A2CD
351
- :doctype: technical-specification
352
- :function: emc
353
- :horizontal: true
354
- INPUT
355
- <?xml version="1.0" encoding="UTF-8"?>
356
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
357
- <bibdata type="standard">
358
- <docidentifier type="ISO">ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
359
- <docidentifier type="iso-tc">2000</docidentifier>
360
- <docnumber>1000</docnumber>
361
- <contributor>
362
- <role type="author"/>
363
- <organization>
364
- <name>International Electrotechnical Commission</name>
365
- <abbreviation>IEC</abbreviation>
366
- </organization>
367
- </contributor>
368
- <contributor>
369
- <role type="author"/>
370
- <organization>
371
- <name>IETF</name>
372
- </organization>
373
- </contributor>
374
- <contributor>
375
- <role type="author"/>
376
- <organization>
377
- <name>International Organization for Standardization</name>
378
- <abbreviation>ISO</abbreviation>
379
- </organization>
380
- </contributor>
381
- <contributor>
382
- <role type="publisher"/>
383
- <organization>
384
- <name>International Electrotechnical Commission</name>
385
- <abbreviation>IEC</abbreviation>
386
- </organization>
387
- </contributor>
388
- <contributor>
389
- <role type="publisher"/>
390
- <organization>
391
- <name>IETF</name>
392
- </organization>
393
- </contributor>
394
- <contributor>
395
- <role type="publisher"/>
396
- <organization>
397
- <name>International Organization for Standardization</name>
398
- <abbreviation>ISO</abbreviation>
399
- </organization>
400
- </contributor>
401
- <language>el</language>
402
- <script>Grek</script>
403
- <status>
404
- <stage abbreviation="CD">30</stage>
405
- <substage abbreviation="A22CD">99</substage>
406
- <iteration>2</iteration>
407
- </status>
408
- <copyright>
409
- <from>2001</from>
410
- <owner>
411
- <organization>
412
- <name>International Electrotechnical Commission</name>
413
- <abbreviation>IEC</abbreviation>
414
- </organization>
415
- </owner>
416
- </copyright>
417
- <copyright>
418
- <from>2001</from>
419
- <owner>
420
- <organization>
421
- <name>IETF</name>
422
- </organization>
423
- </owner>
424
- </copyright>
425
- <copyright>
426
- <from>2001</from>
427
- <owner>
428
- <organization>
429
- <name>International Organization for Standardization</name>
430
- <abbreviation>ISO</abbreviation>
431
- </organization>
432
- </owner>
433
- </copyright>
434
- <ext>
435
- <doctype>technical-specification</doctype>
436
- <horizontal>true</horizontal>
437
- <function>emc</function>
438
- <editorialgroup>
439
- <technical-committee/>
440
- <subcommittee/>
441
- <workgroup/>
442
- </editorialgroup>
443
- <structuredidentifier>
444
- <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
445
- </structuredidentifier>
446
- <stagename>Committee draft</stagename>
447
- </ext>
448
- </bibdata>
449
- <boilerplate>
450
- <copyright-statement>
451
- <clause>
452
- <p id='_'>
453
- <strong>Copyright © 2001 International Electrotechnical Commission, IEC.</strong>
454
- All rights reserved. It is permitted to download this electronic
455
- file, to make a copy and to print out the content for the sole purpose
456
- of preparing National Committee positions. You may not copy or
457
- “mirror” the file or printed version of the document, or any part of
458
- it, for any other purpose without permission in writing from IEC.
459
- </p>
460
- </clause>
461
- </copyright-statement>
462
- <legal-statement>
463
- <clause>
464
- <ol id='_'>
465
- <li>
466
- <p id='_'>
467
- The International Electrotechnical Commission (IEC) is a worldwide
468
- organization for standardization comprising all national
469
- electrotechnical committees (IEC National Committees). The object
470
- of IEC is to promote international co-operation on all questions
471
- concerning standardization in the electrical and electronic
472
- fields. To this end and in addition to other activities, IEC
473
- publishes International Standards, Technical Specifications,
474
- Technical Reports, Publicly Available Specifications (PAS) and
475
- Guides (hereafter referred to as “IEC Publication(s)”). Their
476
- preparation is entrusted to technical committees; any IEC National
477
- Committee interested in the subject dealt with may participate in
478
- this preparatory work. International, governmental and
479
- non-governmental organizations liaising with the IEC also
480
- participate in this preparation. IEC collaborates closely with the
481
- International Organization for Standardization (ISO) in accordance
482
- with conditions determined by agreement between the two
483
- organizations.
484
- </p>
485
- </li>
486
- <li>
487
- <p id='_'>
488
- The formal decisions or agreements of IEC on technical matters
489
- express, as nearly as possible, an international consensus of
490
- opinion on the relevant subjects since each technical committee
491
- has representation from all interested IEC National Committees.
492
- </p>
493
- </li>
494
- <li>
495
- <p id='_'>
496
- IEC Publications have the form of recommendations for
497
- international use and are accepted by IEC National Committees in
498
- that sense. While all reasonable efforts are made to ensure that
499
- the technical content of IEC Publications is accurate, IEC cannot
500
- be held responsible for the way in which they are used or for any
501
- misinterpretation by any end user.
502
- </p>
503
- </li>
504
- <li>
505
- <p id='_'>
506
- In order to promote international uniformity, IEC National
507
- Committees undertake to apply IEC Publications transparently to
508
- the maximum extent possible in their national and regional
509
- publications. Any divergence between any IEC Publication and the
510
- corresponding national or regional publication shall be clearly
511
- indicated in the latter.
512
- </p>
513
- </li>
514
- <li>
515
- <p id='_'>
516
- IEC itself does not provide any attestation of conformity.
517
- Independent certification bodies provide conformity assessment
518
- services and, in some areas, access to IEC marks of conformity.
519
- IEC is not responsible for any services carried out by independent
520
- certification bodies.
521
- </p>
522
- </li>
523
- <li>
524
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
525
- </li>
526
- <li>
527
- <p id='_'>
528
- No liability shall attach to IEC or its directors, employees,
529
- servants or agents including individual experts and members of its
530
- technical committees and IEC National Committees for any personal
531
- injury, property damage or other damage of any nature whatsoever,
532
- whether direct or indirect, or for costs (including legal fees)
533
- and expenses arising out of the publication, use of, or reliance
534
- upon, this IEC Publication or any other IEC Publications.
535
- </p>
536
- </li>
537
- <li>
538
- <p id='_'>
539
- Attention is drawn to the Normative references cited in this
540
- publication. Use of the referenced publications is indispensable
541
- for the correct application of this publication.
542
- </p>
543
- </li>
544
- <li>
545
- <p id='_'>
546
- Attention is drawn to the possibility that some of the elements of
547
- this IEC Publication may be the subject of patent rights. IEC
548
- shall not be held responsible for identifying any or all such
549
- patent rights.
550
- </p>
551
- </li>
552
- </ol>
553
- </clause>
554
- </legal-statement>
555
- <license-statement>
556
- <clause>
557
- <p id='_'>
558
- This document is still under study and subject to change. It should
559
- not be used for reference purposes.
560
- </p>
561
- until published as such.
562
- <p id='_'>
563
- Recipients of this document are invited to submit, with their
564
- comments, notification of any relevant patent rights of which they are
565
- aware and to provide supporting documentation.
566
- </p>
567
- </clause>
568
- </license-statement>
569
- <feedback-statement>
570
- <clause id='boilerplate-cenelec-attention'>
571
- <title>Attention IEC-CENELEC parallel voting</title>
572
- <p id='_'>
573
- The attention of IEC National Committees, members of CENELEC, is drawn
574
- to the fact that this Committee Draft (CD) is submitted for parallel
575
- voting.
576
- </p>
577
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
578
- </clause>
579
- </feedback-statement>
580
- </boilerplate>
581
- <sections/>
582
- </iec-standard>
583
- OUTPUT
584
- end
585
-
586
- it "processes boilerplate in English" do
587
- doc = (strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))
588
- = Document title
589
- Author
590
- :docfile: test.adoc
591
- :nodoc:
592
- :novalid:
593
- :no-isobib:
594
- :docnumber: 1000
595
- :partnumber: 1-1
596
- :tc-docnumber: 2000
597
- :language: en
598
- :script: Latn
599
- :publisher: IEC,IETF,ISO
600
- :copyright-year: 2001
601
- INPUT
602
- expect(doc).to include "including individual experts"
603
- expect(doc).not_to include "y compris ses experts particuliers"
604
- end
605
-
606
- it "processes boilerplate in French" do
607
- doc = (strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))
608
- = Document title
609
- Author
610
- :docfile: test.adoc
611
- :nodoc:
612
- :novalid:
613
- :no-isobib:
614
- :docnumber: 1000
615
- :partnumber: 1-1
616
- :tc-docnumber: 2000
617
- :language: fr
618
- :script: Latn
619
- :publisher: IEC,IETF,ISO
620
- :copyright-year: 2001
621
- INPUT
622
- expect(doc).not_to include "including individual experts"
623
- expect(doc).to include "y compris ses experts particuliers"
624
- end
625
-
626
- it "defaults substage" do
627
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
628
- = Document title
629
- Author
630
- :docfile: test.adoc
631
- :nodoc:
632
- :novalid:
633
- :no-isobib:
634
- :docnumber: 1000
635
- :docstage: 50
636
- INPUT
637
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
638
- <bibdata type="standard">
639
- <docidentifier type="ISO">IEC/FDIS 1000 ED 1</docidentifier>
640
- <docnumber>1000</docnumber>
641
- <contributor>
642
- <role type="author"/>
643
- <organization>
644
- <name>International Electrotechnical Commission</name>
645
- <abbreviation>IEC</abbreviation>
646
- </organization>
647
- </contributor>
648
- <contributor>
649
- <role type="publisher"/>
650
- <organization>
651
- <name>International Electrotechnical Commission</name>
652
- <abbreviation>IEC</abbreviation>
653
- </organization>
654
- </contributor>
655
-
656
- <language>en</language>
657
- <script>Latn</script>
658
- <status>
659
- <stage abbreviation="FDIS">50</stage>
660
- <substage abbreviation="RFDIS">00</substage>
661
- </status>
662
- <copyright>
663
- <from>#{Date.today.year}</from>
664
- <owner>
665
- <organization>
666
- <name>International Electrotechnical Commission</name>
667
- <abbreviation>IEC</abbreviation>
668
- </organization>
669
- </owner>
670
- </copyright>
671
- <ext>
672
- <doctype>article</doctype>
673
- <horizontal>false</horizontal>
674
- <editorialgroup>
675
- <technical-committee/>
676
- <subcommittee/>
677
- <workgroup/>
678
- </editorialgroup>
679
- <structuredidentifier>
680
- <project-number>IEC 1000</project-number>
681
- </structuredidentifier>
682
- <stagename>Final draft international standard</stagename>
683
- </ext>
684
- </bibdata>
685
- <boilerplate>
686
- <copyright-statement>
687
- <clause>
688
- <p id='_'>
689
- <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
690
- All rights reserved. It is permitted to download this electronic
691
- file, to make a copy and to print out the content for the sole purpose
692
- of preparing National Committee positions. You may not copy or
693
- “mirror” the file or printed version of the document, or any part of
694
- it, for any other purpose without permission in writing from IEC.
695
- </p>
696
- </clause>
697
- </copyright-statement>
698
- <legal-statement>
699
- <clause>
700
- <ol id='_'>
701
- <li>
702
- <p id='_'>
703
- The International Electrotechnical Commission (IEC) is a worldwide
704
- organization for standardization comprising all national
705
- electrotechnical committees (IEC National Committees). The object
706
- of IEC is to promote international co-operation on all questions
707
- concerning standardization in the electrical and electronic
708
- fields. To this end and in addition to other activities, IEC
709
- publishes International Standards, Technical Specifications,
710
- Technical Reports, Publicly Available Specifications (PAS) and
711
- Guides (hereafter referred to as “IEC Publication(s)”). Their
712
- preparation is entrusted to technical committees; any IEC National
713
- Committee interested in the subject dealt with may participate in
714
- this preparatory work. International, governmental and
715
- non-governmental organizations liaising with the IEC also
716
- participate in this preparation. IEC collaborates closely with the
717
- International Organization for Standardization (ISO) in accordance
718
- with conditions determined by agreement between the two
719
- organizations.
720
- </p>
721
- </li>
722
- <li>
723
- <p id='_'>
724
- The formal decisions or agreements of IEC on technical matters
725
- express, as nearly as possible, an international consensus of
726
- opinion on the relevant subjects since each technical committee
727
- has representation from all interested IEC National Committees.
728
- </p>
729
- </li>
730
- <li>
731
- <p id='_'>
732
- IEC Publications have the form of recommendations for
733
- international use and are accepted by IEC National Committees in
734
- that sense. While all reasonable efforts are made to ensure that
735
- the technical content of IEC Publications is accurate, IEC cannot
736
- be held responsible for the way in which they are used or for any
737
- misinterpretation by any end user.
738
- </p>
739
- </li>
740
- <li>
741
- <p id='_'>
742
- In order to promote international uniformity, IEC National
743
- Committees undertake to apply IEC Publications transparently to
744
- the maximum extent possible in their national and regional
745
- publications. Any divergence between any IEC Publication and the
746
- corresponding national or regional publication shall be clearly
747
- indicated in the latter.
748
- </p>
749
- </li>
750
- <li>
751
- <p id='_'>
752
- IEC itself does not provide any attestation of conformity.
753
- Independent certification bodies provide conformity assessment
754
- services and, in some areas, access to IEC marks of conformity.
755
- IEC is not responsible for any services carried out by independent
756
- certification bodies.
757
- </p>
758
- </li>
759
- <li>
760
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
761
- </li>
762
- <li>
763
- <p id='_'>
764
- No liability shall attach to IEC or its directors, employees,
765
- servants or agents including individual experts and members of its
766
- technical committees and IEC National Committees for any personal
767
- injury, property damage or other damage of any nature whatsoever,
768
- whether direct or indirect, or for costs (including legal fees)
769
- and expenses arising out of the publication, use of, or reliance
770
- upon, this IEC Publication or any other IEC Publications.
771
- </p>
772
- </li>
773
- <li>
774
- <p id='_'>
775
- Attention is drawn to the Normative references cited in this
776
- publication. Use of the referenced publications is indispensable
777
- for the correct application of this publication.
778
- </p>
779
- </li>
780
- <li>
781
- <p id='_'>
782
- Attention is drawn to the possibility that some of the elements of
783
- this IEC Publication may be the subject of patent rights. IEC
784
- shall not be held responsible for identifying any or all such
785
- patent rights.
786
- </p>
787
- </li>
788
- </ol>
789
- </clause>
790
- </legal-statement>
791
- <license-statement>
792
- <clause>
793
- <p id='_'>
794
- This document is a draft distributed for approval. It may not be
795
- referred to as an International Standard until published as such.
796
- </p>
797
- <p id='_'>
798
- In addition to their evaluation as being acceptable for industrial,
799
- technological, commercial and user purposes, Final Draft International
800
- Standards may on occasion have to be considered in the light of their
801
- potential to become standards to which reference may be made in
802
- national regulations.
803
- </p>
804
- <p id='_'>
805
- Recipients of this document are invited to submit, with their
806
- comments, notification of any relevant patent rights of which they are
807
- aware and to provide supporting documentation.
808
- </p>
809
- </clause>
810
- </license-statement>
811
- <feedback-statement>
812
- <clause id='boilerplate-cenelec-attention'>
813
- <title>Attention IEC-CENELEC parallel voting</title>
814
- <p id='_'>
815
- The attention of IEC National Committees, members of CENELEC, is drawn
816
- to the fact that this Final Draft International Standard (FDIS) is
817
- submitted for parallel voting.
818
- </p>
819
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
820
- </clause>
821
- </feedback-statement>
822
- </boilerplate>
823
- <sections/>
824
- </iec-standard>
825
- OUTPUT
826
- end
827
-
828
- it "defaults substage for stage 60" do
829
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
830
- = Document title
831
- Author
832
- :docfile: test.adoc
833
- :nodoc:
834
- :novalid:
835
- :no-isobib:
836
- :docnumber: 1000
837
- :docstage: 60
838
- INPUT
839
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
840
- <bibdata type="standard">
841
- <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
842
- <docnumber>1000</docnumber>
843
- <contributor>
844
- <role type="author"/>
845
- <organization>
846
- <name>International Electrotechnical Commission</name>
847
- <abbreviation>IEC</abbreviation>
848
- </organization>
849
- </contributor>
850
- <contributor>
851
- <role type="publisher"/>
852
- <organization>
853
- <name>International Electrotechnical Commission</name>
854
- <abbreviation>IEC</abbreviation>
855
- </organization>
856
- </contributor>
857
-
858
- <language>en</language>
859
- <script>Latn</script>
860
- <status>
861
- <stage abbreviation="PPUB">60</stage>
862
- <substage abbreviation="PPUB">60</substage>
863
- </status>
864
- <copyright>
865
- <from>#{Date.today.year}</from>
866
- <owner>
867
- <organization>
868
- <name>International Electrotechnical Commission</name>
869
- <abbreviation>IEC</abbreviation>
870
- </organization>
871
- </owner>
872
- </copyright>
873
- <ext>
874
- <doctype>article</doctype>
875
- <horizontal>false</horizontal>
876
- <editorialgroup>
877
- <technical-committee/>
878
- <subcommittee/>
879
- <workgroup/>
880
- </editorialgroup>
881
- <structuredidentifier>
882
- <project-number>IEC 1000</project-number>
883
- </structuredidentifier>
884
- <stagename>International standard</stagename>
885
- </ext>
886
- </bibdata>
887
- #{boilerplate(Nokogiri::XML(BLANK_HDR + "</iec-standard>"))}
888
- <sections/>
889
- </iec-standard>
890
- OUTPUT
891
- end
892
-
893
- it "populates metadata for PRF" do
894
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
895
- = Document title
896
- Author
897
- :docfile: test.adoc
898
- :nodoc:
899
- :novalid:
900
- :no-isobib:
901
- :docnumber: 1000
902
- :docstage: 60
903
- :docsubstage: 00
904
- INPUT
905
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
906
- <bibdata type="standard">
907
- <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
908
- <docnumber>1000</docnumber>
909
- <contributor>
910
- <role type="author"/>
911
- <organization>
912
- <name>International Electrotechnical Commission</name>
913
- <abbreviation>IEC</abbreviation>
914
- </organization>
915
- </contributor>
916
- <contributor>
917
- <role type="publisher"/>
918
- <organization>
919
- <name>International Electrotechnical Commission</name>
920
- <abbreviation>IEC</abbreviation>
921
- </organization>
922
- </contributor>
923
-
924
- <language>en</language>
925
- <script>Latn</script>
926
- <status>
927
- <stage abbreviation="PPUB">60</stage>
928
- <substage abbreviation="BPUB">00</substage>
929
- </status>
930
- <copyright>
931
- <from>#{Date.today.year}</from>
932
- <owner>
933
- <organization>
934
- <name>International Electrotechnical Commission</name>
935
- <abbreviation>IEC</abbreviation>
936
- </organization>
937
- </owner>
938
- </copyright>
939
- <ext>
940
- <doctype>article</doctype>
941
- <horizontal>false</horizontal>
942
- <editorialgroup>
943
- <technical-committee/>
944
- <subcommittee/>
945
- <workgroup/>
946
- </editorialgroup>
947
- <structuredidentifier>
948
- <project-number>IEC 1000</project-number>
949
- </structuredidentifier>
950
- <stagename>International standard</stagename>
951
- </ext>
952
- </bibdata>
953
- #{boilerplate(Nokogiri::XML(BLANK_HDR + "</iec-standard>"))}
954
- <sections/>
955
- </iec-standard>
956
- OUTPUT
957
- end
958
-
959
-
960
- it "reads scripts into blank HTML document" do
961
- FileUtils.rm_f "test.html"
962
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
963
- = Document title
964
- Author
965
- :docfile: test.adoc
966
- :novalid:
967
- :no-isobib:
968
- :no-pdf:
969
- INPUT
970
- html = File.read("test.html", encoding: "utf-8")
971
- expect(html).to match(%r{<script>})
972
- end
973
-
974
- it "uses default fonts" do
975
- FileUtils.rm_f "test.html"
976
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
977
- = Document title
978
- Author
979
- :docfile: test.adoc
980
- :novalid:
981
- :no-isobib:
982
- :no-pdf:
983
- INPUT
984
- html = File.read("test.html", encoding: "utf-8")
985
- expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
986
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
987
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
988
- end
989
-
990
- it "uses Chinese fonts" do
991
- FileUtils.rm_f "test.html"
992
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
993
- = Document title
994
- Author
995
- :docfile: test.adoc
996
- :novalid:
997
- :no-isobib:
998
- :script: Hans
999
- :no-pdf:
1000
- INPUT
1001
- html = File.read("test.html", encoding: "utf-8")
1002
- expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
1003
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
1004
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
1005
- end
1006
-
1007
- it "uses specified fonts" do
1008
- FileUtils.rm_f "test.html"
1009
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
1010
- = Document title
1011
- Author
1012
- :docfile: test.adoc
1013
- :novalid:
1014
- :no-isobib:
1015
- :script: Hans
1016
- :body-font: Zapf Chancery
1017
- :header-font: Comic Sans
1018
- :monospace-font: Andale Mono
1019
- :no-pdf:
1020
- INPUT
1021
- html = File.read("test.html", encoding: "utf-8")
1022
- expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
1023
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
1024
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
1025
- end
1026
-
1027
- it "strips MS-specific CSS" do
1028
- FileUtils.rm_f "test.html"
1029
- FileUtils.rm_f "test.doc"
1030
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
1031
- = Document title
1032
- Author
1033
- :docfile: test.adoc
1034
- :novalid:
1035
- :no-isobib:
1036
- :no-pdf:
1037
- INPUT
1038
- word = File.read("test.doc", encoding: "utf-8")
1039
- html = File.read("test.html", encoding: "utf-8")
1040
- expect(word).to match(%r[mso-style-name: "Intro Title";]m)
1041
- expect(html).not_to match(%r[mso-style-name: "Intro Title";]m)
1042
- end
1043
-
1044
-
1045
- end