metanorma-iso 1.8.0 → 1.8.5
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 +3 -13
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/iso/base.rb +14 -11
- data/lib/asciidoctor/iso/biblio.rng +1 -0
- data/lib/asciidoctor/iso/cleanup.rb +40 -24
- data/lib/asciidoctor/iso/front.rb +28 -16
- data/lib/asciidoctor/iso/front_id.rb +66 -50
- data/lib/asciidoctor/iso/isodoc.rng +191 -3
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +12 -0
- data/lib/asciidoctor/iso/section.rb +2 -1
- data/lib/asciidoctor/iso/validate.rb +22 -110
- 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 +55 -29
- data/lib/asciidoctor/iso/validate_style.rb +36 -24
- data/lib/asciidoctor/iso/validate_title.rb +2 -4
- data/lib/isodoc/iso/base_convert.rb +20 -14
- data/lib/isodoc/iso/html/isodoc.css +475 -20
- data/lib/isodoc/iso/html/isodoc.scss +456 -23
- data/lib/isodoc/iso/html/wordstyle.css +202 -31
- data/lib/isodoc/iso/html/wordstyle.scss +194 -32
- data/lib/isodoc/iso/iso.amendment.xsl +666 -193
- data/lib/isodoc/iso/iso.international-standard.xsl +666 -193
- data/lib/isodoc/iso/metadata.rb +3 -2
- data/lib/isodoc/iso/presentation_xml_convert.rb +15 -14
- data/lib/isodoc/iso/sts_convert.rb +10 -13
- data/lib/isodoc/iso/word_convert.rb +153 -39
- data/lib/isodoc/iso/xref.rb +44 -29
- data/lib/metanorma/iso/processor.rb +1 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +3 -3
- data/spec/asciidoctor/base_spec.rb +426 -305
- data/spec/asciidoctor/blocks_spec.rb +96 -34
- data/spec/asciidoctor/cleanup_spec.rb +383 -25
- data/spec/asciidoctor/section_spec.rb +0 -14
- data/spec/asciidoctor/validate_spec.rb +218 -83
- data/spec/isodoc/amd_spec.rb +193 -201
- data/spec/isodoc/blocks_spec.rb +100 -88
- data/spec/isodoc/i18n_spec.rb +36 -36
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/iso_spec.rb +86 -138
- data/spec/isodoc/postproc_spec.rb +492 -442
- data/spec/isodoc/ref_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +301 -306
- data/spec/isodoc/table_spec.rb +166 -231
- data/spec/isodoc/terms_spec.rb +11 -8
- data/spec/isodoc/xref_spec.rb +147 -118
- data/spec/spec_helper.rb +16 -15
- metadata +8 -7
@@ -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>
|
@@ -71,47 +71,67 @@ RSpec.describe Asciidoctor::ISO do
|
|
71
71
|
|
72
72
|
INPUT
|
73
73
|
expect(File.read("test.err")).to include \
|
74
|
-
"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"
|
75
76
|
expect(File.read("test.err")).to include \
|
76
|
-
"image name spec/examples/rice_images/1001_ed2amd3fig1.png does not
|
77
|
-
|
77
|
+
"image name spec/examples/rice_images/1001_ed2amd3fig1.png does not "\
|
78
|
+
"match DRG requirements: " \
|
79
|
+
"expect 1000-1_ed2amd3fig"
|
78
80
|
expect(File.read("test.err")).not_to include \
|
79
|
-
"image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not
|
80
|
-
|
81
|
+
"image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not "\
|
82
|
+
"match DRG requirements: " \
|
83
|
+
"expect 1000-1_ed2amd3fig"
|
81
84
|
expect(File.read("test.err")).not_to include \
|
82
|
-
"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"
|
83
87
|
expect(File.read("test.err")).to include \
|
84
|
-
"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"
|
85
90
|
expect(File.read("test.err")).not_to include \
|
86
|
-
"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"
|
87
93
|
expect(File.read("test.err")).not_to include \
|
88
|
-
"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"
|
89
96
|
expect(File.read("test.err")).to include \
|
90
|
-
"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"
|
91
99
|
expect(File.read("test.err")).to include \
|
92
|
-
"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"
|
93
102
|
expect(File.read("test.err")).not_to include \
|
94
|
-
"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"
|
95
105
|
expect(File.read("test.err")).not_to include \
|
96
|
-
"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"
|
97
108
|
expect(File.read("test.err")).to include \
|
98
|
-
"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"
|
99
111
|
expect(File.read("test.err")).to include \
|
100
|
-
"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"
|
101
114
|
expect(File.read("test.err")).not_to include \
|
102
|
-
"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"
|
103
117
|
expect(File.read("test.err")).not_to include \
|
104
|
-
"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"
|
105
120
|
expect(File.read("test.err")).to include \
|
106
|
-
"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"
|
107
123
|
expect(File.read("test.err")).to include \
|
108
|
-
"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"
|
109
126
|
expect(File.read("test.err")).not_to include \
|
110
|
-
"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"
|
111
129
|
expect(File.read("test.err")).to include \
|
112
|
-
"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"
|
113
132
|
expect(File.read("test.err")).not_to include \
|
114
|
-
"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"
|
115
135
|
end
|
116
136
|
|
117
137
|
context "Warns of missing scope" do
|
@@ -188,7 +208,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
188
208
|
[bibliography]
|
189
209
|
== Normative references
|
190
210
|
INPUT
|
191
|
-
expect(File.read("test.err"))
|
211
|
+
expect(File.read("test.err"))
|
212
|
+
.not_to include "Normative references missing"
|
192
213
|
end
|
193
214
|
|
194
215
|
it "Normative references not missing 2" do
|
@@ -202,7 +223,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
202
223
|
|
203
224
|
text
|
204
225
|
INPUT
|
205
|
-
expect(File.read("test.err"))
|
226
|
+
expect(File.read("test.err"))
|
227
|
+
.not_to include "Normative references missing"
|
206
228
|
end
|
207
229
|
end
|
208
230
|
|
@@ -262,7 +284,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
262
284
|
|
263
285
|
text
|
264
286
|
INPUT
|
265
|
-
expect(File.read("test.err"))
|
287
|
+
expect(File.read("test.err"))
|
288
|
+
.to include "pizza is not a recognised document type"
|
266
289
|
end
|
267
290
|
|
268
291
|
it "Warns of illegal script" do
|
@@ -305,7 +328,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
305
328
|
|
306
329
|
text
|
307
330
|
INPUT
|
308
|
-
expect(File.read("test.err"))
|
331
|
+
expect(File.read("test.err"))
|
332
|
+
.to include "pizza is not a recognised substage"
|
309
333
|
end
|
310
334
|
|
311
335
|
it "Warns of illegal iteration" do
|
@@ -320,7 +344,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
320
344
|
|
321
345
|
text
|
322
346
|
INPUT
|
323
|
-
expect(File.read("test.err"))
|
347
|
+
expect(File.read("test.err"))
|
348
|
+
.to include "pizza is not a recognised iteration"
|
324
349
|
end
|
325
350
|
|
326
351
|
it "Warns of illegal script" do
|
@@ -350,7 +375,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
350
375
|
|
351
376
|
The widget is required not to be larger than 15 cm.
|
352
377
|
INPUT
|
353
|
-
expect(File.read("test.err"))
|
378
|
+
expect(File.read("test.err"))
|
379
|
+
.to include "Technical Report clause may contain requirement"
|
354
380
|
end
|
355
381
|
|
356
382
|
it "warns that introduction may contain requirement" do
|
@@ -360,7 +386,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
360
386
|
|
361
387
|
The widget is required not to be larger than 15 cm.
|
362
388
|
INPUT
|
363
|
-
expect(File.read("test.err"))
|
389
|
+
expect(File.read("test.err"))
|
390
|
+
.to include "Introduction may contain requirement"
|
364
391
|
end
|
365
392
|
|
366
393
|
it "warns that foreword may contain recommendation" do
|
@@ -371,7 +398,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
371
398
|
|
372
399
|
== Clause
|
373
400
|
INPUT
|
374
|
-
expect(File.read("test.err"))
|
401
|
+
expect(File.read("test.err"))
|
402
|
+
.to include "Foreword may contain recommendation"
|
375
403
|
end
|
376
404
|
|
377
405
|
it "warns that foreword may contain permission" do
|
@@ -406,7 +434,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
406
434
|
It is required that there is a definition.
|
407
435
|
|
408
436
|
INPUT
|
409
|
-
expect(File.read("test.err"))
|
437
|
+
expect(File.read("test.err"))
|
438
|
+
.to include "Definition may contain requirement"
|
410
439
|
end
|
411
440
|
|
412
441
|
it "warns that term example may contain recommendation" do
|
@@ -420,7 +449,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
420
449
|
[example]
|
421
450
|
It is not recommended that widgets should be larger than 15 cm.
|
422
451
|
INPUT
|
423
|
-
expect(File.read("test.err"))
|
452
|
+
expect(File.read("test.err"))
|
453
|
+
.to include "Example may contain recommendation"
|
424
454
|
end
|
425
455
|
|
426
456
|
it "warns that note may contain recommendation" do
|
@@ -438,7 +468,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
438
468
|
|
439
469
|
footnote:[It is not recommended that widgets should be larger than 15 cm.]
|
440
470
|
INPUT
|
441
|
-
expect(File.read("test.err"))
|
471
|
+
expect(File.read("test.err"))
|
472
|
+
.to include "Footnote may contain recommendation"
|
442
473
|
end
|
443
474
|
|
444
475
|
it "warns that term source is not in expected format" do
|
@@ -448,7 +479,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
448
479
|
[.source]
|
449
480
|
I am a generic paragraph
|
450
481
|
INPUT
|
451
|
-
expect(File.read("test.err"))
|
482
|
+
expect(File.read("test.err"))
|
483
|
+
.to include "term reference not in expected format"
|
452
484
|
end
|
453
485
|
|
454
486
|
it "warns that figure does not have title" do
|
@@ -473,7 +505,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
473
505
|
<1> This is one callout
|
474
506
|
<2> This is another callout
|
475
507
|
INPUT
|
476
|
-
expect(File.read("test.err"))
|
508
|
+
expect(File.read("test.err"))
|
509
|
+
.to include "mismatch of callouts and annotations"
|
477
510
|
end
|
478
511
|
|
479
512
|
it "warns that term source is not a real reference" do
|
@@ -483,7 +516,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
483
516
|
[.source]
|
484
517
|
<<iso123>>
|
485
518
|
INPUT
|
486
|
-
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"
|
487
522
|
end
|
488
523
|
|
489
524
|
it "warns that undated reference has locality" do
|
@@ -497,7 +532,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
497
532
|
== Normative References
|
498
533
|
* [[[iso123,ISO 123]]] _Standard_
|
499
534
|
INPUT
|
500
|
-
expect(File.read("test.err"))
|
535
|
+
expect(File.read("test.err"))
|
536
|
+
.to include "undated reference ISO 123 should not contain "\
|
537
|
+
"specific elements"
|
501
538
|
end
|
502
539
|
|
503
540
|
it "do not warn that undated reference which is a bibliographic reference has locality" do
|
@@ -511,7 +548,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
511
548
|
== Bibliography
|
512
549
|
* [[[iso123,1]]] _Standard_
|
513
550
|
INPUT
|
514
|
-
expect(File.read("test.err"))
|
551
|
+
expect(File.read("test.err"))
|
552
|
+
.not_to include "undated reference [1] should not contain specific "\
|
553
|
+
"elements"
|
515
554
|
end
|
516
555
|
|
517
556
|
it "do not warn that undated IEV reference has locality" do
|
@@ -525,7 +564,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
525
564
|
== Normative References
|
526
565
|
* [[[iev,IEV]]] _Standard_
|
527
566
|
INPUT
|
528
|
-
expect(File.read("test.err"))
|
567
|
+
expect(File.read("test.err"))
|
568
|
+
.not_to include "undated reference IEV should not contain specific "\
|
569
|
+
"elements"
|
529
570
|
end
|
530
571
|
|
531
572
|
it "do not warn that in print has locality" do
|
@@ -539,7 +580,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
539
580
|
== Normative References
|
540
581
|
* [[[iev,ISO 123:--]]] _Standard_
|
541
582
|
INPUT
|
542
|
-
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"
|
543
586
|
end
|
544
587
|
|
545
588
|
it "warns of Non-reference in bibliography" do
|
@@ -560,7 +603,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
560
603
|
== Normative References
|
561
604
|
* [[[XYZ,IESO 121]]] _Standard_
|
562
605
|
INPUT
|
563
|
-
expect(File.read("test.err"))
|
606
|
+
expect(File.read("test.err"))
|
607
|
+
.to include "non-ISO/IEC reference not expected as normative"
|
564
608
|
end
|
565
609
|
|
566
610
|
it "warns that Scope contains subclauses" do
|
@@ -571,7 +615,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
571
615
|
|
572
616
|
=== Scope subclause
|
573
617
|
INPUT
|
574
|
-
expect(File.read("test.err"))
|
618
|
+
expect(File.read("test.err"))
|
619
|
+
.to include "Scope contains subclauses: should be succinct"
|
575
620
|
end
|
576
621
|
|
577
622
|
it "warns that Table should have title" do
|
@@ -602,7 +647,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
602
647
|
== Clause
|
603
648
|
ISO 12121
|
604
649
|
INPUT
|
605
|
-
expect(File.read("test.err"))
|
650
|
+
expect(File.read("test.err"))
|
651
|
+
.not_to include "number not broken up in threes"
|
606
652
|
end
|
607
653
|
|
608
654
|
it "Style warning if decimal point" do
|
@@ -642,7 +688,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
642
688
|
== Clause
|
643
689
|
95 ± 5 %
|
644
690
|
INPUT
|
645
|
-
expect(File.read("test.err"))
|
691
|
+
expect(File.read("test.err"))
|
692
|
+
.to include "unbracketed tolerance before percent sign"
|
646
693
|
end
|
647
694
|
|
648
695
|
it "Style warning if dots in abbreviation" do
|
@@ -682,7 +729,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
682
729
|
== Clause
|
683
730
|
5 °
|
684
731
|
INPUT
|
685
|
-
expect(File.read("test.err"))
|
732
|
+
expect(File.read("test.err"))
|
733
|
+
.to include "space between number and degrees/minutes/seconds"
|
686
734
|
end
|
687
735
|
|
688
736
|
it "Style warning if no space between number and SI unit" do
|
@@ -692,7 +740,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
692
740
|
== Clause
|
693
741
|
A measurement of 5Bq was taken.
|
694
742
|
INPUT
|
695
|
-
expect(File.read("test.err"))
|
743
|
+
expect(File.read("test.err"))
|
744
|
+
.to include "no space between number and SI unit"
|
696
745
|
end
|
697
746
|
|
698
747
|
it "Style warning if mins used" do
|
@@ -737,7 +786,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
737
786
|
|
738
787
|
== Symbols and Abbreviated Terms
|
739
788
|
INPUT
|
740
|
-
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"
|
741
792
|
end
|
742
793
|
|
743
794
|
it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" do
|
@@ -748,7 +799,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
748
799
|
|
749
800
|
Paragraph
|
750
801
|
INPUT
|
751
|
-
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"
|
752
805
|
end
|
753
806
|
|
754
807
|
it "Warning if missing foreword" do
|
@@ -759,7 +812,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
759
812
|
|
760
813
|
Paragraph
|
761
814
|
INPUT
|
762
|
-
expect(File.read("test.err"))
|
815
|
+
expect(File.read("test.err"))
|
816
|
+
.to include "Initial section must be (content) Foreword"
|
763
817
|
|
764
818
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
765
819
|
= Document title
|
@@ -773,7 +827,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
773
827
|
|
774
828
|
Paragraph
|
775
829
|
INPUT
|
776
|
-
expect(File.read("test.err"))
|
830
|
+
expect(File.read("test.err"))
|
831
|
+
.not_to include "Initial section must be (content) Foreword"
|
777
832
|
end
|
778
833
|
|
779
834
|
it "Warning if do not start with scope or introduction" do
|
@@ -785,7 +840,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
785
840
|
|
786
841
|
Paragraph
|
787
842
|
INPUT
|
788
|
-
expect(File.read("test.err"))
|
843
|
+
expect(File.read("test.err"))
|
844
|
+
.to include "Prefatory material must be followed by (clause) Scope"
|
789
845
|
|
790
846
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
791
847
|
= Document title
|
@@ -801,7 +857,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
801
857
|
|
802
858
|
Paragraph
|
803
859
|
INPUT
|
804
|
-
expect(File.read("test.err"))
|
860
|
+
expect(File.read("test.err"))
|
861
|
+
.not_to include "Prefatory material must be followed by (clause) Scope"
|
805
862
|
end
|
806
863
|
|
807
864
|
it "Warning if introduction not followed by scope" do
|
@@ -817,7 +874,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
817
874
|
|
818
875
|
Paragraph
|
819
876
|
INPUT
|
820
|
-
expect(File.read("test.err"))
|
877
|
+
expect(File.read("test.err"))
|
878
|
+
.to include "Prefatory material must be followed by (clause) Scope"
|
821
879
|
|
822
880
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
823
881
|
= Document title
|
@@ -836,7 +894,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
836
894
|
|
837
895
|
Paragraph
|
838
896
|
INPUT
|
839
|
-
expect(File.read("test.err"))
|
897
|
+
expect(File.read("test.err"))
|
898
|
+
.not_to include "Prefatory material must be followed by (clause) Scope"
|
840
899
|
end
|
841
900
|
|
842
901
|
it "Warning if normative references not followed by terms and definitions" do
|
@@ -855,7 +914,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
855
914
|
|
856
915
|
Paragraph
|
857
916
|
INPUT
|
858
|
-
expect(File.read("test.err"))
|
917
|
+
expect(File.read("test.err"))
|
918
|
+
.to include "Normative References must be followed by "\
|
919
|
+
"Terms and Definitions"
|
859
920
|
|
860
921
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
861
922
|
= Document title
|
@@ -877,7 +938,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
877
938
|
|
878
939
|
Paragraph
|
879
940
|
INPUT
|
880
|
-
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"
|
881
944
|
end
|
882
945
|
|
883
946
|
it "Warning if there are no clauses in the document" do
|
@@ -897,7 +960,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
897
960
|
== Symbols and Abbreviated Terms
|
898
961
|
|
899
962
|
INPUT
|
900
|
-
expect(File.read("test.err"))
|
963
|
+
expect(File.read("test.err"))
|
964
|
+
.to include "Document must contain at least one clause"
|
901
965
|
|
902
966
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
903
967
|
= Document title
|
@@ -920,7 +984,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
920
984
|
== Symbols and Abbreviated Terms
|
921
985
|
|
922
986
|
INPUT
|
923
|
-
expect(File.read("test.err"))
|
987
|
+
expect(File.read("test.err"))
|
988
|
+
.not_to include "Document must contain at least one clause"
|
924
989
|
end
|
925
990
|
|
926
991
|
it "Warning if scope occurs after Terms and Definitions" do
|
@@ -942,7 +1007,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
942
1007
|
== Scope
|
943
1008
|
|
944
1009
|
INPUT
|
945
|
-
expect(File.read("test.err"))
|
1010
|
+
expect(File.read("test.err"))
|
1011
|
+
.to include "Scope must occur before Terms and Definitions"
|
946
1012
|
|
947
1013
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
948
1014
|
= Document title
|
@@ -967,7 +1033,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
967
1033
|
== Scope
|
968
1034
|
|
969
1035
|
INPUT
|
970
|
-
expect(File.read("test.err"))
|
1036
|
+
expect(File.read("test.err"))
|
1037
|
+
.not_to include "Scope must occur before Terms and Definitions"
|
971
1038
|
end
|
972
1039
|
|
973
1040
|
it "Warning if Symbols and Abbreviated Terms does not occur immediately after Terms and Definitions" do
|
@@ -989,7 +1056,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
989
1056
|
== Symbols and Abbreviated Terms
|
990
1057
|
|
991
1058
|
INPUT
|
992
|
-
expect(File.read("test.err"))
|
1059
|
+
expect(File.read("test.err"))
|
1060
|
+
.to include "Only annexes and references can follow clauses"
|
993
1061
|
|
994
1062
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
995
1063
|
= Document title
|
@@ -1015,7 +1083,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1015
1083
|
== Symbols and Abbreviated Terms
|
1016
1084
|
|
1017
1085
|
INPUT
|
1018
|
-
expect(File.read("test.err"))
|
1086
|
+
expect(File.read("test.err"))
|
1087
|
+
.not_to include "Only annexes and references can follow clauses"
|
1019
1088
|
end
|
1020
1089
|
|
1021
1090
|
it "Warning if no normative references" do
|
@@ -1041,7 +1110,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1041
1110
|
== Appendix C
|
1042
1111
|
|
1043
1112
|
INPUT
|
1044
|
-
expect(File.read("test.err"))
|
1113
|
+
expect(File.read("test.err"))
|
1114
|
+
.to include "Document must include (references) Normative References"
|
1045
1115
|
|
1046
1116
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1047
1117
|
= Document title
|
@@ -1070,9 +1140,57 @@ RSpec.describe Asciidoctor::ISO do
|
|
1070
1140
|
== Appendix C
|
1071
1141
|
|
1072
1142
|
INPUT
|
1073
|
-
expect(File.read("test.err"))
|
1143
|
+
expect(File.read("test.err"))
|
1144
|
+
.not_to include "Document must include (references) Normative References"
|
1074
1145
|
end
|
1075
1146
|
|
1147
|
+
it "Warning if there are two Terms sections" do
|
1148
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1149
|
+
#{VALIDATING_BLANK_HDR}
|
1150
|
+
|
1151
|
+
== Scope
|
1152
|
+
|
1153
|
+
== Terms and definitions
|
1154
|
+
|
1155
|
+
== A Clause
|
1156
|
+
|
1157
|
+
[heading=terms and definitions]
|
1158
|
+
== Terms related to clinical psychology
|
1159
|
+
|
1160
|
+
INPUT
|
1161
|
+
expect(File.read("test.err"))
|
1162
|
+
.to include "Only annexes and references can follow clauses"
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
it "No warning if there are two Terms sections in a Vocabulary document" do
|
1166
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1167
|
+
= Document title
|
1168
|
+
Author
|
1169
|
+
:docfile: test.adoc
|
1170
|
+
:nodoc:
|
1171
|
+
:no-isobib:
|
1172
|
+
:docsubtype: vocabulary
|
1173
|
+
|
1174
|
+
== Scope
|
1175
|
+
|
1176
|
+
== Terms and definitions
|
1177
|
+
|
1178
|
+
== A Clause
|
1179
|
+
|
1180
|
+
[heading=terms and definitions]
|
1181
|
+
== Terms related to clinical psychology
|
1182
|
+
|
1183
|
+
[heading=symbols and abbreviated terms]
|
1184
|
+
== Symbols related to clinical psychology
|
1185
|
+
|
1186
|
+
INPUT
|
1187
|
+
expect(File.read("test.err"))
|
1188
|
+
.not_to include "Only annexes and references can follow clauses"
|
1189
|
+
expect(File.read("test.err"))
|
1190
|
+
.to include "Only terms, annexes and references can follow clauses"
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
|
1076
1194
|
it "Warning if final section is not named Bibliography" do
|
1077
1195
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1078
1196
|
#{VALIDATING_BLANK_HDR}
|
@@ -1102,7 +1220,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1102
1220
|
== Appendix C
|
1103
1221
|
|
1104
1222
|
INPUT
|
1105
|
-
expect(File.read("test.err"))
|
1223
|
+
expect(File.read("test.err"))
|
1224
|
+
.to include "There are sections after the final Bibliography"
|
1106
1225
|
|
1107
1226
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1108
1227
|
= Document title
|
@@ -1137,7 +1256,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1137
1256
|
== Appendix C
|
1138
1257
|
|
1139
1258
|
INPUT
|
1140
|
-
expect(File.read("test.err"))
|
1259
|
+
expect(File.read("test.err"))
|
1260
|
+
.not_to include "There are sections after the final Bibliography"
|
1141
1261
|
end
|
1142
1262
|
|
1143
1263
|
it "Warning if final section is not styled Bibliography" do
|
@@ -1165,7 +1285,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1165
1285
|
== Bibliography
|
1166
1286
|
|
1167
1287
|
INPUT
|
1168
|
-
expect(File.read("test.err"))
|
1288
|
+
expect(File.read("test.err"))
|
1289
|
+
.to include "Section not marked up as [bibliography]"
|
1169
1290
|
end
|
1170
1291
|
|
1171
1292
|
it "Warning if final section is not styled Bibliography false" do
|
@@ -1198,7 +1319,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1198
1319
|
== Bibliography
|
1199
1320
|
|
1200
1321
|
INPUT
|
1201
|
-
expect(File.read("test.err"))
|
1322
|
+
expect(File.read("test.err"))
|
1323
|
+
.not_to include "Section not marked up as [bibliography]"
|
1202
1324
|
end
|
1203
1325
|
|
1204
1326
|
it "Warning if English title intro and no French title intro" do
|
@@ -1280,7 +1402,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1280
1402
|
expect(File.read("test.err")).to include "No English Title Part"
|
1281
1403
|
end
|
1282
1404
|
|
1283
|
-
|
1405
|
+
it "No warning if French main title and English main title" do
|
1284
1406
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1285
1407
|
= Document title
|
1286
1408
|
Author
|
@@ -1307,7 +1429,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1307
1429
|
:no-isobib:
|
1308
1430
|
|
1309
1431
|
INPUT
|
1310
|
-
expect(File.read("test.err"))
|
1432
|
+
expect(File.read("test.err"))
|
1433
|
+
.to include "Subpart defined on non-IEC document"
|
1311
1434
|
end
|
1312
1435
|
|
1313
1436
|
it "No warning if joint IEC/non-IEC document with subpart" do
|
@@ -1322,7 +1445,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1322
1445
|
:no-isobib:
|
1323
1446
|
|
1324
1447
|
INPUT
|
1325
|
-
expect(File.read("test.err"))
|
1448
|
+
expect(File.read("test.err"))
|
1449
|
+
.not_to include "Subpart defined on non-IEC document"
|
1326
1450
|
end
|
1327
1451
|
|
1328
1452
|
it "Warning if main title contains document type" do
|
@@ -1348,7 +1472,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1348
1472
|
:no-isobib:
|
1349
1473
|
|
1350
1474
|
INPUT
|
1351
|
-
expect(File.read("test.err"))
|
1475
|
+
expect(File.read("test.err"))
|
1476
|
+
.to include "Title Intro may name document type"
|
1352
1477
|
end
|
1353
1478
|
|
1354
1479
|
it "Each first-level subclause must have a title" do
|
@@ -1358,7 +1483,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1358
1483
|
|
1359
1484
|
=== {blank}
|
1360
1485
|
INPUT
|
1361
|
-
expect(File.read("test.err"))
|
1486
|
+
expect(File.read("test.err"))
|
1487
|
+
.to include "each first-level subclause must have a title"
|
1362
1488
|
end
|
1363
1489
|
|
1364
1490
|
it "All subclauses must have a title, or none" do
|
@@ -1372,7 +1498,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1372
1498
|
|
1373
1499
|
==== Subsubclause
|
1374
1500
|
INPUT
|
1375
|
-
expect(File.read("test.err"))
|
1501
|
+
expect(File.read("test.err"))
|
1502
|
+
.to include "all subclauses must have a title, or none"
|
1376
1503
|
end
|
1377
1504
|
|
1378
1505
|
it "Warning if subclause is only child of its parent, or none" do
|
@@ -1434,7 +1561,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1434
1561
|
== Clause
|
1435
1562
|
See <<terms>>
|
1436
1563
|
INPUT
|
1437
|
-
expect(File.read("test.err"))
|
1564
|
+
expect(File.read("test.err"))
|
1565
|
+
.to include "'see terms' is pointing to a normative section"
|
1438
1566
|
end
|
1439
1567
|
|
1440
1568
|
it "Warning if 'see' reference points to normative reference" do
|
@@ -1447,7 +1575,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1447
1575
|
== Clause
|
1448
1576
|
See <<terms>>
|
1449
1577
|
INPUT
|
1450
|
-
expect(File.read("test.err"))
|
1578
|
+
expect(File.read("test.err"))
|
1579
|
+
.to include "is pointing to a normative reference"
|
1451
1580
|
end
|
1452
1581
|
|
1453
1582
|
it "Warning if term definition starts with article" do
|
@@ -1459,7 +1588,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1459
1588
|
|
1460
1589
|
The definition of a term is a part of the specialized vocabulary of a particular field
|
1461
1590
|
INPUT
|
1462
|
-
expect(File.read("test.err"))
|
1591
|
+
expect(File.read("test.err"))
|
1592
|
+
.to include "term definition starts with article"
|
1463
1593
|
end
|
1464
1594
|
|
1465
1595
|
it "Warning if term definition ends with period" do
|
@@ -1481,7 +1611,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1481
1611
|
[align=mid-air]
|
1482
1612
|
Para
|
1483
1613
|
INPUT
|
1484
|
-
expect(File.read("test.err"))
|
1614
|
+
expect(File.read("test.err"))
|
1615
|
+
.to include 'value of attribute "align" is invalid; must be equal to'
|
1485
1616
|
end
|
1486
1617
|
|
1487
1618
|
it "Warn if more than 7 levels of subclause" do
|
@@ -1513,7 +1644,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1513
1644
|
====== Clause
|
1514
1645
|
|
1515
1646
|
INPUT
|
1516
|
-
expect(File.read("test.err"))
|
1647
|
+
expect(File.read("test.err"))
|
1648
|
+
.to include "Exceeds the maximum clause depth of 7"
|
1517
1649
|
end
|
1518
1650
|
|
1519
1651
|
it "Do not warn if not more than 7 levels of subclause" do
|
@@ -1542,7 +1674,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1542
1674
|
====== Clause
|
1543
1675
|
|
1544
1676
|
INPUT
|
1545
|
-
expect(File.read("test.err"))
|
1677
|
+
expect(File.read("test.err"))
|
1678
|
+
.not_to include "exceeds the maximum clause depth of 7"
|
1546
1679
|
end
|
1547
1680
|
|
1548
1681
|
it "Warn if term citation in Terms & Definitions not preceded with italicised term" do
|
@@ -1555,7 +1688,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1555
1688
|
|
1556
1689
|
The definition of a term (<<term>>) is a part of the specialized vocabulary of a particular field
|
1557
1690
|
INPUT
|
1558
|
-
expect(File.read("test.err"))
|
1691
|
+
expect(File.read("test.err"))
|
1692
|
+
.to include "term citation not preceded with italicised term"
|
1559
1693
|
end
|
1560
1694
|
|
1561
1695
|
it "Warn if an undated reference has no associated footnote" do
|
@@ -1566,7 +1700,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
1566
1700
|
== Bibliography
|
1567
1701
|
* [[[ISO8,ISO 8:--]]], _Title_
|
1568
1702
|
INPUT
|
1569
|
-
expect(File.read("test.err"))
|
1570
|
-
"Reference ISO8 does not have an associated footnote
|
1703
|
+
expect(File.read("test.err"))
|
1704
|
+
.to include "Reference ISO8 does not have an associated footnote "\
|
1705
|
+
"indicating unpublished status"
|
1571
1706
|
end
|
1572
1707
|
end
|