metanorma-standoc 2.0.6 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +62 -10
- data/lib/metanorma/standoc/blocks.rb +10 -0
- data/lib/metanorma/standoc/blocks_notes.rb +17 -11
- data/lib/metanorma/standoc/cleanup_block.rb +10 -0
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +15 -7
- data/lib/metanorma/standoc/cleanup_maths.rb +5 -4
- data/lib/metanorma/standoc/cleanup_ref.rb +2 -4
- data/lib/metanorma/standoc/cleanup_reqt.rb +1 -1
- data/lib/metanorma/standoc/cleanup_section.rb +15 -13
- data/lib/metanorma/standoc/cleanup_xref.rb +3 -4
- data/lib/metanorma/standoc/inline.rb +13 -9
- data/lib/metanorma/standoc/isodoc.rng +56 -0
- data/lib/metanorma/standoc/macros.rb +3 -3
- data/lib/metanorma/standoc/macros_embed.rb +1 -3
- data/lib/metanorma/standoc/macros_form.rb +1 -1
- 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/reqt.rb +5 -3
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +3 -1
- data/spec/assets/iso.adoc +10 -0
- data/spec/metanorma/blocks_spec.rb +138 -74
- data/spec/metanorma/cleanup_blocks_spec.rb +9 -0
- 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 +28 -11
- data/spec/metanorma/refs_spec.rb +0 -6
- data/spec/metanorma/section_spec.rb +15 -15
- data/spec/metanorma/table_spec.rb +339 -342
- data/spec/spec_helper.rb +2 -5
- data/spec/vcr_cassettes/bsi16341.yml +496 -0
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +84 -84
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +13 -13
- data/spec/vcr_cassettes/hide_refs.yml +172 -172
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +97 -97
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +109 -109
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +18 -22
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +48 -46
- data/spec/vcr_cassettes/std-link.yml +207 -0
- metadata +21 -4
@@ -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>
|
@@ -370,12 +370,12 @@ RSpec.describe Metanorma::Standoc do
|
|
370
370
|
<concept>
|
371
371
|
<refterm>Clause1</refterm>
|
372
372
|
<renderterm>Clause1</renderterm>
|
373
|
-
<xref target='term-
|
373
|
+
<xref target='term-Clause1'/>
|
374
374
|
</concept>
|
375
375
|
<concept>
|
376
376
|
<refterm>Clause1</refterm>
|
377
377
|
<renderterm>Clause 1</renderterm>
|
378
|
-
<xref target='term-
|
378
|
+
<xref target='term-Clause1'/>
|
379
379
|
</concept>
|
380
380
|
<concept>
|
381
381
|
<refterm>Clause 2</refterm>
|
@@ -396,12 +396,12 @@ RSpec.describe Metanorma::Standoc do
|
|
396
396
|
<concept>
|
397
397
|
<refterm>Clause1</refterm>
|
398
398
|
<renderterm>Clause1</renderterm>
|
399
|
-
<xref target='symbol-
|
399
|
+
<xref target='symbol-Clause1'/>
|
400
400
|
</concept>
|
401
401
|
<concept>
|
402
402
|
<refterm>Clause1</refterm>
|
403
403
|
<renderterm>word</renderterm>
|
404
|
-
<xref target='symbol-
|
404
|
+
<xref target='symbol-Clause1'/>
|
405
405
|
</concept>
|
406
406
|
<concept>
|
407
407
|
<refterm>Clause 2</refterm>
|
@@ -446,14 +446,14 @@ RSpec.describe Metanorma::Standoc do
|
|
446
446
|
<terms id='_' obligation='normative'>
|
447
447
|
<title>Terms and definitions</title>
|
448
448
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
449
|
-
<term id='term-
|
449
|
+
<term id='term-Clause1'>
|
450
450
|
<preferred><expression><name>Clause1</name></expression></preferred>
|
451
451
|
</term>
|
452
452
|
</terms>
|
453
453
|
<definitions id='_' obligation='normative'>
|
454
454
|
<title>Symbols and abbreviated terms</title>
|
455
455
|
<dl id='_'>
|
456
|
-
<dt id="symbol-
|
456
|
+
<dt id="symbol-Clause1">Clause1</dt>
|
457
457
|
<dd>
|
458
458
|
<p id='_'>A</p>
|
459
459
|
</dd>
|
@@ -1314,18 +1314,48 @@ RSpec.describe Metanorma::Standoc do
|
|
1314
1314
|
embed::spec/assets/xref_error.adoc[]
|
1315
1315
|
INPUT
|
1316
1316
|
output = <<~OUTPUT
|
1317
|
-
#{
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1317
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='#{Metanorma::Standoc::VERSION}'>
|
1318
|
+
<bibdata type='standard'>
|
1319
|
+
<title language='en' format='text/plain'>Document title</title>
|
1320
|
+
<language>en</language>
|
1321
|
+
<script>Latn</script>
|
1322
|
+
<status>
|
1323
|
+
<stage>published</stage>
|
1324
|
+
</status>
|
1325
|
+
<copyright>
|
1326
|
+
<from>2022</from>
|
1327
|
+
</copyright>
|
1328
|
+
<ext>
|
1329
|
+
<doctype>article</doctype>
|
1330
|
+
</ext>
|
1331
|
+
<relation type='derivedFrom'>
|
1332
|
+
<bibitem>
|
1333
|
+
<title language='en' format='text/plain'>X</title>
|
1334
|
+
<language>en</language>
|
1335
|
+
<script>Latn</script>
|
1336
|
+
<status>
|
1337
|
+
<stage>published</stage>
|
1338
|
+
</status>
|
1339
|
+
<copyright>
|
1340
|
+
<from>2022</from>
|
1341
|
+
</copyright>
|
1342
|
+
<ext>
|
1343
|
+
<doctype>article</doctype>
|
1344
|
+
</ext>
|
1345
|
+
</bibitem>
|
1346
|
+
</relation>
|
1347
|
+
</bibdata>
|
1348
|
+
<sections>
|
1349
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
1350
|
+
<title>Clause 1</title>
|
1351
|
+
</clause>
|
1352
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1353
|
+
<title>Clause</title>
|
1354
|
+
<p id='_'>
|
1355
|
+
<xref target='a'>b</xref>
|
1356
|
+
</p>
|
1357
|
+
</clause>
|
1358
|
+
</sections>
|
1329
1359
|
</standard-document>
|
1330
1360
|
OUTPUT
|
1331
1361
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
@@ -1342,12 +1372,42 @@ RSpec.describe Metanorma::Standoc do
|
|
1342
1372
|
embed::spec/assets/xref_error.adoc[]
|
1343
1373
|
INPUT
|
1344
1374
|
output = <<~OUTPUT
|
1345
|
-
#{
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
</
|
1350
|
-
|
1375
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='#{Metanorma::Standoc::VERSION}'>
|
1376
|
+
<bibdata type='standard'>
|
1377
|
+
<title language='en' format='text/plain'>Document title</title>
|
1378
|
+
<language>en</language>
|
1379
|
+
<script>Latn</script>
|
1380
|
+
<status>
|
1381
|
+
<stage>published</stage>
|
1382
|
+
</status>
|
1383
|
+
<copyright>
|
1384
|
+
<from>2022</from>
|
1385
|
+
</copyright>
|
1386
|
+
<ext>
|
1387
|
+
<doctype>article</doctype>
|
1388
|
+
</ext>
|
1389
|
+
<relation type='derivedFrom'>
|
1390
|
+
<bibitem>
|
1391
|
+
<title language='en' format='text/plain'>X</title>
|
1392
|
+
<language>en</language>
|
1393
|
+
<script>Latn</script>
|
1394
|
+
<status>
|
1395
|
+
<stage>published</stage>
|
1396
|
+
</status>
|
1397
|
+
<copyright>
|
1398
|
+
<from>2022</from>
|
1399
|
+
</copyright>
|
1400
|
+
<ext>
|
1401
|
+
<doctype>article</doctype>
|
1402
|
+
</ext>
|
1403
|
+
</bibitem>
|
1404
|
+
</relation>
|
1405
|
+
</bibdata>
|
1406
|
+
<sections>
|
1407
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
1408
|
+
<title>Clause</title>
|
1409
|
+
</clause>
|
1410
|
+
</sections>
|
1351
1411
|
</standard-document>
|
1352
1412
|
OUTPUT
|
1353
1413
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
@@ -1380,7 +1440,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1380
1440
|
</ext>
|
1381
1441
|
<relation type='derivedFrom'>
|
1382
1442
|
<bibitem>
|
1383
|
-
<title language='en' format='text/plain'>
|
1443
|
+
<title language='en' format='text/plain'>X</title>
|
1384
1444
|
<language>en</language>
|
1385
1445
|
<script>Latn</script>
|
1386
1446
|
<status>
|
@@ -1394,23 +1454,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1394
1454
|
</ext>
|
1395
1455
|
<relation type='derivedFrom'>
|
1396
1456
|
<bibitem>
|
1397
|
-
<title language='en' format='text/plain'>
|
1398
|
-
<language>en</language>
|
1399
|
-
<script>Latn</script>
|
1400
|
-
<status>
|
1401
|
-
<stage>published</stage>
|
1402
|
-
</status>
|
1403
|
-
<copyright>
|
1404
|
-
<from>2022</from>
|
1405
|
-
</copyright>
|
1406
|
-
<ext>
|
1407
|
-
<doctype>article</doctype>
|
1408
|
-
</ext>
|
1409
|
-
</bibitem>
|
1410
|
-
</relation>
|
1411
|
-
<relation type='derivedFrom'>
|
1412
|
-
<bibitem>
|
1413
|
-
<title language='en' format='text/plain'>A3a</title>
|
1457
|
+
<title language='en' format='text/plain'>A2</title>
|
1414
1458
|
<language>en</language>
|
1415
1459
|
<script>Latn</script>
|
1416
1460
|
<status>
|
@@ -1422,6 +1466,38 @@ RSpec.describe Metanorma::Standoc do
|
|
1422
1466
|
<ext>
|
1423
1467
|
<doctype>article</doctype>
|
1424
1468
|
</ext>
|
1469
|
+
<relation type='derivedFrom'>
|
1470
|
+
<bibitem>
|
1471
|
+
<title language='en' format='text/plain'>A3</title>
|
1472
|
+
<language>en</language>
|
1473
|
+
<script>Latn</script>
|
1474
|
+
<status>
|
1475
|
+
<stage>published</stage>
|
1476
|
+
</status>
|
1477
|
+
<copyright>
|
1478
|
+
<from>2022</from>
|
1479
|
+
</copyright>
|
1480
|
+
<ext>
|
1481
|
+
<doctype>article</doctype>
|
1482
|
+
</ext>
|
1483
|
+
</bibitem>
|
1484
|
+
</relation>
|
1485
|
+
<relation type='derivedFrom'>
|
1486
|
+
<bibitem>
|
1487
|
+
<title language='en' format='text/plain'>A3a</title>
|
1488
|
+
<language>en</language>
|
1489
|
+
<script>Latn</script>
|
1490
|
+
<status>
|
1491
|
+
<stage>published</stage>
|
1492
|
+
</status>
|
1493
|
+
<copyright>
|
1494
|
+
<from>2022</from>
|
1495
|
+
</copyright>
|
1496
|
+
<ext>
|
1497
|
+
<doctype>article</doctype>
|
1498
|
+
</ext>
|
1499
|
+
</bibitem>
|
1500
|
+
</relation>
|
1425
1501
|
</bibitem>
|
1426
1502
|
</relation>
|
1427
1503
|
</bibitem>
|
@@ -1444,11 +1520,11 @@ RSpec.describe Metanorma::Standoc do
|
|
1444
1520
|
<p id='_'>X</p>
|
1445
1521
|
</clause>
|
1446
1522
|
<clause id='_' inline-header='false' obligation='normative'>
|
1447
|
-
<title>Clause
|
1523
|
+
<title>Clause 4</title>
|
1448
1524
|
<p id='_'>X</p>
|
1449
1525
|
</clause>
|
1450
1526
|
<clause id='_' inline-header='false' obligation='normative'>
|
1451
|
-
<title>Clause
|
1527
|
+
<title>Clause 3a</title>
|
1452
1528
|
<p id='_'>X</p>
|
1453
1529
|
</clause>
|
1454
1530
|
</sections>
|
@@ -1458,8 +1534,103 @@ RSpec.describe Metanorma::Standoc do
|
|
1458
1534
|
.to be_equivalent_to xmlpp(output)
|
1459
1535
|
end
|
1460
1536
|
|
1537
|
+
it "processes embed macro with document in a different flavour" do
|
1538
|
+
require "metanorma-iso"
|
1539
|
+
input = <<~INPUT
|
1540
|
+
#{ASCIIDOC_BLANK_HDR}
|
1541
|
+
|
1542
|
+
[[clause1]]
|
1543
|
+
== Clause 1
|
1544
|
+
|
1545
|
+
embed::spec/assets/iso.adoc[]
|
1546
|
+
INPUT
|
1547
|
+
output = <<~OUTPUT
|
1548
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='#{Metanorma::Standoc::VERSION}'>
|
1549
|
+
<bibdata type='standard'>
|
1550
|
+
<title language='en' format='text/plain'>Document title</title>
|
1551
|
+
<language>en</language>
|
1552
|
+
<script>Latn</script>
|
1553
|
+
<status>
|
1554
|
+
<stage>published</stage>
|
1555
|
+
</status>
|
1556
|
+
<copyright>
|
1557
|
+
<from>2022</from>
|
1558
|
+
</copyright>
|
1559
|
+
<ext>
|
1560
|
+
<doctype>article</doctype>
|
1561
|
+
</ext>
|
1562
|
+
<relation type='derivedFrom'>
|
1563
|
+
<bibitem>
|
1564
|
+
<title language='en' format='text/plain' type='main'>
|
1565
|
+
Medical devices — Quality management systems — Requirements for
|
1566
|
+
regulatory purposes
|
1567
|
+
</title>
|
1568
|
+
<title language='en' format='text/plain' type='title-main'>
|
1569
|
+
Medical devices — Quality management systems — Requirements for
|
1570
|
+
regulatory purposes
|
1571
|
+
</title>
|
1572
|
+
<title language='fr' format='text/plain' type='main'>
|
1573
|
+
Dispositifs médicaux — Systèmes de management de la qualité —
|
1574
|
+
Exigences à des fins réglementaires
|
1575
|
+
</title>
|
1576
|
+
<title language='fr' format='text/plain' type='title-main'>
|
1577
|
+
Dispositifs médicaux — Systèmes de management de la qualité —
|
1578
|
+
Exigences à des fins réglementaires
|
1579
|
+
</title>
|
1580
|
+
<contributor>
|
1581
|
+
<role type='author'/>
|
1582
|
+
<organization>
|
1583
|
+
<name>International Organization for Standardization</name>
|
1584
|
+
<abbreviation>ISO</abbreviation>
|
1585
|
+
</organization>
|
1586
|
+
</contributor>
|
1587
|
+
<contributor>
|
1588
|
+
<role type='publisher'/>
|
1589
|
+
<organization>
|
1590
|
+
<name>International Organization for Standardization</name>
|
1591
|
+
<abbreviation>ISO</abbreviation>
|
1592
|
+
</organization>
|
1593
|
+
</contributor>
|
1594
|
+
<language>en</language>
|
1595
|
+
<script>Latn</script>
|
1596
|
+
<status>
|
1597
|
+
<stage abbreviation='IS'>60</stage>
|
1598
|
+
<substage>60</substage>
|
1599
|
+
</status>
|
1600
|
+
<copyright>
|
1601
|
+
<from>2022</from>
|
1602
|
+
<owner>
|
1603
|
+
<organization>
|
1604
|
+
<name>International Organization for Standardization</name>
|
1605
|
+
<abbreviation>ISO</abbreviation>
|
1606
|
+
</organization>
|
1607
|
+
</owner>
|
1608
|
+
</copyright>
|
1609
|
+
<ext>
|
1610
|
+
<doctype>article</doctype>
|
1611
|
+
<editorialgroup>
|
1612
|
+
<technical-committee/>
|
1613
|
+
<subcommittee/>
|
1614
|
+
<workgroup/>
|
1615
|
+
</editorialgroup>
|
1616
|
+
<stagename>International standard</stagename>
|
1617
|
+
</ext>
|
1618
|
+
</bibitem>
|
1619
|
+
</relation>
|
1620
|
+
</bibdata>
|
1621
|
+
<sections>
|
1622
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
1623
|
+
<title>Clause 1</title>
|
1624
|
+
</clause>
|
1625
|
+
</sections>
|
1626
|
+
</standard-document>
|
1627
|
+
OUTPUT
|
1628
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1629
|
+
.to be_equivalent_to xmlpp(output)
|
1630
|
+
end
|
1631
|
+
|
1461
1632
|
it "processes std-link macro" do
|
1462
|
-
VCR.use_cassette
|
1633
|
+
VCR.use_cassette("std-link", match_requests_on: %i[method uri body]) do
|
1463
1634
|
input = <<~INPUT
|
1464
1635
|
#{ISOBIB_BLANK_HDR}
|
1465
1636
|
|