metanorma-iec 2.1.11 → 2.1.13

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