metanorma-standoc 2.0.6 → 2.0.7
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.
- checksums.yaml +4 -4
- data/lib/asciidoctor/standoc/base.rb +0 -1
- data/lib/asciidoctor/standoc/blocks.rb +0 -1
- data/lib/asciidoctor/standoc/blocks_notes.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_amend.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_block.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_image.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_inline.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_maths.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_section.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_symbols.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_table.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_terms.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_text.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_toc.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_xref.rb +0 -1
- data/lib/asciidoctor/standoc/converter.rb +0 -1
- data/lib/asciidoctor/standoc/deprecated.rb +4 -2
- data/lib/asciidoctor/standoc/front.rb +0 -1
- data/lib/asciidoctor/standoc/front_contributor.rb +0 -1
- data/lib/asciidoctor/standoc/inline.rb +0 -1
- data/lib/asciidoctor/standoc/lists.rb +0 -1
- data/lib/asciidoctor/standoc/macros.rb +0 -1
- data/lib/asciidoctor/standoc/macros_form.rb +0 -1
- data/lib/asciidoctor/standoc/macros_note.rb +0 -1
- data/lib/asciidoctor/standoc/macros_plantuml.rb +0 -1
- data/lib/asciidoctor/standoc/macros_terms.rb +0 -1
- data/lib/asciidoctor/standoc/render.rb +0 -1
- data/lib/asciidoctor/standoc/reqt.rb +0 -1
- data/lib/asciidoctor/standoc/section.rb +0 -1
- data/lib/asciidoctor/standoc/table.rb +0 -1
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +0 -1
- data/lib/asciidoctor/standoc/terms.rb +0 -1
- data/lib/asciidoctor/standoc/utils.rb +0 -1
- data/lib/asciidoctor/standoc/validate.rb +0 -1
- data/lib/asciidoctor/standoc/validate_section.rb +0 -1
- data/lib/isodoc/pdf_convert.rb +2 -3
- data/lib/metanorma/standoc/biblio.rng +25 -2
- data/lib/metanorma/standoc/blocks.rb +10 -0
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +15 -7
- data/lib/metanorma/standoc/cleanup_ref.rb +2 -4
- data/lib/metanorma/standoc/cleanup_xref.rb +3 -4
- data/lib/metanorma/standoc/inline.rb +11 -8
- data/lib/metanorma/standoc/macros_embed.rb +1 -3
- data/lib/metanorma/standoc/macros_terms.rb +1 -1
- data/lib/metanorma/standoc/processor.rb +2 -1
- data/lib/metanorma/standoc/ref.rb +4 -4
- data/lib/metanorma/standoc/render.rb +6 -1
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +2 -0
- data/spec/assets/iso.adoc +10 -0
- data/spec/metanorma/blocks_spec.rb +113 -72
- data/spec/metanorma/cleanup_sections_spec.rb +6 -6
- data/spec/metanorma/cleanup_spec.rb +5 -5
- data/spec/metanorma/cleanup_terms_spec.rb +93 -19
- data/spec/metanorma/inline_spec.rb +1 -1
- data/spec/metanorma/macros_spec.rb +216 -45
- data/spec/metanorma/refs_dl_spec.rb +11 -6
- data/spec/metanorma/section_spec.rb +15 -15
- data/spec/metanorma/table_spec.rb +339 -342
- data/spec/spec_helper.rb +2 -5
- metadata +17 -2
@@ -352,7 +352,7 @@ RSpec.describe Metanorma::Standoc do
|
|
352
352
|
<terms id='_' obligation='normative'>
|
353
353
|
<title>Terms and definitions</title>
|
354
354
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
355
|
-
<term id='term-
|
355
|
+
<term id='term-Term1'>
|
356
356
|
<preferred><expression><name>Term1</name></expression></preferred>
|
357
357
|
<definition>
|
358
358
|
<verbal-definition>
|
@@ -423,7 +423,7 @@ RSpec.describe Metanorma::Standoc do
|
|
423
423
|
<terms id="_" obligation="normative">
|
424
424
|
<title>Terms and definitions</title>
|
425
425
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
426
|
-
<term id="term-
|
426
|
+
<term id="term-Term1">
|
427
427
|
<preferred><expression><name>Term1</name></expression></preferred>
|
428
428
|
<termnote id="_">
|
429
429
|
<p id="_">This is a note</p>
|
@@ -498,7 +498,7 @@ RSpec.describe Metanorma::Standoc do
|
|
498
498
|
<sections>
|
499
499
|
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
500
500
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
501
|
-
<term id="term-
|
501
|
+
<term id="term-Term1">
|
502
502
|
<preferred><expression><name>Term1</name></expression></preferred>
|
503
503
|
</term>
|
504
504
|
<definitions id="_" obligation="normative" type="symbols">
|
@@ -543,7 +543,7 @@ RSpec.describe Metanorma::Standoc do
|
|
543
543
|
<note id='_'>
|
544
544
|
<p id='_'>Note 1</p>
|
545
545
|
</note>
|
546
|
-
<term id='term-
|
546
|
+
<term id='term-Term11'>
|
547
547
|
<preferred>
|
548
548
|
<expression>
|
549
549
|
<name>Term11</name>
|
@@ -709,7 +709,7 @@ RSpec.describe Metanorma::Standoc do
|
|
709
709
|
<terms id="_" obligation="normative">
|
710
710
|
<title>Terms and definitions</title>
|
711
711
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
712
|
-
<term id="term-
|
712
|
+
<term id="term-Term1">
|
713
713
|
<preferred><expression><name>Term1</name></expression></preferred>
|
714
714
|
<termexample id="ABC" tag='X' multilingual-rendering='common'>
|
715
715
|
<p id="_">This is an example</p>
|
@@ -769,7 +769,7 @@ RSpec.describe Metanorma::Standoc do
|
|
769
769
|
#{BLANK_HDR}
|
770
770
|
<sections>
|
771
771
|
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
772
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-
|
772
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-Term1">
|
773
773
|
<preferred><expression><name>Term1</name></expression></preferred>
|
774
774
|
</term>
|
775
775
|
<definitions id="_" obligation="normative" type="symbols">
|
@@ -948,6 +948,48 @@ RSpec.describe Metanorma::Standoc do
|
|
948
948
|
.to be_equivalent_to xmlpp(output)
|
949
949
|
end
|
950
950
|
|
951
|
+
it "processes figures marked up as examples" do
|
952
|
+
input = <<~INPUT
|
953
|
+
#{ASCIIDOC_BLANK_HDR}
|
954
|
+
[[figureC-2]]
|
955
|
+
[.figure]
|
956
|
+
.Stages of gelatinization
|
957
|
+
====
|
958
|
+
.Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)
|
959
|
+
image::spec/examples/rice_images/rice_image3_1.png[]
|
960
|
+
|
961
|
+
Text
|
962
|
+
|
963
|
+
.Intermediate stages: Some fully gelatinized kernels are visible
|
964
|
+
image::spec/examples/rice_images/rice_image3_2.png[]
|
965
|
+
|
966
|
+
.Final stages: All kernels are fully gelatinized
|
967
|
+
image::spec/examples/rice_images/rice_image3_3.png[]
|
968
|
+
====
|
969
|
+
INPUT
|
970
|
+
output = <<~OUTPUT
|
971
|
+
#{BLANK_HDR}
|
972
|
+
<sections>
|
973
|
+
<figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
|
974
|
+
<name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
|
975
|
+
<image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
976
|
+
</figure>
|
977
|
+
<p id="_">Text</p>
|
978
|
+
<figure id="_">
|
979
|
+
<name>Intermediate stages: Some fully gelatinized kernels are visible</name>
|
980
|
+
<image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
981
|
+
</figure>
|
982
|
+
<figure id="_">
|
983
|
+
<name>Final stages: All kernels are fully gelatinized</name>
|
984
|
+
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
985
|
+
</figure></figure>
|
986
|
+
</sections>
|
987
|
+
</standard-document>
|
988
|
+
OUTPUT
|
989
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
990
|
+
.to be_equivalent_to xmlpp(output)
|
991
|
+
end
|
992
|
+
|
951
993
|
it "processes images" do
|
952
994
|
input = <<~INPUT
|
953
995
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1252,7 +1294,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1252
1294
|
<terms id="_" obligation="normative">
|
1253
1295
|
<title>Terms and definitions</title><p id="_">For the purposes of this document,
|
1254
1296
|
the following terms and definitions apply.</p>
|
1255
|
-
<term id="term-
|
1297
|
+
<term id="term-Term1">
|
1256
1298
|
<preferred><expression><name>Term1</name></expression></preferred>
|
1257
1299
|
<definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
|
1258
1300
|
<termsource status="identical" type="authoritative">
|
@@ -1270,7 +1312,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1270
1312
|
</origin>
|
1271
1313
|
</termsource>
|
1272
1314
|
</term>
|
1273
|
-
<term id='term-
|
1315
|
+
<term id='term-Term2'>
|
1274
1316
|
<preferred><expression><name>Term2</name></expression></preferred>
|
1275
1317
|
<definition>
|
1276
1318
|
<verbal-definition>
|
@@ -1327,7 +1369,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1327
1369
|
<title>Terms and definitions</title>
|
1328
1370
|
<p id="_">For the purposes of this document,
|
1329
1371
|
the following terms and definitions apply.</p>
|
1330
|
-
<term id="term-
|
1372
|
+
<term id="term-Term1">
|
1331
1373
|
<preferred><expression><name>Term1</name></expression></preferred>
|
1332
1374
|
<definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
|
1333
1375
|
<termsource status="modified" type="authoritative">
|
@@ -1341,7 +1383,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1341
1383
|
</modification>
|
1342
1384
|
</termsource>
|
1343
1385
|
</term>
|
1344
|
-
<term id='term-
|
1386
|
+
<term id='term-Term2'>
|
1345
1387
|
<preferred><expression><name>Term2</name></expression></preferred>
|
1346
1388
|
<definition><verbal-definition>
|
1347
1389
|
<p id='_'>Definition</p>
|
@@ -1363,8 +1405,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1363
1405
|
.to be_equivalent_to xmlpp(output)
|
1364
1406
|
end
|
1365
1407
|
|
1366
|
-
|
1367
|
-
it "processes term source attributes" do
|
1408
|
+
it "processes term source attributes" do
|
1368
1409
|
input = <<~INPUT
|
1369
1410
|
#{ASCIIDOC_BLANK_HDR}
|
1370
1411
|
== Terms and Definitions
|
@@ -1384,53 +1425,53 @@ RSpec.describe Metanorma::Standoc do
|
|
1384
1425
|
{{<<IEV:xyz>>}}, with adjustments
|
1385
1426
|
INPUT
|
1386
1427
|
output = <<~OUTPUT
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
OUTPUT
|
1428
|
+
#{BLANK_HDR}
|
1429
|
+
<sections>
|
1430
|
+
<terms id='_' obligation='normative'>
|
1431
|
+
<title>Terms and definitions</title>
|
1432
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1433
|
+
<term id='term-Term1'>
|
1434
|
+
<preferred>
|
1435
|
+
<expression>
|
1436
|
+
<name>Term1</name>
|
1437
|
+
</expression>
|
1438
|
+
</preferred>
|
1439
|
+
<definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
|
1440
|
+
<termsource status='generalisation' type='authoritative'>
|
1441
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
1442
|
+
<localityStack>
|
1443
|
+
<locality type='section'>
|
1444
|
+
<referenceFrom>1</referenceFrom>
|
1445
|
+
</locality>
|
1446
|
+
</localityStack>
|
1447
|
+
</origin>
|
1448
|
+
<modification>
|
1449
|
+
<p id='_'>with adjustments</p>
|
1450
|
+
</modification>
|
1451
|
+
</termsource>
|
1452
|
+
</term>
|
1453
|
+
<term id='term-Term2'>
|
1454
|
+
<preferred>
|
1455
|
+
<expression>
|
1456
|
+
<name>Term2</name>
|
1457
|
+
</expression>
|
1458
|
+
</preferred>
|
1459
|
+
<definition><verbal-definition>
|
1460
|
+
<p id='_'>Definition</p>
|
1461
|
+
</verbal-definition></definition>
|
1462
|
+
<termsource status='modified' type='lineage'>
|
1463
|
+
<origin citeas=''>
|
1464
|
+
<termref base='IEV' target='xyz'/>
|
1465
|
+
</origin>
|
1466
|
+
<modification>
|
1467
|
+
<p id='_'>with adjustments</p>
|
1468
|
+
</modification>
|
1469
|
+
</termsource>
|
1470
|
+
</term>
|
1471
|
+
</terms>
|
1472
|
+
</sections>
|
1473
|
+
</standard-document>
|
1474
|
+
OUTPUT
|
1434
1475
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1435
1476
|
.to be_equivalent_to xmlpp(output)
|
1436
1477
|
end
|
@@ -1444,19 +1485,19 @@ OUTPUT
|
|
1444
1485
|
====
|
1445
1486
|
INPUT
|
1446
1487
|
output = <<~"OUTPUT"
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1488
|
+
#{BLANK_HDR}
|
1489
|
+
<sections>
|
1490
|
+
<recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
|
1491
|
+
<label>/ogc/recommendation/wfs/2</label>
|
1492
|
+
<subject>user</subject>
|
1493
|
+
<subject>developer, implementer</subject>
|
1494
|
+
<inherit>/ss/584/2015/level/1</inherit>
|
1495
|
+
<inherit>/ss/584/2015/level/2</inherit>
|
1496
|
+
<description><p id="_">I recommend this</p>
|
1497
|
+
</description>
|
1498
|
+
</recommendation>
|
1499
|
+
</sections>
|
1500
|
+
</standard-document>
|
1460
1501
|
OUTPUT
|
1461
1502
|
|
1462
1503
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
@@ -27,7 +27,7 @@ RSpec.describe Metanorma::Standoc do
|
|
27
27
|
<p id='_'>So am I</p>
|
28
28
|
</li>
|
29
29
|
</ul>
|
30
|
-
<term id="term-
|
30
|
+
<term id="term-Time">
|
31
31
|
<preferred><expression><name>Time</name></expression></preferred>
|
32
32
|
<definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
|
33
33
|
</term></terms>
|
@@ -520,7 +520,7 @@ RSpec.describe Metanorma::Standoc do
|
|
520
520
|
</fn>
|
521
521
|
</title>
|
522
522
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
523
|
-
<term id='term-
|
523
|
+
<term id='term-Term1'>
|
524
524
|
<preferred><expression><name>Term1</name></expression></preferred>
|
525
525
|
</term>
|
526
526
|
</terms>
|
@@ -795,7 +795,7 @@ RSpec.describe Metanorma::Standoc do
|
|
795
795
|
<terms id='_' obligation='normative'>
|
796
796
|
<title>Terms and definitions</title>
|
797
797
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
798
|
-
<term id='term-
|
798
|
+
<term id='term-Term1'>
|
799
799
|
<preferred><expression><name>Term1</name></expression></preferred>
|
800
800
|
</term>
|
801
801
|
</terms>
|
@@ -1032,7 +1032,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1032
1032
|
Pour les besoins du présent document, les termes et définitions suivants
|
1033
1033
|
s’appliquent.
|
1034
1034
|
</p>
|
1035
|
-
<term id='term-
|
1035
|
+
<term id='term-Term1'>
|
1036
1036
|
<preferred><expression><name>Term1</name></expression></preferred>
|
1037
1037
|
</term>
|
1038
1038
|
</terms>
|
@@ -1266,7 +1266,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1266
1266
|
<terms id='_' obligation='normative'>
|
1267
1267
|
<title>术语和定义</title>
|
1268
1268
|
<p id='_'>下列术语和定义适用于本文件。</p>
|
1269
|
-
<term id='term-
|
1269
|
+
<term id='term-Term1'>
|
1270
1270
|
<preferred><expression><name>Term1</name></expression></preferred>
|
1271
1271
|
</term>
|
1272
1272
|
</terms>
|
@@ -1500,7 +1500,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1500
1500
|
<terms id='_' obligation='normative'>
|
1501
1501
|
<title>Terms and definitions</title>
|
1502
1502
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1503
|
-
<term id='term-
|
1503
|
+
<term id='term-Term1'>
|
1504
1504
|
<preferred><expression><name>Term1</name></expression></preferred>
|
1505
1505
|
</term>
|
1506
1506
|
</terms>
|
@@ -435,7 +435,7 @@ RSpec.describe Metanorma::Standoc do
|
|
435
435
|
<terms id="_" obligation="normative">
|
436
436
|
<title>Terms and definitions</title>
|
437
437
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
438
|
-
<term id="term-
|
438
|
+
<term id="term-Term1">
|
439
439
|
<preferred><expression><name>Term1</name></expression></preferred>
|
440
440
|
<definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
|
441
441
|
<termsource status="identical" type="authoritative">
|
@@ -554,7 +554,7 @@ RSpec.describe Metanorma::Standoc do
|
|
554
554
|
<sections>
|
555
555
|
<terms id="_" obligation="normative"><title>Terms and definitions</title>
|
556
556
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
557
|
-
<term id="term-
|
557
|
+
<term id="term-Automation1">
|
558
558
|
<preferred><expression><name>Automation1</name></expression></preferred>
|
559
559
|
<definition><verbal-definition><p id='_'>Definition 1</p></verbal-definition></definition>
|
560
560
|
<termsource status="identical" type="authoritative">
|
@@ -565,7 +565,7 @@ RSpec.describe Metanorma::Standoc do
|
|
565
565
|
</origin>
|
566
566
|
</termsource>
|
567
567
|
</term>
|
568
|
-
<term id="term-
|
568
|
+
<term id="term-Automation2">
|
569
569
|
<preferred><expression><name>Automation2</name></expression></preferred>
|
570
570
|
<definition><verbal-definition><p id='_'>Definition 2</p></verbal-definition></definition>
|
571
571
|
<termsource status="identical" type="authoritative">
|
@@ -576,7 +576,7 @@ RSpec.describe Metanorma::Standoc do
|
|
576
576
|
</origin>
|
577
577
|
</termsource>
|
578
578
|
</term>
|
579
|
-
<term id="term-
|
579
|
+
<term id="term-Automation3">
|
580
580
|
<preferred><expression><name>Automation3</name></expression></preferred>
|
581
581
|
<definition><verbal-definition><p id='_'>Definition 3</p></verbal-definition></definition>
|
582
582
|
<termsource status="identical" type="authoritative">
|
@@ -1149,7 +1149,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1149
1149
|
<dd>
|
1150
1150
|
<p id='_'>Definition 3</p>
|
1151
1151
|
</dd>
|
1152
|
-
<dt id='symbol-
|
1152
|
+
<dt id='symbol-Xa'>Xa</dt>
|
1153
1153
|
<dd>
|
1154
1154
|
<p id='_'>Definition 2</p>
|
1155
1155
|
</dd>
|
@@ -3,7 +3,6 @@ require "relaton_iec"
|
|
3
3
|
require "fileutils"
|
4
4
|
|
5
5
|
RSpec.describe Metanorma::Standoc do
|
6
|
-
=begin
|
7
6
|
it "processes term and designation metadata and term sources" do
|
8
7
|
input = <<~INPUT
|
9
8
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -88,7 +87,7 @@ RSpec.describe Metanorma::Standoc do
|
|
88
87
|
<terms id='_' obligation='normative'>
|
89
88
|
<title>Terms and definitions</title>
|
90
89
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
91
|
-
<term id='term-
|
90
|
+
<term id='term-First-Designation'>
|
92
91
|
<preferred>
|
93
92
|
<expression language='fr' script='Latn' type='prefix' isInternational="true">
|
94
93
|
<name>First Designation</name>
|
@@ -181,7 +180,7 @@ RSpec.describe Metanorma::Standoc do
|
|
181
180
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
182
181
|
.to be_equivalent_to xmlpp(output)
|
183
182
|
end
|
184
|
-
|
183
|
+
|
185
184
|
it "permits multiple preferred terms and admitted terms, "\
|
186
185
|
"and treats them as synonyms in concepts" do
|
187
186
|
input = <<~INPUT
|
@@ -221,7 +220,7 @@ RSpec.describe Metanorma::Standoc do
|
|
221
220
|
<terms id='_' obligation='normative'>
|
222
221
|
<title>Terms and definitions</title>
|
223
222
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
224
|
-
<term id='term-
|
223
|
+
<term id='term-First-Designation'>
|
225
224
|
<preferred>
|
226
225
|
<expression>
|
227
226
|
<name>First Designation</name>
|
@@ -257,7 +256,7 @@ RSpec.describe Metanorma::Standoc do
|
|
257
256
|
term
|
258
257
|
<tt>Sixth Designation</tt>
|
259
258
|
not resolved via ID
|
260
|
-
<tt>
|
259
|
+
<tt>Sixth-Designation</tt>
|
261
260
|
</strong>
|
262
261
|
</related>
|
263
262
|
<related type='contrast'>
|
@@ -265,7 +264,7 @@ RSpec.describe Metanorma::Standoc do
|
|
265
264
|
term
|
266
265
|
<tt>Seventh Designation</tt>
|
267
266
|
not resolved via ID
|
268
|
-
<tt>
|
267
|
+
<tt>Seventh-Designation</tt>
|
269
268
|
</strong>
|
270
269
|
</related>
|
271
270
|
<definition><verbal-definition>
|
@@ -279,21 +278,21 @@ RSpec.describe Metanorma::Standoc do
|
|
279
278
|
<concept>
|
280
279
|
<refterm>First Designation</refterm>
|
281
280
|
<renderterm>First Designation</renderterm>
|
282
|
-
<xref target='term-
|
281
|
+
<xref target='term-First-Designation'/>
|
283
282
|
</concept>
|
284
283
|
</p>
|
285
284
|
<p id='_'>
|
286
285
|
<concept>
|
287
286
|
<refterm>First Designation</refterm>
|
288
287
|
<renderterm>Second Designation</renderterm>
|
289
|
-
<xref target='term-
|
288
|
+
<xref target='term-First-Designation'/>
|
290
289
|
</concept>
|
291
290
|
</p>
|
292
291
|
<p id='_'>
|
293
292
|
<concept>
|
294
293
|
<refterm>First Designation</refterm>
|
295
294
|
<renderterm>Third Designation</renderterm>
|
296
|
-
<xref target='term-
|
295
|
+
<xref target='term-First-Designation'/>
|
297
296
|
</concept>
|
298
297
|
</p>
|
299
298
|
</clause>
|
@@ -304,6 +303,81 @@ RSpec.describe Metanorma::Standoc do
|
|
304
303
|
.to be_equivalent_to xmlpp(output)
|
305
304
|
end
|
306
305
|
|
306
|
+
it "respects case in tagging of concepts" do
|
307
|
+
input = <<~INPUT
|
308
|
+
#{ASCIIDOC_BLANK_HDR}
|
309
|
+
== Terms and Definitions
|
310
|
+
|
311
|
+
=== First Designation
|
312
|
+
|
313
|
+
Definition
|
314
|
+
|
315
|
+
=== First designation
|
316
|
+
|
317
|
+
Definition
|
318
|
+
|
319
|
+
== Clause
|
320
|
+
|
321
|
+
{{First Designation}}
|
322
|
+
|
323
|
+
{{First designation}}
|
324
|
+
|
325
|
+
INPUT
|
326
|
+
output = <<~OUTPUT
|
327
|
+
#{BLANK_HDR}
|
328
|
+
<sections>
|
329
|
+
<terms id='_' obligation='normative'>
|
330
|
+
<title>Terms and definitions</title>
|
331
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
332
|
+
<term id='term-First-Designation'>
|
333
|
+
<preferred>
|
334
|
+
<expression>
|
335
|
+
<name>First Designation</name>
|
336
|
+
</expression>
|
337
|
+
</preferred>
|
338
|
+
<definition>
|
339
|
+
<verbal-definition>
|
340
|
+
<p id='_'>Definition</p>
|
341
|
+
</verbal-definition>
|
342
|
+
</definition>
|
343
|
+
</term>
|
344
|
+
<term id='term-First-designation'>
|
345
|
+
<preferred>
|
346
|
+
<expression>
|
347
|
+
<name>First designation</name>
|
348
|
+
</expression>
|
349
|
+
</preferred>
|
350
|
+
<definition>
|
351
|
+
<verbal-definition>
|
352
|
+
<p id='_'>Definition</p>
|
353
|
+
</verbal-definition>
|
354
|
+
</definition>
|
355
|
+
</term>
|
356
|
+
</terms>
|
357
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
358
|
+
<title>Clause</title>
|
359
|
+
<p id='_'>
|
360
|
+
<concept>
|
361
|
+
<refterm>First Designation</refterm>
|
362
|
+
<renderterm>First Designation</renderterm>
|
363
|
+
<xref target='term-First-Designation'/>
|
364
|
+
</concept>
|
365
|
+
</p>
|
366
|
+
<p id='_'>
|
367
|
+
<concept>
|
368
|
+
<refterm>First designation</refterm>
|
369
|
+
<renderterm>First designation</renderterm>
|
370
|
+
<xref target='term-First-designation'/>
|
371
|
+
</concept>
|
372
|
+
</p>
|
373
|
+
</clause>
|
374
|
+
</sections>
|
375
|
+
</standard-document>
|
376
|
+
OUTPUT
|
377
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
378
|
+
.to be_equivalent_to xmlpp(output)
|
379
|
+
end
|
380
|
+
|
307
381
|
it "processes letter-symbol designations" do
|
308
382
|
input = <<~INPUT
|
309
383
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -339,7 +413,7 @@ RSpec.describe Metanorma::Standoc do
|
|
339
413
|
<terms id='_' obligation='normative'>
|
340
414
|
<title>Terms and definitions</title>
|
341
415
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
342
|
-
<term id='term-
|
416
|
+
<term id='term-First-Designation'>
|
343
417
|
<preferred>
|
344
418
|
<letter-symbol>
|
345
419
|
<name>First Designation</name>
|
@@ -846,11 +920,11 @@ RSpec.describe Metanorma::Standoc do
|
|
846
920
|
<terms id="_" obligation="normative">
|
847
921
|
<title>Terms and definitions</title>
|
848
922
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
849
|
-
<term id="term-
|
923
|
+
<term id="term-Tempus">
|
850
924
|
<preferred><expression><name>Tempus</name></expression></preferred>
|
851
925
|
<domain>relativity</domain><definition><verbal-definition><p id="_"> Time</p></verbal-definition></definition>
|
852
926
|
</term>
|
853
|
-
<term id='term-
|
927
|
+
<term id='term-Tempus1'>
|
854
928
|
<preferred><expression><name>Tempus1</name></expression></preferred>
|
855
929
|
<domain>relativity2</domain>
|
856
930
|
<definition><verbal-definition>
|
@@ -988,7 +1062,7 @@ RSpec.describe Metanorma::Standoc do
|
|
988
1062
|
<terms id="_" obligation="normative">
|
989
1063
|
<title>Terms and definitions</title>
|
990
1064
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
991
|
-
<term id="term-
|
1065
|
+
<term id="term-Term"><preferred><expression><name>Term</name></expression></preferred>
|
992
1066
|
<definition><verbal-definition><p id='_'>Definition</p></verbal-definition></definition>
|
993
1067
|
<termnote id="_">
|
994
1068
|
<p id="_">Note</p>
|
@@ -1067,7 +1141,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1067
1141
|
<terms id='_' obligation='normative'>
|
1068
1142
|
<title>Terms and definitions</title>
|
1069
1143
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1070
|
-
<term id='term-
|
1144
|
+
<term id='term-Term'>
|
1071
1145
|
<preferred>
|
1072
1146
|
<expression>
|
1073
1147
|
<name>Term</name>
|
@@ -1113,7 +1187,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1113
1187
|
</origin>
|
1114
1188
|
</termsource>
|
1115
1189
|
</term>
|
1116
|
-
<term id='term-
|
1190
|
+
<term id='term-Term-2'>
|
1117
1191
|
<preferred>
|
1118
1192
|
<expression>
|
1119
1193
|
<name>Term 2</name>
|
@@ -1184,7 +1258,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1184
1258
|
<terms id='_' obligation='normative'>
|
1185
1259
|
<title>Terms and definitions</title>
|
1186
1260
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1187
|
-
<term id='term-
|
1261
|
+
<term id='term-Term'>
|
1188
1262
|
<preferred>
|
1189
1263
|
<expression>
|
1190
1264
|
<name>Term</name>
|
@@ -1273,7 +1347,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1273
1347
|
<terms id='_' obligation='normative'>
|
1274
1348
|
<title>Terms and definitions</title>
|
1275
1349
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1276
|
-
<term id='term-
|
1350
|
+
<term id='term-Term'>
|
1277
1351
|
<preferred>
|
1278
1352
|
<expression>
|
1279
1353
|
<name>Term</name>
|
@@ -1363,7 +1437,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1363
1437
|
<terms id='_' obligation='normative'>
|
1364
1438
|
<title>Terms and definitions</title>
|
1365
1439
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1366
|
-
<term id='term-
|
1440
|
+
<term id='term-Term'>
|
1367
1441
|
<preferred>
|
1368
1442
|
<expression>
|
1369
1443
|
<name>
|
@@ -1391,7 +1465,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1391
1465
|
</letter-symbol>
|
1392
1466
|
</admitted>
|
1393
1467
|
</term>
|
1394
|
-
<term id='term-
|
1468
|
+
<term id='term-Term2'>
|
1395
1469
|
<preferred>
|
1396
1470
|
<expression>
|
1397
1471
|
<name>
|
@@ -581,7 +581,7 @@ RSpec.describe Metanorma::Standoc do
|
|
581
581
|
<title>Terms and definitions</title><p id="_">For the purposes of this document,
|
582
582
|
the following terms and definitions apply.</p>
|
583
583
|
|
584
|
-
<term id="term-
|
584
|
+
<term id="term-Term1"><preferred><expression><name>Term1</name></expression><termsource status="identical" type="authoritative">
|
585
585
|
<origin bibitemid="reference" type="inline" citeas="ABC">
|
586
586
|
<em>reference</em>
|
587
587
|
</origin>
|