metanorma-iso 1.7.2 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +7 -1
- data/lib/asciidoctor/iso/base.rb +14 -11
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +40 -24
- data/lib/asciidoctor/iso/front.rb +29 -17
- data/lib/asciidoctor/iso/front_id.rb +81 -60
- data/lib/asciidoctor/iso/isodoc.rng +327 -2
- data/lib/asciidoctor/iso/isostandard.rng +12 -97
- data/lib/asciidoctor/iso/section.rb +2 -1
- data/lib/asciidoctor/iso/validate.rb +22 -109
- data/lib/asciidoctor/iso/validate_image.rb +97 -0
- data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
- data/lib/asciidoctor/iso/validate_section.rb +39 -20
- data/lib/asciidoctor/iso/validate_style.rb +36 -24
- data/lib/asciidoctor/iso/validate_title.rb +23 -17
- data/lib/isodoc/iso/base_convert.rb +19 -2
- data/lib/isodoc/iso/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/html_convert.rb +0 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1157 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +1157 -208
- data/lib/isodoc/iso/metadata.rb +1 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +45 -37
- data/lib/isodoc/iso/sts_convert.rb +10 -13
- data/lib/isodoc/iso/word_convert.rb +0 -1
- data/lib/isodoc/iso/xref.rb +46 -25
- data/lib/metanorma/iso/processor.rb +1 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +8 -8
- data/spec/{asciidoctor-iso → asciidoctor}/amd_spec.rb +5 -5
- data/spec/asciidoctor/base_spec.rb +825 -0
- data/spec/{asciidoctor-iso → asciidoctor}/blocks_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/cleanup_spec.rb +383 -25
- data/spec/{asciidoctor-iso → asciidoctor}/inline_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/lists_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/refs_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/section_spec.rb +0 -14
- data/spec/{asciidoctor-iso → asciidoctor}/table_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/validate_spec.rb +188 -83
- data/spec/isodoc/postproc_spec.rb +481 -438
- data/spec/isodoc/section_spec.rb +219 -0
- data/spec/spec_helper.rb +2 -0
- metadata +65 -64
- data/lib/isodoc/iso/html/scripts.html +0 -178
- data/spec/asciidoctor-iso/base_spec.rb +0 -704
File without changes
|
File without changes
|
File without changes
|
@@ -101,20 +101,6 @@ RSpec.describe Asciidoctor::ISO do
|
|
101
101
|
<title>Terms, definitions, symbols and abbreviated terms</title>
|
102
102
|
<terms id="_" obligation="normative">
|
103
103
|
<title>Normal Terms</title>
|
104
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
105
|
-
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
106
|
-
<ul id="_">
|
107
|
-
<li>
|
108
|
-
<p id="_">ISO Online browsing platform: available at
|
109
|
-
|
110
|
-
<link target="http://www.iso.org/obp"/></p>
|
111
|
-
</li>
|
112
|
-
<li>
|
113
|
-
<p id="_">IEC Electropedia: available at
|
114
|
-
|
115
|
-
<link target="http://www.electropedia.org"/></p>
|
116
|
-
</li>
|
117
|
-
</ul>
|
118
104
|
<term id="term-term2">
|
119
105
|
<preferred>Term2</preferred>
|
120
106
|
</term>
|
File without changes
|
@@ -4,6 +4,7 @@ require "fileutils"
|
|
4
4
|
RSpec.describe Asciidoctor::ISO do
|
5
5
|
context "when xref_error.adoc compilation" do
|
6
6
|
it "generates error file" do
|
7
|
+
FileUtils.rm_f "xref_error.err"
|
7
8
|
File.write("xref_error.adoc", <<~"CONTENT")
|
8
9
|
= X
|
9
10
|
A
|
@@ -70,47 +71,67 @@ RSpec.describe Asciidoctor::ISO do
|
|
70
71
|
|
71
72
|
INPUT
|
72
73
|
expect(File.read("test.err")).to include \
|
73
|
-
"image name spec/examples/rice_images/rice_image1.png does not match
|
74
|
+
"image name spec/examples/rice_images/rice_image1.png does not match "\
|
75
|
+
"DRG requirements: expect 1000-1_ed2amd3fig"
|
74
76
|
expect(File.read("test.err")).to include \
|
75
|
-
"image name spec/examples/rice_images/1001_ed2amd3fig1.png does not
|
76
|
-
|
77
|
+
"image name spec/examples/rice_images/1001_ed2amd3fig1.png does not "\
|
78
|
+
"match DRG requirements: " \
|
79
|
+
"expect 1000-1_ed2amd3fig"
|
77
80
|
expect(File.read("test.err")).not_to include \
|
78
|
-
"image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not
|
79
|
-
|
81
|
+
"image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not "\
|
82
|
+
"match DRG requirements: " \
|
83
|
+
"expect 1000-1_ed2amd3fig"
|
80
84
|
expect(File.read("test.err")).not_to include \
|
81
|
-
"image name spec/examples/rice_images/ISO_1213_1.png does not match DRG
|
85
|
+
"image name spec/examples/rice_images/ISO_1213_1.png does not match DRG "\
|
86
|
+
"requirements: expect 1000-1_ed2amd3fig"
|
82
87
|
expect(File.read("test.err")).to include \
|
83
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3figA.png does not
|
88
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figA.png does not "\
|
89
|
+
"match DRG requirements"
|
84
90
|
expect(File.read("test.err")).not_to include \
|
85
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png does
|
91
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png does "\
|
92
|
+
"not match DRG requirements"
|
86
93
|
expect(File.read("test.err")).not_to include \
|
87
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png is
|
94
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png is "\
|
95
|
+
"under a table but is not so labelled"
|
88
96
|
expect(File.read("test.err")).to include \
|
89
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig2.png is under
|
97
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig2.png is under "\
|
98
|
+
"a table but is not so labelled"
|
90
99
|
expect(File.read("test.err")).to include \
|
91
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3figTab2.png is
|
100
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figTab2.png is "\
|
101
|
+
"labelled as under a table but is not"
|
92
102
|
expect(File.read("test.err")).not_to include \
|
93
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is
|
103
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is "\
|
104
|
+
"labelled as under a table but is not"
|
94
105
|
expect(File.read("test.err")).not_to include \
|
95
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3figA2.png is
|
106
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figA2.png is "\
|
107
|
+
"under an annex but is not so labelled"
|
96
108
|
expect(File.read("test.err")).to include \
|
97
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig3.png is
|
109
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig3.png is "\
|
110
|
+
"under an annex but is not so labelled"
|
98
111
|
expect(File.read("test.err")).to include \
|
99
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3figA1.png is
|
112
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figA1.png is "\
|
113
|
+
"labelled as under an annex but is not"
|
100
114
|
expect(File.read("test.err")).not_to include \
|
101
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is
|
115
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is "\
|
116
|
+
"labelled as under an annex but is not"
|
102
117
|
expect(File.read("test.err")).not_to include \
|
103
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig1b.png has a
|
118
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1b.png has a "\
|
119
|
+
"subfigure letter but is not a subfigure"
|
104
120
|
expect(File.read("test.err")).to include \
|
105
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig4.png does not
|
121
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig4.png does not "\
|
122
|
+
"have a subfigure letter but is a subfigure"
|
106
123
|
expect(File.read("test.err")).to include \
|
107
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig1a.png has a
|
124
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1a.png has a "\
|
125
|
+
"subfigure letter but is not a subfigure"
|
108
126
|
expect(File.read("test.err")).not_to include \
|
109
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png has a
|
127
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png has a "\
|
128
|
+
"subfigure letter but is not a subfigure"
|
110
129
|
expect(File.read("test.err")).to include \
|
111
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig5_f.png expected
|
130
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig5_f.png expected "\
|
131
|
+
"to have suffix _e"
|
112
132
|
expect(File.read("test.err")).not_to include \
|
113
|
-
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png expected
|
133
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png expected "\
|
134
|
+
"to have suffix _e"
|
114
135
|
end
|
115
136
|
|
116
137
|
context "Warns of missing scope" do
|
@@ -187,7 +208,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
187
208
|
[bibliography]
|
188
209
|
== Normative references
|
189
210
|
INPUT
|
190
|
-
expect(File.read("test.err"))
|
211
|
+
expect(File.read("test.err"))
|
212
|
+
.not_to include "Normative references missing"
|
191
213
|
end
|
192
214
|
|
193
215
|
it "Normative references not missing 2" do
|
@@ -201,7 +223,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
201
223
|
|
202
224
|
text
|
203
225
|
INPUT
|
204
|
-
expect(File.read("test.err"))
|
226
|
+
expect(File.read("test.err"))
|
227
|
+
.not_to include "Normative references missing"
|
205
228
|
end
|
206
229
|
end
|
207
230
|
|
@@ -261,7 +284,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
261
284
|
|
262
285
|
text
|
263
286
|
INPUT
|
264
|
-
expect(File.read("test.err"))
|
287
|
+
expect(File.read("test.err"))
|
288
|
+
.to include "pizza is not a recognised document type"
|
265
289
|
end
|
266
290
|
|
267
291
|
it "Warns of illegal script" do
|
@@ -304,7 +328,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
304
328
|
|
305
329
|
text
|
306
330
|
INPUT
|
307
|
-
expect(File.read("test.err"))
|
331
|
+
expect(File.read("test.err"))
|
332
|
+
.to include "pizza is not a recognised substage"
|
308
333
|
end
|
309
334
|
|
310
335
|
it "Warns of illegal iteration" do
|
@@ -319,7 +344,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
319
344
|
|
320
345
|
text
|
321
346
|
INPUT
|
322
|
-
expect(File.read("test.err"))
|
347
|
+
expect(File.read("test.err"))
|
348
|
+
.to include "pizza is not a recognised iteration"
|
323
349
|
end
|
324
350
|
|
325
351
|
it "Warns of illegal script" do
|
@@ -349,7 +375,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
349
375
|
|
350
376
|
The widget is required not to be larger than 15 cm.
|
351
377
|
INPUT
|
352
|
-
expect(File.read("test.err"))
|
378
|
+
expect(File.read("test.err"))
|
379
|
+
.to include "Technical Report clause may contain requirement"
|
353
380
|
end
|
354
381
|
|
355
382
|
it "warns that introduction may contain requirement" do
|
@@ -359,7 +386,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
359
386
|
|
360
387
|
The widget is required not to be larger than 15 cm.
|
361
388
|
INPUT
|
362
|
-
expect(File.read("test.err"))
|
389
|
+
expect(File.read("test.err"))
|
390
|
+
.to include "Introduction may contain requirement"
|
363
391
|
end
|
364
392
|
|
365
393
|
it "warns that foreword may contain recommendation" do
|
@@ -370,7 +398,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
370
398
|
|
371
399
|
== Clause
|
372
400
|
INPUT
|
373
|
-
expect(File.read("test.err"))
|
401
|
+
expect(File.read("test.err"))
|
402
|
+
.to include "Foreword may contain recommendation"
|
374
403
|
end
|
375
404
|
|
376
405
|
it "warns that foreword may contain permission" do
|
@@ -405,7 +434,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
405
434
|
It is required that there is a definition.
|
406
435
|
|
407
436
|
INPUT
|
408
|
-
expect(File.read("test.err"))
|
437
|
+
expect(File.read("test.err"))
|
438
|
+
.to include "Definition may contain requirement"
|
409
439
|
end
|
410
440
|
|
411
441
|
it "warns that term example may contain recommendation" do
|
@@ -419,7 +449,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
419
449
|
[example]
|
420
450
|
It is not recommended that widgets should be larger than 15 cm.
|
421
451
|
INPUT
|
422
|
-
expect(File.read("test.err"))
|
452
|
+
expect(File.read("test.err"))
|
453
|
+
.to include "Example may contain recommendation"
|
423
454
|
end
|
424
455
|
|
425
456
|
it "warns that note may contain recommendation" do
|
@@ -437,7 +468,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
437
468
|
|
438
469
|
footnote:[It is not recommended that widgets should be larger than 15 cm.]
|
439
470
|
INPUT
|
440
|
-
expect(File.read("test.err"))
|
471
|
+
expect(File.read("test.err"))
|
472
|
+
.to include "Footnote may contain recommendation"
|
441
473
|
end
|
442
474
|
|
443
475
|
it "warns that term source is not in expected format" do
|
@@ -447,7 +479,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
447
479
|
[.source]
|
448
480
|
I am a generic paragraph
|
449
481
|
INPUT
|
450
|
-
expect(File.read("test.err"))
|
482
|
+
expect(File.read("test.err"))
|
483
|
+
.to include "term reference not in expected format"
|
451
484
|
end
|
452
485
|
|
453
486
|
it "warns that figure does not have title" do
|
@@ -472,7 +505,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
472
505
|
<1> This is one callout
|
473
506
|
<2> This is another callout
|
474
507
|
INPUT
|
475
|
-
expect(File.read("test.err"))
|
508
|
+
expect(File.read("test.err"))
|
509
|
+
.to include "mismatch of callouts and annotations"
|
476
510
|
end
|
477
511
|
|
478
512
|
it "warns that term source is not a real reference" do
|
@@ -482,7 +516,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
482
516
|
[.source]
|
483
517
|
<<iso123>>
|
484
518
|
INPUT
|
485
|
-
expect(File.read("test.err"))
|
519
|
+
expect(File.read("test.err"))
|
520
|
+
.to include "iso123 does not have a corresponding anchor ID "\
|
521
|
+
"in the bibliography"
|
486
522
|
end
|
487
523
|
|
488
524
|
it "warns that undated reference has locality" do
|
@@ -496,7 +532,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
496
532
|
== Normative References
|
497
533
|
* [[[iso123,ISO 123]]] _Standard_
|
498
534
|
INPUT
|
499
|
-
expect(File.read("test.err"))
|
535
|
+
expect(File.read("test.err"))
|
536
|
+
.to include "undated reference ISO 123 should not contain "\
|
537
|
+
"specific elements"
|
500
538
|
end
|
501
539
|
|
502
540
|
it "do not warn that undated reference which is a bibliographic reference has locality" do
|
@@ -510,7 +548,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
510
548
|
== Bibliography
|
511
549
|
* [[[iso123,1]]] _Standard_
|
512
550
|
INPUT
|
513
|
-
expect(File.read("test.err"))
|
551
|
+
expect(File.read("test.err"))
|
552
|
+
.not_to include "undated reference [1] should not contain specific "\
|
553
|
+
"elements"
|
514
554
|
end
|
515
555
|
|
516
556
|
it "do not warn that undated IEV reference has locality" do
|
@@ -524,7 +564,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
524
564
|
== Normative References
|
525
565
|
* [[[iev,IEV]]] _Standard_
|
526
566
|
INPUT
|
527
|
-
expect(File.read("test.err"))
|
567
|
+
expect(File.read("test.err"))
|
568
|
+
.not_to include "undated reference IEV should not contain specific "\
|
569
|
+
"elements"
|
528
570
|
end
|
529
571
|
|
530
572
|
it "do not warn that in print has locality" do
|
@@ -538,7 +580,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
538
580
|
== Normative References
|
539
581
|
* [[[iev,ISO 123:--]]] _Standard_
|
540
582
|
INPUT
|
541
|
-
expect(File.read("test.err"))
|
583
|
+
expect(File.read("test.err"))
|
584
|
+
.not_to include "undated reference ISO 123 should not contain specific "\
|
585
|
+
"elements"
|
542
586
|
end
|
543
587
|
|
544
588
|
it "warns of Non-reference in bibliography" do
|
@@ -559,7 +603,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
559
603
|
== Normative References
|
560
604
|
* [[[XYZ,IESO 121]]] _Standard_
|
561
605
|
INPUT
|
562
|
-
expect(File.read("test.err"))
|
606
|
+
expect(File.read("test.err"))
|
607
|
+
.to include "non-ISO/IEC reference not expected as normative"
|
563
608
|
end
|
564
609
|
|
565
610
|
it "warns that Scope contains subclauses" do
|
@@ -570,7 +615,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
570
615
|
|
571
616
|
=== Scope subclause
|
572
617
|
INPUT
|
573
|
-
expect(File.read("test.err"))
|
618
|
+
expect(File.read("test.err"))
|
619
|
+
.to include "Scope contains subclauses: should be succinct"
|
574
620
|
end
|
575
621
|
|
576
622
|
it "warns that Table should have title" do
|
@@ -601,7 +647,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
601
647
|
== Clause
|
602
648
|
ISO 12121
|
603
649
|
INPUT
|
604
|
-
expect(File.read("test.err"))
|
650
|
+
expect(File.read("test.err"))
|
651
|
+
.not_to include "number not broken up in threes"
|
605
652
|
end
|
606
653
|
|
607
654
|
it "Style warning if decimal point" do
|
@@ -641,7 +688,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
641
688
|
== Clause
|
642
689
|
95 ± 5 %
|
643
690
|
INPUT
|
644
|
-
expect(File.read("test.err"))
|
691
|
+
expect(File.read("test.err"))
|
692
|
+
.to include "unbracketed tolerance before percent sign"
|
645
693
|
end
|
646
694
|
|
647
695
|
it "Style warning if dots in abbreviation" do
|
@@ -681,7 +729,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
681
729
|
== Clause
|
682
730
|
5 °
|
683
731
|
INPUT
|
684
|
-
expect(File.read("test.err"))
|
732
|
+
expect(File.read("test.err"))
|
733
|
+
.to include "space between number and degrees/minutes/seconds"
|
685
734
|
end
|
686
735
|
|
687
736
|
it "Style warning if no space between number and SI unit" do
|
@@ -691,7 +740,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
691
740
|
== Clause
|
692
741
|
A measurement of 5Bq was taken.
|
693
742
|
INPUT
|
694
|
-
expect(File.read("test.err"))
|
743
|
+
expect(File.read("test.err"))
|
744
|
+
.to include "no space between number and SI unit"
|
695
745
|
end
|
696
746
|
|
697
747
|
it "Style warning if mins used" do
|
@@ -736,7 +786,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
736
786
|
|
737
787
|
== Symbols and Abbreviated Terms
|
738
788
|
INPUT
|
739
|
-
expect(File.read("test.err"))
|
789
|
+
expect(File.read("test.err"))
|
790
|
+
.to include "Only one Symbols and Abbreviated Terms section "\
|
791
|
+
"in the standard"
|
740
792
|
end
|
741
793
|
|
742
794
|
it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" do
|
@@ -747,7 +799,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
747
799
|
|
748
800
|
Paragraph
|
749
801
|
INPUT
|
750
|
-
expect(File.read("test.err"))
|
802
|
+
expect(File.read("test.err"))
|
803
|
+
.to include "Symbols and Abbreviated Terms can only contain "\
|
804
|
+
"a definition list"
|
751
805
|
end
|
752
806
|
|
753
807
|
it "Warning if missing foreword" do
|
@@ -758,7 +812,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
758
812
|
|
759
813
|
Paragraph
|
760
814
|
INPUT
|
761
|
-
expect(File.read("test.err"))
|
815
|
+
expect(File.read("test.err"))
|
816
|
+
.to include "Initial section must be (content) Foreword"
|
762
817
|
|
763
818
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
764
819
|
= Document title
|
@@ -772,7 +827,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
772
827
|
|
773
828
|
Paragraph
|
774
829
|
INPUT
|
775
|
-
expect(File.read("test.err"))
|
830
|
+
expect(File.read("test.err"))
|
831
|
+
.not_to include "Initial section must be (content) Foreword"
|
776
832
|
end
|
777
833
|
|
778
834
|
it "Warning if do not start with scope or introduction" do
|
@@ -784,7 +840,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
784
840
|
|
785
841
|
Paragraph
|
786
842
|
INPUT
|
787
|
-
expect(File.read("test.err"))
|
843
|
+
expect(File.read("test.err"))
|
844
|
+
.to include "Prefatory material must be followed by (clause) Scope"
|
788
845
|
|
789
846
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
790
847
|
= Document title
|
@@ -800,7 +857,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
800
857
|
|
801
858
|
Paragraph
|
802
859
|
INPUT
|
803
|
-
expect(File.read("test.err"))
|
860
|
+
expect(File.read("test.err"))
|
861
|
+
.not_to include "Prefatory material must be followed by (clause) Scope"
|
804
862
|
end
|
805
863
|
|
806
864
|
it "Warning if introduction not followed by scope" do
|
@@ -816,7 +874,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
816
874
|
|
817
875
|
Paragraph
|
818
876
|
INPUT
|
819
|
-
expect(File.read("test.err"))
|
877
|
+
expect(File.read("test.err"))
|
878
|
+
.to include "Prefatory material must be followed by (clause) Scope"
|
820
879
|
|
821
880
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
822
881
|
= Document title
|
@@ -835,7 +894,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
835
894
|
|
836
895
|
Paragraph
|
837
896
|
INPUT
|
838
|
-
expect(File.read("test.err"))
|
897
|
+
expect(File.read("test.err"))
|
898
|
+
.not_to include "Prefatory material must be followed by (clause) Scope"
|
839
899
|
end
|
840
900
|
|
841
901
|
it "Warning if normative references not followed by terms and definitions" do
|
@@ -854,7 +914,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
854
914
|
|
855
915
|
Paragraph
|
856
916
|
INPUT
|
857
|
-
expect(File.read("test.err"))
|
917
|
+
expect(File.read("test.err"))
|
918
|
+
.to include "Normative References must be followed by "\
|
919
|
+
"Terms and Definitions"
|
858
920
|
|
859
921
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
860
922
|
= Document title
|
@@ -876,7 +938,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
876
938
|
|
877
939
|
Paragraph
|
878
940
|
INPUT
|
879
|
-
expect(File.read("test.err"))
|
941
|
+
expect(File.read("test.err"))
|
942
|
+
.not_to include "Normative References must be followed by "\
|
943
|
+
"Terms and Definitions"
|
880
944
|
end
|
881
945
|
|
882
946
|
it "Warning if there are no clauses in the document" do
|
@@ -896,7 +960,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
896
960
|
== Symbols and Abbreviated Terms
|
897
961
|
|
898
962
|
INPUT
|
899
|
-
expect(File.read("test.err"))
|
963
|
+
expect(File.read("test.err"))
|
964
|
+
.to include "Document must contain at least one clause"
|
900
965
|
|
901
966
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
902
967
|
= Document title
|
@@ -919,7 +984,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
919
984
|
== Symbols and Abbreviated Terms
|
920
985
|
|
921
986
|
INPUT
|
922
|
-
expect(File.read("test.err"))
|
987
|
+
expect(File.read("test.err"))
|
988
|
+
.not_to include "Document must contain at least one clause"
|
923
989
|
end
|
924
990
|
|
925
991
|
it "Warning if scope occurs after Terms and Definitions" do
|
@@ -941,7 +1007,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
941
1007
|
== Scope
|
942
1008
|
|
943
1009
|
INPUT
|
944
|
-
expect(File.read("test.err"))
|
1010
|
+
expect(File.read("test.err"))
|
1011
|
+
.to include "Scope must occur before Terms and Definitions"
|
945
1012
|
|
946
1013
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
947
1014
|
= Document title
|
@@ -966,7 +1033,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
966
1033
|
== Scope
|
967
1034
|
|
968
1035
|
INPUT
|
969
|
-
expect(File.read("test.err"))
|
1036
|
+
expect(File.read("test.err"))
|
1037
|
+
.not_to include "Scope must occur before Terms and Definitions"
|
970
1038
|
end
|
971
1039
|
|
972
1040
|
it "Warning if Symbols and Abbreviated Terms does not occur immediately after Terms and Definitions" do
|
@@ -988,7 +1056,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
988
1056
|
== Symbols and Abbreviated Terms
|
989
1057
|
|
990
1058
|
INPUT
|
991
|
-
expect(File.read("test.err"))
|
1059
|
+
expect(File.read("test.err"))
|
1060
|
+
.to include "Only annexes and references can follow clauses"
|
992
1061
|
|
993
1062
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
994
1063
|
= Document title
|
@@ -1014,7 +1083,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1014
1083
|
== Symbols and Abbreviated Terms
|
1015
1084
|
|
1016
1085
|
INPUT
|
1017
|
-
expect(File.read("test.err"))
|
1086
|
+
expect(File.read("test.err"))
|
1087
|
+
.not_to include "Only annexes and references can follow clauses"
|
1018
1088
|
end
|
1019
1089
|
|
1020
1090
|
it "Warning if no normative references" do
|
@@ -1040,7 +1110,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1040
1110
|
== Appendix C
|
1041
1111
|
|
1042
1112
|
INPUT
|
1043
|
-
expect(File.read("test.err"))
|
1113
|
+
expect(File.read("test.err"))
|
1114
|
+
.to include "Document must include (references) Normative References"
|
1044
1115
|
|
1045
1116
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1046
1117
|
= Document title
|
@@ -1069,7 +1140,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1069
1140
|
== Appendix C
|
1070
1141
|
|
1071
1142
|
INPUT
|
1072
|
-
expect(File.read("test.err"))
|
1143
|
+
expect(File.read("test.err"))
|
1144
|
+
.not_to include "Document must include (references) Normative References"
|
1073
1145
|
end
|
1074
1146
|
|
1075
1147
|
it "Warning if final section is not named Bibliography" do
|
@@ -1101,7 +1173,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1101
1173
|
== Appendix C
|
1102
1174
|
|
1103
1175
|
INPUT
|
1104
|
-
expect(File.read("test.err"))
|
1176
|
+
expect(File.read("test.err"))
|
1177
|
+
.to include "There are sections after the final Bibliography"
|
1105
1178
|
|
1106
1179
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1107
1180
|
= Document title
|
@@ -1136,7 +1209,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1136
1209
|
== Appendix C
|
1137
1210
|
|
1138
1211
|
INPUT
|
1139
|
-
expect(File.read("test.err"))
|
1212
|
+
expect(File.read("test.err"))
|
1213
|
+
.not_to include "There are sections after the final Bibliography"
|
1140
1214
|
end
|
1141
1215
|
|
1142
1216
|
it "Warning if final section is not styled Bibliography" do
|
@@ -1164,7 +1238,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1164
1238
|
== Bibliography
|
1165
1239
|
|
1166
1240
|
INPUT
|
1167
|
-
expect(File.read("test.err"))
|
1241
|
+
expect(File.read("test.err"))
|
1242
|
+
.to include "Section not marked up as [bibliography]"
|
1168
1243
|
end
|
1169
1244
|
|
1170
1245
|
it "Warning if final section is not styled Bibliography false" do
|
@@ -1197,7 +1272,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1197
1272
|
== Bibliography
|
1198
1273
|
|
1199
1274
|
INPUT
|
1200
|
-
expect(File.read("test.err"))
|
1275
|
+
expect(File.read("test.err"))
|
1276
|
+
.not_to include "Section not marked up as [bibliography]"
|
1201
1277
|
end
|
1202
1278
|
|
1203
1279
|
it "Warning if English title intro and no French title intro" do
|
@@ -1226,7 +1302,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1226
1302
|
expect(File.read("test.err")).to include "No English Title Intro"
|
1227
1303
|
end
|
1228
1304
|
|
1229
|
-
it "Warning if English title and no French
|
1305
|
+
it "Warning if English title and no French title" do
|
1230
1306
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1231
1307
|
= Document title
|
1232
1308
|
Author
|
@@ -1237,6 +1313,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1237
1313
|
|
1238
1314
|
INPUT
|
1239
1315
|
expect(File.read("test.err")).to include "No French Title"
|
1316
|
+
expect(File.read("test.err")).not_to include "No French Intro"
|
1240
1317
|
end
|
1241
1318
|
|
1242
1319
|
it "Warning if French title and no English title" do
|
@@ -1278,6 +1355,21 @@ RSpec.describe Asciidoctor::ISO do
|
|
1278
1355
|
expect(File.read("test.err")).to include "No English Title Part"
|
1279
1356
|
end
|
1280
1357
|
|
1358
|
+
it "No warning if French main title and English main title" do
|
1359
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1360
|
+
= Document title
|
1361
|
+
Author
|
1362
|
+
:docfile: test.adoc
|
1363
|
+
:nodoc:
|
1364
|
+
:title-part-fr: Title
|
1365
|
+
:title-part-en: Title
|
1366
|
+
:no-isobib:
|
1367
|
+
|
1368
|
+
INPUT
|
1369
|
+
expect(File.read("test.err")).not_to include "No French Title Intro"
|
1370
|
+
expect(File.read("test.err")).not_to include "No French Title Part"
|
1371
|
+
end
|
1372
|
+
|
1281
1373
|
it "Warning if non-IEC document with subpart" do
|
1282
1374
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1283
1375
|
= Document title
|
@@ -1290,7 +1382,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1290
1382
|
:no-isobib:
|
1291
1383
|
|
1292
1384
|
INPUT
|
1293
|
-
expect(File.read("test.err"))
|
1385
|
+
expect(File.read("test.err"))
|
1386
|
+
.to include "Subpart defined on non-IEC document"
|
1294
1387
|
end
|
1295
1388
|
|
1296
1389
|
it "No warning if joint IEC/non-IEC document with subpart" do
|
@@ -1305,7 +1398,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1305
1398
|
:no-isobib:
|
1306
1399
|
|
1307
1400
|
INPUT
|
1308
|
-
expect(File.read("test.err"))
|
1401
|
+
expect(File.read("test.err"))
|
1402
|
+
.not_to include "Subpart defined on non-IEC document"
|
1309
1403
|
end
|
1310
1404
|
|
1311
1405
|
it "Warning if main title contains document type" do
|
@@ -1331,7 +1425,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1331
1425
|
:no-isobib:
|
1332
1426
|
|
1333
1427
|
INPUT
|
1334
|
-
expect(File.read("test.err"))
|
1428
|
+
expect(File.read("test.err"))
|
1429
|
+
.to include "Title Intro may name document type"
|
1335
1430
|
end
|
1336
1431
|
|
1337
1432
|
it "Each first-level subclause must have a title" do
|
@@ -1341,7 +1436,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1341
1436
|
|
1342
1437
|
=== {blank}
|
1343
1438
|
INPUT
|
1344
|
-
expect(File.read("test.err"))
|
1439
|
+
expect(File.read("test.err"))
|
1440
|
+
.to include "each first-level subclause must have a title"
|
1345
1441
|
end
|
1346
1442
|
|
1347
1443
|
it "All subclauses must have a title, or none" do
|
@@ -1355,7 +1451,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1355
1451
|
|
1356
1452
|
==== Subsubclause
|
1357
1453
|
INPUT
|
1358
|
-
expect(File.read("test.err"))
|
1454
|
+
expect(File.read("test.err"))
|
1455
|
+
.to include "all subclauses must have a title, or none"
|
1359
1456
|
end
|
1360
1457
|
|
1361
1458
|
it "Warning if subclause is only child of its parent, or none" do
|
@@ -1417,7 +1514,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1417
1514
|
== Clause
|
1418
1515
|
See <<terms>>
|
1419
1516
|
INPUT
|
1420
|
-
expect(File.read("test.err"))
|
1517
|
+
expect(File.read("test.err"))
|
1518
|
+
.to include "'see terms' is pointing to a normative section"
|
1421
1519
|
end
|
1422
1520
|
|
1423
1521
|
it "Warning if 'see' reference points to normative reference" do
|
@@ -1430,7 +1528,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1430
1528
|
== Clause
|
1431
1529
|
See <<terms>>
|
1432
1530
|
INPUT
|
1433
|
-
expect(File.read("test.err"))
|
1531
|
+
expect(File.read("test.err"))
|
1532
|
+
.to include "is pointing to a normative reference"
|
1434
1533
|
end
|
1435
1534
|
|
1436
1535
|
it "Warning if term definition starts with article" do
|
@@ -1442,7 +1541,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1442
1541
|
|
1443
1542
|
The definition of a term is a part of the specialized vocabulary of a particular field
|
1444
1543
|
INPUT
|
1445
|
-
expect(File.read("test.err"))
|
1544
|
+
expect(File.read("test.err"))
|
1545
|
+
.to include "term definition starts with article"
|
1446
1546
|
end
|
1447
1547
|
|
1448
1548
|
it "Warning if term definition ends with period" do
|
@@ -1464,7 +1564,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1464
1564
|
[align=mid-air]
|
1465
1565
|
Para
|
1466
1566
|
INPUT
|
1467
|
-
expect(File.read("test.err"))
|
1567
|
+
expect(File.read("test.err"))
|
1568
|
+
.to include 'value of attribute "align" is invalid; must be equal to'
|
1468
1569
|
end
|
1469
1570
|
|
1470
1571
|
it "Warn if more than 7 levels of subclause" do
|
@@ -1496,7 +1597,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1496
1597
|
====== Clause
|
1497
1598
|
|
1498
1599
|
INPUT
|
1499
|
-
expect(File.read("test.err"))
|
1600
|
+
expect(File.read("test.err"))
|
1601
|
+
.to include "Exceeds the maximum clause depth of 7"
|
1500
1602
|
end
|
1501
1603
|
|
1502
1604
|
it "Do not warn if not more than 7 levels of subclause" do
|
@@ -1525,7 +1627,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1525
1627
|
====== Clause
|
1526
1628
|
|
1527
1629
|
INPUT
|
1528
|
-
expect(File.read("test.err"))
|
1630
|
+
expect(File.read("test.err"))
|
1631
|
+
.not_to include "exceeds the maximum clause depth of 7"
|
1529
1632
|
end
|
1530
1633
|
|
1531
1634
|
it "Warn if term citation in Terms & Definitions not preceded with italicised term" do
|
@@ -1538,7 +1641,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1538
1641
|
|
1539
1642
|
The definition of a term (<<term>>) is a part of the specialized vocabulary of a particular field
|
1540
1643
|
INPUT
|
1541
|
-
expect(File.read("test.err"))
|
1644
|
+
expect(File.read("test.err"))
|
1645
|
+
.to include "term citation not preceded with italicised term"
|
1542
1646
|
end
|
1543
1647
|
|
1544
1648
|
it "Warn if an undated reference has no associated footnote" do
|
@@ -1549,7 +1653,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1549
1653
|
== Bibliography
|
1550
1654
|
* [[[ISO8,ISO 8:--]]], _Title_
|
1551
1655
|
INPUT
|
1552
|
-
expect(File.read("test.err"))
|
1553
|
-
"Reference ISO8 does not have an associated footnote
|
1656
|
+
expect(File.read("test.err"))
|
1657
|
+
.to include "Reference ISO8 does not have an associated footnote "\
|
1658
|
+
"indicating unpublished status"
|
1554
1659
|
end
|
1555
1660
|
end
|