metanorma-iso 1.9.6 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +41 -0
- data/Gemfile +3 -4
- data/Makefile +44 -0
- data/Rakefile +1 -1
- data/bin/rspec +1 -2
- data/lib/asciidoctor/iso/cleanup.rb +7 -6
- data/lib/asciidoctor/iso/front.rb +2 -2
- data/lib/asciidoctor/iso/isodoc.rng +254 -27
- data/lib/asciidoctor/iso/section.rb +1 -1
- data/lib/asciidoctor/iso/validate.rb +7 -7
- data/lib/asciidoctor/iso/validate_section.rb +1 -1
- data/lib/isodoc/iso/html/isodoc.css +0 -1
- data/lib/isodoc/iso/html/isodoc.scss +0 -1
- data/lib/isodoc/iso/html/style-human.css +0 -1
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +0 -1
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/i18n.rb +10 -9
- data/lib/isodoc/iso/iso.amendment.xsl +57 -17
- data/lib/isodoc/iso/iso.international-standard.xsl +57 -17
- data/lib/isodoc/iso/isosts_convert.rb +6 -2
- data/lib/isodoc/iso/presentation_xml_convert.rb +19 -9
- data/lib/isodoc/iso/sections.rb +2 -0
- data/lib/isodoc/iso/sts_convert.rb +5 -2
- data/lib/isodoc/iso/word_cleanup.rb +94 -0
- data/lib/isodoc/iso/word_convert.rb +12 -89
- data/lib/metanorma/iso/processor.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -5
- data/spec/asciidoctor/base_spec.rb +543 -209
- data/spec/asciidoctor/blocks_spec.rb +22 -47
- data/spec/asciidoctor/cleanup_spec.rb +37 -20
- data/spec/asciidoctor/inline_spec.rb +10 -2
- data/spec/asciidoctor/refs_spec.rb +174 -88
- data/spec/asciidoctor/section_spec.rb +3 -3
- data/spec/isodoc/i18n_spec.rb +36 -22
- data/spec/isodoc/inline_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +4 -4
- data/spec/isodoc/table_spec.rb +6 -8
- data/spec/isodoc/terms_spec.rb +25 -25
- data/spec/isodoc/xref_spec.rb +1397 -1376
- data/spec/metanorma/processor_spec.rb +114 -15
- data/spec/spec_helper.rb +2 -1
- data/spec/vcr_cassettes/docrels.yml +427 -37
- data/spec/vcr_cassettes/sortrefs.yml +599 -0
- metadata +13 -24
@@ -133,7 +133,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
133
133
|
<p id="foreword">Foreword</p>
|
134
134
|
<review date="20170101T00:00:00Z" from="foreword" id="_" reviewer="ISO" to="foreword">
|
135
135
|
<p id="_">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
136
|
-
<p id="_">For further information on the Foreword, see
|
136
|
+
<p id="_">For further information on the Foreword, see
|
137
137
|
<strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p>
|
138
138
|
</review>
|
139
139
|
</sections>
|
@@ -158,9 +158,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
158
158
|
<sections>
|
159
159
|
<terms id="_" obligation="normative">
|
160
160
|
<title>Terms and definitions</title>
|
161
|
-
#{TERM_BOILERPLATE}
|
161
|
+
#{TERM_BOILERPLATE}
|
162
162
|
<term id="term-term1">
|
163
|
-
<preferred>Term1</preferred>
|
163
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
164
164
|
<termnote id="_">
|
165
165
|
<p id="_">This is a note</p></termnote>
|
166
166
|
</term>
|
@@ -283,7 +283,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
283
283
|
<title>Terms and definitions</title>
|
284
284
|
#{TERM_BOILERPLATE}
|
285
285
|
<term id="term-term1">
|
286
|
-
<preferred>Term1</preferred>
|
286
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
287
287
|
<termexample id="_">
|
288
288
|
<p id="_">This is an example</p></termexample>
|
289
289
|
</term>
|
@@ -521,6 +521,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
521
521
|
|
522
522
|
=== Term1
|
523
523
|
|
524
|
+
Definition
|
525
|
+
|
524
526
|
[.source]
|
525
527
|
<<ISO2191,section=1>>
|
526
528
|
INPUT
|
@@ -531,8 +533,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
531
533
|
<title>Terms and definitions</title>
|
532
534
|
#{TERM_BOILERPLATE}
|
533
535
|
<term id="term-term1">
|
534
|
-
<preferred>Term1</preferred>
|
535
|
-
|
536
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
537
|
+
<definition>
|
538
|
+
<verbal-definition>
|
539
|
+
<p id='_'>Definition</p>
|
540
|
+
</verbal-definition>
|
541
|
+
</definition>
|
542
|
+
<termsource status='identical' type='authoritative'>
|
536
543
|
<origin bibitemid="ISO2191" citeas="" type="inline">
|
537
544
|
<localityStack>
|
538
545
|
<locality type="section">
|
@@ -556,6 +563,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
556
563
|
|
557
564
|
=== Term1
|
558
565
|
|
566
|
+
Definition
|
567
|
+
|
559
568
|
[.source]
|
560
569
|
<<ISO2191,section=1>>, with adjustments
|
561
570
|
INPUT
|
@@ -566,8 +575,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
566
575
|
<title>Terms and definitions</title>
|
567
576
|
#{TERM_BOILERPLATE}
|
568
577
|
<term id="term-term1">
|
569
|
-
<preferred>Term1</preferred>
|
570
|
-
|
578
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
579
|
+
<definition>
|
580
|
+
<verbal-definition>
|
581
|
+
<p id='_'>Definition</p>
|
582
|
+
</verbal-definition>
|
583
|
+
</definition>
|
584
|
+
<termsource status='modified' type='authoritative'>
|
571
585
|
<origin bibitemid="ISO2191" citeas="" type="inline">
|
572
586
|
<localityStack>
|
573
587
|
<locality type="section">
|
@@ -586,43 +600,4 @@ RSpec.describe Asciidoctor::ISO do
|
|
586
600
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
587
601
|
.to be_equivalent_to xmlpp(output)
|
588
602
|
end
|
589
|
-
|
590
|
-
it "processes nested terms" do
|
591
|
-
input = <<~INPUT
|
592
|
-
#{ASCIIDOC_BLANK_HDR}
|
593
|
-
== Terms and Definitions
|
594
|
-
|
595
|
-
[.term]
|
596
|
-
=== Term1
|
597
|
-
|
598
|
-
definition
|
599
|
-
|
600
|
-
==== Term11
|
601
|
-
definition2
|
602
|
-
INPUT
|
603
|
-
output = <<~OUTPUT
|
604
|
-
#{BLANK_HDR}
|
605
|
-
<sections>
|
606
|
-
<terms id='_' obligation='normative'>
|
607
|
-
<title>Terms and definitions</title>
|
608
|
-
#{TERM_BOILERPLATE}
|
609
|
-
<term id='term-term1'>
|
610
|
-
<preferred>Term1</preferred>
|
611
|
-
<definition>
|
612
|
-
<p id='_'>definition</p>
|
613
|
-
</definition>
|
614
|
-
<term id='term-term11'>
|
615
|
-
<preferred>Term11</preferred>
|
616
|
-
<definition>
|
617
|
-
<p id='_'>definition2</p>
|
618
|
-
</definition>
|
619
|
-
</term>
|
620
|
-
</term>
|
621
|
-
</terms>
|
622
|
-
</sections>
|
623
|
-
</iso-standard>
|
624
|
-
OUTPUT
|
625
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
626
|
-
.to be_equivalent_to xmlpp(output)
|
627
|
-
end
|
628
603
|
end
|
@@ -36,6 +36,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
36
36
|
#{TERM_BOILERPLATE}
|
37
37
|
<term id="term-t90">
|
38
38
|
<preferred>
|
39
|
+
<letter-symbol><name>
|
39
40
|
<stem type="MathML">
|
40
41
|
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
41
42
|
<msub>
|
@@ -47,8 +48,10 @@ RSpec.describe Asciidoctor::ISO do
|
|
47
48
|
</msub>
|
48
49
|
</math>
|
49
50
|
</stem>
|
51
|
+
</name></letter-symbol>
|
50
52
|
</preferred>
|
51
53
|
<admitted>
|
54
|
+
<letter-symbol><name>
|
52
55
|
<stem type="MathML">
|
53
56
|
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
54
57
|
<msub>
|
@@ -61,10 +64,11 @@ RSpec.describe Asciidoctor::ISO do
|
|
61
64
|
</msub>
|
62
65
|
</math>
|
63
66
|
</stem>
|
67
|
+
</name></letter-symbol>
|
64
68
|
</admitted>
|
65
|
-
<definition>
|
69
|
+
<definition><verbal-definition>
|
66
70
|
<p id="_">Time</p>
|
67
|
-
</definition>
|
71
|
+
</verbal-definition></definition>
|
68
72
|
</term>
|
69
73
|
</terms>
|
70
74
|
</sections>
|
@@ -90,10 +94,10 @@ RSpec.describe Asciidoctor::ISO do
|
|
90
94
|
<title>Terms and definitions</title>#{TERM_BOILERPLATE}
|
91
95
|
|
92
96
|
<term id="term-tempus">
|
93
|
-
<preferred>Tempus</preferred>
|
97
|
+
<preferred><expression><name>Tempus</name></expression></preferred>
|
94
98
|
<domain>relativity</domain>
|
95
|
-
<definition>
|
96
|
-
<p id="_">Time</p></definition>
|
99
|
+
<definition><verbal-definition>
|
100
|
+
<p id="_">Time</p></verbal-definition></definition>
|
97
101
|
</term>
|
98
102
|
</terms>
|
99
103
|
</sections>
|
@@ -117,12 +121,15 @@ RSpec.describe Asciidoctor::ISO do
|
|
117
121
|
|
118
122
|
=== stem:[t_90]
|
119
123
|
|
124
|
+
[.definition]
|
125
|
+
--
|
120
126
|
[stem]
|
121
127
|
++++
|
122
128
|
t_A
|
123
129
|
++++
|
124
130
|
|
125
131
|
This paragraph is extraneous
|
132
|
+
--
|
126
133
|
INPUT
|
127
134
|
output = <<~OUTPUT
|
128
135
|
#{BLANK_HDR}
|
@@ -130,8 +137,9 @@ RSpec.describe Asciidoctor::ISO do
|
|
130
137
|
<terms id="_" obligation="normative">
|
131
138
|
<title>Terms and definitions</title>
|
132
139
|
#{TERM_BOILERPLATE}
|
133
|
-
<term id="term-t90">
|
140
|
+
<term id="term-_-t90-">
|
134
141
|
<preferred>
|
142
|
+
<letter-symbol><name>
|
135
143
|
<stem type="MathML">
|
136
144
|
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
137
145
|
<msub>
|
@@ -143,8 +151,10 @@ RSpec.describe Asciidoctor::ISO do
|
|
143
151
|
</msub>
|
144
152
|
</math>
|
145
153
|
</stem>
|
154
|
+
</name></letter-symbol>
|
146
155
|
</preferred>
|
147
156
|
<definition>
|
157
|
+
<verbal-definition>
|
148
158
|
<formula id="_">
|
149
159
|
<stem type="MathML">
|
150
160
|
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
@@ -159,7 +169,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
159
169
|
</math>
|
160
170
|
</stem>
|
161
171
|
</formula>
|
162
|
-
<p id="_">This paragraph is extraneous</p>
|
172
|
+
<p id="_">This paragraph is extraneous</p></verbal-definition>
|
163
173
|
</definition>
|
164
174
|
</term>
|
165
175
|
</terms>
|
@@ -195,10 +205,10 @@ RSpec.describe Asciidoctor::ISO do
|
|
195
205
|
<p id="_">So am I</p></li>
|
196
206
|
</ul>
|
197
207
|
<term id="term-time">
|
198
|
-
<preferred>Time</preferred>
|
199
|
-
<definition>
|
208
|
+
<preferred><expression><name>Time</name></expression></preferred>
|
209
|
+
<definition><verbal-definition>
|
200
210
|
<p id="_">This paragraph is extraneous</p>
|
201
|
-
</definition>
|
211
|
+
</verbal-definition></definition>
|
202
212
|
</term>
|
203
213
|
</terms>
|
204
214
|
</sections>
|
@@ -433,6 +443,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
433
443
|
|
434
444
|
=== Term1
|
435
445
|
|
446
|
+
Definition
|
447
|
+
|
436
448
|
[.source]
|
437
449
|
<<ISO2191,section=1>>
|
438
450
|
INPUT
|
@@ -443,8 +455,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
443
455
|
<title>Terms and definitions</title>
|
444
456
|
#{TERM_BOILERPLATE}
|
445
457
|
<term id="term-term1">
|
446
|
-
<preferred>Term1</preferred>
|
447
|
-
|
458
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
459
|
+
<definition>
|
460
|
+
<verbal-definition>
|
461
|
+
<p id='_'>Definition</p>
|
462
|
+
</verbal-definition>
|
463
|
+
</definition>
|
464
|
+
<termsource status='identical' type='authoritative'>
|
448
465
|
<origin bibitemid="ISO2191" citeas="" type="inline">
|
449
466
|
<localityStack>
|
450
467
|
<locality type="section">
|
@@ -1241,7 +1258,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1241
1258
|
</li>
|
1242
1259
|
</ul>
|
1243
1260
|
<term id='term-term1'>
|
1244
|
-
<preferred>Term1</preferred>
|
1261
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1245
1262
|
</term>
|
1246
1263
|
</terms>
|
1247
1264
|
</sections>
|
@@ -1292,13 +1309,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
1292
1309
|
<terms id='_' obligation='normative'>
|
1293
1310
|
<title>Normal Terms</title>
|
1294
1311
|
<term id='term-term1'>
|
1295
|
-
<preferred>Term1</preferred>
|
1312
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1296
1313
|
</term>
|
1297
1314
|
</terms>
|
1298
1315
|
<terms id='_' obligation='normative'>
|
1299
1316
|
<title>Abnormal terms</title>
|
1300
1317
|
<term id='term-term-2'>
|
1301
|
-
<preferred>Term 2</preferred>
|
1318
|
+
<preferred><expression><name>Term 2</name></expression></preferred>
|
1302
1319
|
</term>
|
1303
1320
|
</terms>
|
1304
1321
|
</clause>
|
@@ -1356,13 +1373,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
1356
1373
|
<terms id='_' obligation='normative'>
|
1357
1374
|
<title>Normal Terms</title>
|
1358
1375
|
<term id='term-term1'>
|
1359
|
-
<preferred>Term1</preferred>
|
1376
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1360
1377
|
</term>
|
1361
1378
|
</terms>
|
1362
1379
|
<terms id='_' obligation='normative'>
|
1363
1380
|
<title>Abnormal terms</title>
|
1364
1381
|
<term id='term-term-2'>
|
1365
|
-
<preferred>Term 2</preferred>
|
1382
|
+
<preferred><expression><name>Term 2</name></expression></preferred>
|
1366
1383
|
</term>
|
1367
1384
|
</terms>
|
1368
1385
|
</clause>
|
@@ -1421,13 +1438,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
1421
1438
|
</li>
|
1422
1439
|
</ul>
|
1423
1440
|
<term id='term-term1'>
|
1424
|
-
<preferred>Term1</preferred>
|
1441
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1425
1442
|
</term>
|
1426
1443
|
</terms>
|
1427
1444
|
<terms id='_' obligation='normative'>
|
1428
1445
|
<title>Other Terms</title>
|
1429
1446
|
<term id='term-term-2'>
|
1430
|
-
<preferred>Term 2</preferred>
|
1447
|
+
<preferred><expression><name>Term 2</name></expression></preferred>
|
1431
1448
|
</term>
|
1432
1449
|
</terms>
|
1433
1450
|
<definitions id='_' obligation='normative'>
|
@@ -1479,7 +1496,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1479
1496
|
</li>
|
1480
1497
|
</ul>
|
1481
1498
|
<term id='term-term1'>
|
1482
|
-
<preferred>Term1</preferred>
|
1499
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1483
1500
|
</term>
|
1484
1501
|
</terms>
|
1485
1502
|
</sections>
|
@@ -56,8 +56,16 @@ RSpec.describe Asciidoctor::ISO do
|
|
56
56
|
</msub>
|
57
57
|
</math>
|
58
58
|
</stem>
|
59
|
-
<admitted>
|
60
|
-
|
59
|
+
<admitted>
|
60
|
+
<expression>
|
61
|
+
<name>alt</name>
|
62
|
+
</expression>
|
63
|
+
</admitted>
|
64
|
+
<deprecates>
|
65
|
+
<expression>
|
66
|
+
<name>deprecated</name>
|
67
|
+
</expression>
|
68
|
+
</deprecates>
|
61
69
|
<domain>domain</domain>
|
62
70
|
<strike>strike</strike>
|
63
71
|
<smallcap>smallcap</smallcap>
|