metanorma-standoc 1.11.2 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/asciidoctor/standoc/base.rb +4 -100
- data/lib/asciidoctor/standoc/cleanup.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_block.rb +1 -2
- data/lib/asciidoctor/standoc/cleanup_inline.rb +14 -4
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +3 -3
- data/lib/asciidoctor/standoc/cleanup_terms.rb +23 -1
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +20 -6
- data/lib/asciidoctor/standoc/front.rb +1 -1
- data/lib/asciidoctor/standoc/isodoc.rng +14 -0
- data/lib/asciidoctor/standoc/render.rb +117 -0
- data/lib/asciidoctor/standoc/section.rb +6 -2
- data/lib/asciidoctor/standoc/utils.rb +0 -16
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor/blocks_spec.rb +33 -4
- data/spec/asciidoctor/cleanup_blocks_spec.rb +24 -0
- data/spec/asciidoctor/cleanup_terms_spec.rb +172 -28
- data/spec/asciidoctor/section_spec.rb +30 -1
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +50 -50
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +96 -96
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +112 -112
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +18 -18
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +6 -5
@@ -88,8 +88,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
88
88
|
<title>Terms and definitions</title>
|
89
89
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
90
90
|
<term id='term-first-designation'>
|
91
|
-
<preferred
|
92
|
-
<expression>
|
91
|
+
<preferred>
|
92
|
+
<expression language='fr' script='Latn' type='prefix' isInternational="true">
|
93
93
|
<name>First Designation</name>
|
94
94
|
<abbreviation-type>acronym</abbreviation-type>
|
95
95
|
<pronunciation>fəɹst</pronunciation>
|
@@ -106,14 +106,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
106
106
|
</origin>
|
107
107
|
</termsource>
|
108
108
|
</preferred>
|
109
|
-
<admitted
|
110
|
-
<expression>
|
109
|
+
<admitted absent="true">
|
110
|
+
<expression language='he' script='Hebr' type='suffix'>
|
111
111
|
<name>Third Designation</name>
|
112
112
|
</expression>
|
113
113
|
<usage-info>This is usage 1.</usage-info>
|
114
114
|
</admitted>
|
115
|
-
<deprecates
|
116
|
-
<expression>
|
115
|
+
<deprecates geographic-area="AUS">
|
116
|
+
<expression language='jp' script='Japn' type='full'>
|
117
117
|
<name>Fourth Designation</name>
|
118
118
|
<grammar>
|
119
119
|
<gender>masculine</gender>
|
@@ -127,9 +127,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
127
127
|
</expression>
|
128
128
|
<field-of-application>Field</field-of-application>
|
129
129
|
</deprecates>
|
130
|
-
<related type='
|
130
|
+
<related type='see'>
|
131
131
|
<preferred geographic-area="GRC">
|
132
|
-
<expression>
|
132
|
+
<expression type="abbreviation">
|
133
133
|
<name>Fifth Designation</name>
|
134
134
|
<grammar>
|
135
135
|
<gender>neuter</gender>
|
@@ -409,8 +409,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
409
409
|
<title>Terms and definitions</title>
|
410
410
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
411
411
|
<term id='second'>
|
412
|
-
<preferred
|
413
|
-
<expression>
|
412
|
+
<preferred>
|
413
|
+
<expression isInternational='true'>
|
414
414
|
<name/>
|
415
415
|
</expression>
|
416
416
|
</preferred>
|
@@ -502,8 +502,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
502
502
|
<title>Terms and definitions</title>
|
503
503
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
504
504
|
<term id='second'>
|
505
|
-
<preferred
|
506
|
-
<graphical-symbol>
|
505
|
+
<preferred>
|
506
|
+
<graphical-symbol isInternational='true'>
|
507
507
|
<figure id='_'>
|
508
508
|
<pre id='_'><LITERAL> FIGURATIVE</pre>
|
509
509
|
</figure>
|
@@ -556,6 +556,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
556
556
|
#{ASCIIDOC_BLANK_HDR}
|
557
557
|
== Terms and Definitions
|
558
558
|
|
559
|
+
[[des1]]
|
559
560
|
=== First Designation
|
560
561
|
|
561
562
|
[%metadata]
|
@@ -569,7 +570,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
569
570
|
subject:: pipes
|
570
571
|
usage-info:: This is usage.
|
571
572
|
|
572
|
-
related:see[Fifth Designation]
|
573
|
+
related:see[<<des1>>,Fifth Designation]
|
573
574
|
|
574
575
|
[%metadata]
|
575
576
|
grammar::
|
@@ -612,28 +613,28 @@ RSpec.describe Asciidoctor::Standoc do
|
|
612
613
|
<terms id='_' obligation='normative'>
|
613
614
|
<title>Terms and definitions</title>
|
614
615
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
615
|
-
<term id='
|
616
|
-
<preferred
|
617
|
-
<expression>
|
616
|
+
<term id='des1'>
|
617
|
+
<preferred>
|
618
|
+
<expression language='fr' script='Latn' type='prefix' isInternational="true">
|
618
619
|
<name>First Designation</name>
|
619
620
|
<abbreviation-type>acronym</abbreviation-type>
|
620
621
|
<pronunciation>fəɹst</pronunciation>
|
621
622
|
</expression>
|
622
623
|
<usage-info>This is usage.</usage-info>
|
623
624
|
</preferred>
|
624
|
-
<preferred
|
625
|
-
<expression>
|
625
|
+
<preferred>
|
626
|
+
<expression type='abbreviation'>
|
626
627
|
<name>Second Designation</name>
|
627
628
|
</expression>
|
628
629
|
</preferred>
|
629
|
-
<admitted
|
630
|
-
<expression>
|
630
|
+
<admitted>
|
631
|
+
<expression language='he' script='Hebr' type='suffix'>
|
631
632
|
<name>Third Designation</name>
|
632
633
|
</expression>
|
633
634
|
<usage-info>This is usage 1.</usage-info>
|
634
635
|
</admitted>
|
635
|
-
<deprecates
|
636
|
-
<expression>
|
636
|
+
<deprecates>
|
637
|
+
<expression language='jp' script='Japn' type='full'>
|
637
638
|
<name>Fourth Designation</name>
|
638
639
|
<grammar>
|
639
640
|
<gender>masculine</gender>
|
@@ -645,12 +646,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
645
646
|
</expression>
|
646
647
|
</deprecates>
|
647
648
|
<related type='see'>
|
648
|
-
|
649
|
-
|
650
|
-
<tt>Fifth Designation</tt>
|
651
|
-
not resolved via ID
|
652
|
-
<tt>fifth-designation</tt>
|
653
|
-
</strong>
|
649
|
+
<preferred><expression><name>Fifth Designation</name><grammar><gender>neuter</gender></grammar></expression>
|
650
|
+
</preferred><xref target='des1'/>
|
654
651
|
</related>
|
655
652
|
<domain>Hydraulics</domain>
|
656
653
|
<subject>pipes</subject>
|
@@ -1202,4 +1199,151 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1202
1199
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1203
1200
|
.to be_equivalent_to xmlpp(output)
|
1204
1201
|
end
|
1202
|
+
|
1203
|
+
it "automatically indexes term indexes" do
|
1204
|
+
input = <<~INPUT
|
1205
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:\n/, ":nodoc:\n:index-terms:\n")}
|
1206
|
+
|
1207
|
+
== Terms and definitions
|
1208
|
+
|
1209
|
+
=== Term
|
1210
|
+
|
1211
|
+
[stem]
|
1212
|
+
++++
|
1213
|
+
lambda
|
1214
|
+
++++
|
1215
|
+
|
1216
|
+
admitted:[x]
|
1217
|
+
|
1218
|
+
=== Term2
|
1219
|
+
|
1220
|
+
preferred:[stem:[mu_0 // 2]]
|
1221
|
+
|
1222
|
+
== Symbols and Abbreviated Terms
|
1223
|
+
|
1224
|
+
x^2^:: Definition
|
1225
|
+
INPUT
|
1226
|
+
output = <<~OUTPUT
|
1227
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='1.11.2'>
|
1228
|
+
<bibdata type='standard'>
|
1229
|
+
<title language='en' format='text/plain'>Document title</title>
|
1230
|
+
<language>en</language>
|
1231
|
+
<script>Latn</script>
|
1232
|
+
<status>
|
1233
|
+
<stage>published</stage>
|
1234
|
+
</status>
|
1235
|
+
<copyright>
|
1236
|
+
<from>2021</from>
|
1237
|
+
</copyright>
|
1238
|
+
<ext>
|
1239
|
+
<doctype>article</doctype>
|
1240
|
+
</ext>
|
1241
|
+
</bibdata>
|
1242
|
+
<sections>
|
1243
|
+
<terms id='_' obligation='normative'>
|
1244
|
+
<title>Terms and definitions</title>
|
1245
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1246
|
+
<term id='term-term'>
|
1247
|
+
<preferred>
|
1248
|
+
<expression>
|
1249
|
+
<name>
|
1250
|
+
Term
|
1251
|
+
<index>
|
1252
|
+
<primary>Term</primary>
|
1253
|
+
</index>
|
1254
|
+
</name>
|
1255
|
+
</expression>
|
1256
|
+
</preferred>
|
1257
|
+
<admitted>
|
1258
|
+
<letter-symbol>
|
1259
|
+
<name>
|
1260
|
+
<stem type='MathML'>
|
1261
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1262
|
+
<mi>λ</mi>
|
1263
|
+
</math>
|
1264
|
+
</stem>
|
1265
|
+
</name>
|
1266
|
+
</letter-symbol>
|
1267
|
+
</admitted>
|
1268
|
+
<definition>
|
1269
|
+
<verbal-definition>
|
1270
|
+
<p id='_'>admitted:[x]</p>
|
1271
|
+
</verbal-definition>
|
1272
|
+
</definition>
|
1273
|
+
</term>
|
1274
|
+
<term id='term-term2'>
|
1275
|
+
<preferred>
|
1276
|
+
<expression>
|
1277
|
+
<name>
|
1278
|
+
Term2
|
1279
|
+
<index>
|
1280
|
+
<primary>Term2</primary>
|
1281
|
+
</index>
|
1282
|
+
</name>
|
1283
|
+
</expression>
|
1284
|
+
</preferred>
|
1285
|
+
<preferred>
|
1286
|
+
<letter-symbol>
|
1287
|
+
<name>
|
1288
|
+
<stem type='MathML'>
|
1289
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1290
|
+
<msub>
|
1291
|
+
<mrow>
|
1292
|
+
<mi>μ</mi>
|
1293
|
+
</mrow>
|
1294
|
+
<mrow>
|
1295
|
+
<mn>0</mn>
|
1296
|
+
</mrow>
|
1297
|
+
</msub>
|
1298
|
+
<mo>/</mo>
|
1299
|
+
<mn>2</mn>
|
1300
|
+
</math>
|
1301
|
+
</stem>
|
1302
|
+
<index>
|
1303
|
+
<primary>
|
1304
|
+
<stem type='MathML'>
|
1305
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1306
|
+
<msub>
|
1307
|
+
<mrow>
|
1308
|
+
<mi>μ</mi>
|
1309
|
+
</mrow>
|
1310
|
+
<mrow>
|
1311
|
+
<mn>0</mn>
|
1312
|
+
</mrow>
|
1313
|
+
</msub>
|
1314
|
+
<mo>/</mo>
|
1315
|
+
<mn>2</mn>
|
1316
|
+
</math>
|
1317
|
+
</stem>
|
1318
|
+
</primary>
|
1319
|
+
</index>
|
1320
|
+
</name>
|
1321
|
+
</letter-symbol>
|
1322
|
+
</preferred>
|
1323
|
+
</term>
|
1324
|
+
</terms>
|
1325
|
+
<definitions id='_' obligation='normative'>
|
1326
|
+
<title>Symbols and abbreviated terms</title>
|
1327
|
+
<dl id='_'>
|
1328
|
+
<dt id='symbol-x2'>
|
1329
|
+
x
|
1330
|
+
<sup>2</sup>
|
1331
|
+
<index>
|
1332
|
+
<primary>
|
1333
|
+
x
|
1334
|
+
<sup>2</sup>
|
1335
|
+
</primary>
|
1336
|
+
</index>
|
1337
|
+
</dt>
|
1338
|
+
<dd>
|
1339
|
+
<p id='_'>Definition</p>
|
1340
|
+
</dd>
|
1341
|
+
</dl>
|
1342
|
+
</definitions>
|
1343
|
+
</sections>
|
1344
|
+
</standard-document>
|
1345
|
+
OUTPUT
|
1346
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1347
|
+
.to be_equivalent_to xmlpp(output)
|
1348
|
+
end
|
1205
1349
|
end
|
@@ -686,6 +686,36 @@ RSpec.describe Asciidoctor::Standoc do
|
|
686
686
|
.to be_equivalent_to xmlpp(output)
|
687
687
|
end
|
688
688
|
|
689
|
+
it "tag and multilingual processing attributes on term" do
|
690
|
+
input = <<~INPUT
|
691
|
+
#{ASCIIDOC_BLANK_HDR}
|
692
|
+
[heading="terms, definitions, symbols and abbreviated terms"]
|
693
|
+
== Terms, Definitions, Symbols Section
|
694
|
+
|
695
|
+
[language=en,tag=x123,multilingual-rendering=all-columns]
|
696
|
+
=== Term
|
697
|
+
INPUT
|
698
|
+
output = <<~OUTPUT
|
699
|
+
#{BLANK_HDR}
|
700
|
+
<sections>
|
701
|
+
<terms id='_' obligation='normative'>
|
702
|
+
<title>Terms and definitions</title>
|
703
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
704
|
+
<term id='term-term' language='en' tag='x123' multilingual-rendering='all-columns'>
|
705
|
+
<preferred>
|
706
|
+
<expression>
|
707
|
+
<name>Term</name>
|
708
|
+
</expression>
|
709
|
+
</preferred>
|
710
|
+
</term>
|
711
|
+
</terms>
|
712
|
+
</sections>
|
713
|
+
</standard-document>
|
714
|
+
OUTPUT
|
715
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
716
|
+
.to be_equivalent_to xmlpp(output)
|
717
|
+
end
|
718
|
+
|
689
719
|
it "varies terms & symbols title" do
|
690
720
|
input = <<~INPUT
|
691
721
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1229,5 +1259,4 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1229
1259
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1230
1260
|
.to be_equivalent_to xmlpp(output)
|
1231
1261
|
end
|
1232
|
-
|
1233
1262
|
end
|