metanorma-standoc 1.10.5 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +19 -23
- data/Rakefile +1 -1
- data/lib/asciidoctor/standoc/base.rb +14 -17
- data/lib/asciidoctor/standoc/basicdoc.rng +21 -4
- data/lib/asciidoctor/standoc/blocks.rb +26 -23
- data/lib/asciidoctor/standoc/blocks_notes.rb +17 -22
- data/lib/asciidoctor/standoc/cleanup.rb +46 -12
- data/lib/asciidoctor/standoc/cleanup_block.rb +5 -70
- data/lib/asciidoctor/standoc/cleanup_image.rb +6 -7
- data/lib/asciidoctor/standoc/cleanup_inline.rb +44 -102
- data/lib/asciidoctor/standoc/cleanup_maths.rb +5 -6
- data/lib/asciidoctor/standoc/cleanup_ref.rb +5 -0
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +51 -33
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +5 -5
- data/lib/asciidoctor/standoc/cleanup_symbols.rb +48 -0
- data/lib/asciidoctor/standoc/cleanup_table.rb +68 -0
- data/lib/asciidoctor/standoc/cleanup_terms.rb +38 -78
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +162 -0
- data/lib/asciidoctor/standoc/cleanup_text.rb +5 -2
- data/lib/asciidoctor/standoc/cleanup_xref.rb +107 -0
- data/lib/asciidoctor/standoc/converter.rb +15 -0
- data/lib/asciidoctor/standoc/inline.rb +7 -5
- data/lib/asciidoctor/standoc/isodoc.rng +435 -78
- data/lib/asciidoctor/standoc/lists.rb +15 -15
- data/lib/asciidoctor/standoc/macros.rb +14 -43
- data/lib/asciidoctor/standoc/macros_note.rb +45 -0
- data/lib/asciidoctor/standoc/macros_plantuml.rb +29 -14
- data/lib/asciidoctor/standoc/macros_terms.rb +82 -20
- data/lib/asciidoctor/standoc/ref_sect.rb +24 -17
- data/lib/asciidoctor/standoc/reqt.rb +2 -2
- data/lib/asciidoctor/standoc/reqt.rng +23 -2
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +50 -11
- data/lib/asciidoctor/standoc/terms.rb +21 -3
- data/lib/asciidoctor/standoc/utils.rb +36 -23
- data/lib/asciidoctor/standoc/validate.rb +45 -27
- data/lib/asciidoctor/standoc/validate_section.rb +5 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor/base_spec.rb +4 -36
- data/spec/asciidoctor/blank_spec.rb +37 -0
- data/spec/asciidoctor/blocks_spec.rb +296 -47
- data/spec/asciidoctor/cleanup_blocks_spec.rb +1018 -0
- data/spec/asciidoctor/cleanup_sections_spec.rb +153 -12
- data/spec/asciidoctor/cleanup_spec.rb +179 -1265
- data/spec/asciidoctor/cleanup_terms_spec.rb +990 -0
- data/spec/asciidoctor/inline_spec.rb +38 -2
- data/spec/asciidoctor/lists_spec.rb +6 -6
- data/spec/asciidoctor/macros_plantuml_spec.rb +37 -2
- data/spec/asciidoctor/macros_spec.rb +226 -138
- data/spec/asciidoctor/refs_spec.rb +4 -26
- data/spec/asciidoctor/section_spec.rb +18 -18
- data/spec/asciidoctor/validate_spec.rb +109 -1
- data/spec/assets/xref_error.adoc +1 -0
- data/spec/fixtures/datamodel_description_sections_tree.xml +327 -326
- data/spec/spec_helper.rb +6 -7
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +51 -51
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +34 -34
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +16 -16
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +51 -49
- metadata +13 -5
@@ -72,7 +72,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
72
72
|
#{ASCIIDOC_BLANK_HDR}
|
73
73
|
|
74
74
|
[[ABC]]
|
75
|
-
[stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
|
75
|
+
[stem%inequality,number=3,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
|
76
76
|
++++
|
77
77
|
r = 1 %
|
78
78
|
r = 1 %
|
@@ -97,7 +97,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
97
97
|
output = <<~OUTPUT
|
98
98
|
#{BLANK_HDR}
|
99
99
|
<sections>
|
100
|
-
<formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true'>
|
100
|
+
<formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true' tag='X' multilingual-rendering='common'>
|
101
101
|
<stem type='MathML'>
|
102
102
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
103
103
|
<mi>r</mi>
|
@@ -317,6 +317,92 @@ RSpec.describe Asciidoctor::Standoc do
|
|
317
317
|
.to be_equivalent_to xmlpp(output)
|
318
318
|
end
|
319
319
|
|
320
|
+
it "processes multiple term definitions" do
|
321
|
+
input = <<~INPUT
|
322
|
+
#{ASCIIDOC_BLANK_HDR}
|
323
|
+
== Terms and Definitions
|
324
|
+
|
325
|
+
=== Term1
|
326
|
+
|
327
|
+
[.definition]
|
328
|
+
--
|
329
|
+
first definition
|
330
|
+
|
331
|
+
[.source]
|
332
|
+
<<ISO2191,section=1>>
|
333
|
+
--
|
334
|
+
|
335
|
+
[.definition]
|
336
|
+
--
|
337
|
+
second definition
|
338
|
+
|
339
|
+
[.source]
|
340
|
+
<<ISO2191,section=2>>
|
341
|
+
--
|
342
|
+
|
343
|
+
NOTE: This is a note
|
344
|
+
|
345
|
+
[.source]
|
346
|
+
<<ISO2191,section=3>>
|
347
|
+
|
348
|
+
INPUT
|
349
|
+
output = <<~OUTPUT
|
350
|
+
#{BLANK_HDR}
|
351
|
+
<sections>
|
352
|
+
<terms id='_' obligation='normative'>
|
353
|
+
<title>Terms and definitions</title>
|
354
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
355
|
+
<term id='term-term1'>
|
356
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
357
|
+
<definition>
|
358
|
+
<verbaldefinition>
|
359
|
+
<p id='_'>first definition</p>
|
360
|
+
<termsource status='identical' type="authoritative">
|
361
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
362
|
+
<localityStack>
|
363
|
+
<locality type='section'>
|
364
|
+
<referenceFrom>1</referenceFrom>
|
365
|
+
</locality>
|
366
|
+
</localityStack>
|
367
|
+
</origin>
|
368
|
+
</termsource>
|
369
|
+
</verbaldefinition>
|
370
|
+
</definition>
|
371
|
+
<definition>
|
372
|
+
<verbaldefinition>
|
373
|
+
<p id='_'>second definition</p>
|
374
|
+
<termsource status='identical' type="authoritative">
|
375
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
376
|
+
<localityStack>
|
377
|
+
<locality type='section'>
|
378
|
+
<referenceFrom>2</referenceFrom>
|
379
|
+
</locality>
|
380
|
+
</localityStack>
|
381
|
+
</origin>
|
382
|
+
</termsource>
|
383
|
+
</verbaldefinition>
|
384
|
+
</definition>
|
385
|
+
<termnote id='_'>
|
386
|
+
<p id='_'>This is a note</p>
|
387
|
+
</termnote>
|
388
|
+
<termsource status='identical' type="authoritative">
|
389
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
390
|
+
<localityStack>
|
391
|
+
<locality type='section'>
|
392
|
+
<referenceFrom>3</referenceFrom>
|
393
|
+
</locality>
|
394
|
+
</localityStack>
|
395
|
+
</origin>
|
396
|
+
</termsource>
|
397
|
+
</term>
|
398
|
+
</terms>
|
399
|
+
</sections>
|
400
|
+
</standard-document>
|
401
|
+
OUTPUT
|
402
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
403
|
+
.to be_equivalent_to xmlpp(output)
|
404
|
+
end
|
405
|
+
|
320
406
|
it "processes term notes" do
|
321
407
|
input = <<~INPUT
|
322
408
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -326,7 +412,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
326
412
|
|
327
413
|
NOTE: This is a note
|
328
414
|
|
329
|
-
[NOTE,keep-separate=true]
|
415
|
+
[NOTE,keep-separate=true,tag=X,multilingual-rendering=common]
|
330
416
|
====
|
331
417
|
XYZ
|
332
418
|
====
|
@@ -338,11 +424,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
338
424
|
<title>Terms and definitions</title>
|
339
425
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
340
426
|
<term id="term-term1">
|
341
|
-
<preferred>Term1</preferred>
|
427
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
342
428
|
<termnote id="_">
|
343
429
|
<p id="_">This is a note</p>
|
344
430
|
</termnote>
|
345
|
-
<termnote id='_'>
|
431
|
+
<termnote id='_' tag='X' multilingual-rendering='common'>
|
346
432
|
<p id='_'>XYZ</p>
|
347
433
|
</termnote>
|
348
434
|
</term>
|
@@ -413,7 +499,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
413
499
|
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
414
500
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
415
501
|
<term id="term-term1">
|
416
|
-
<preferred>Term1</preferred>
|
502
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
417
503
|
</term>
|
418
504
|
<definitions id="_" obligation="normative" type="symbols">
|
419
505
|
<title>Symbols</title>
|
@@ -438,7 +524,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
438
524
|
[[ABC]]
|
439
525
|
NOTE: This is a note
|
440
526
|
|
441
|
-
[NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified]
|
527
|
+
[NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified,tag=X,multilingual-rendering=common]
|
442
528
|
====
|
443
529
|
XYZ
|
444
530
|
====
|
@@ -451,7 +537,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
451
537
|
<p id="_">This is a note</p>
|
452
538
|
</note>
|
453
539
|
</foreword></preface><sections>
|
454
|
-
<note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
|
540
|
+
<note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified" tag='X' multilingual-rendering='common'>
|
455
541
|
<p id='_'>XYZ</p>
|
456
542
|
</note>
|
457
543
|
<clause id="_" inline-header="false" obligation="normative">
|
@@ -473,7 +559,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
473
559
|
#{ASCIIDOC_BLANK_HDR}
|
474
560
|
|
475
561
|
[[ABC]]
|
476
|
-
[alt=Literal,keep-with-next=true,keep-lines-together=true]
|
562
|
+
[alt=Literal,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
|
477
563
|
....
|
478
564
|
<LITERAL>
|
479
565
|
FIGURATIVE
|
@@ -482,7 +568,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
482
568
|
output = <<~OUTPUT
|
483
569
|
#{BLANK_HDR}
|
484
570
|
<sections>
|
485
|
-
<figure id="ABC" keep-with-next="true" keep-lines-together="true">
|
571
|
+
<figure id="ABC" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
|
486
572
|
<pre alt="Literal" id="_"><LITERAL>
|
487
573
|
FIGURATIVE
|
488
574
|
</pre>
|
@@ -519,7 +605,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
519
605
|
#{ASCIIDOC_BLANK_HDR}
|
520
606
|
|
521
607
|
[[ABC]]
|
522
|
-
[CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
|
608
|
+
[CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true",tag=X,multilingual-rendering=common]
|
523
609
|
.Precautions
|
524
610
|
====
|
525
611
|
While werewolves are hardy community members, keep in mind the following dietary concerns:
|
@@ -532,7 +618,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
532
618
|
output = <<~OUTPUT
|
533
619
|
#{BLANK_HDR}
|
534
620
|
<sections>
|
535
|
-
<admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
|
621
|
+
<admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
|
536
622
|
<name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
|
537
623
|
<ol id="_" type="arabic">
|
538
624
|
<li>
|
@@ -561,7 +647,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
561
647
|
=== Term1
|
562
648
|
|
563
649
|
[[ABC]]
|
564
|
-
[example]
|
650
|
+
[example,tag=X,multilingual-rendering=common]
|
565
651
|
This is an example
|
566
652
|
INPUT
|
567
653
|
output = <<~OUTPUT
|
@@ -571,8 +657,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
571
657
|
<title>Terms and definitions</title>
|
572
658
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
573
659
|
<term id="term-term1">
|
574
|
-
<preferred>Term1</preferred>
|
575
|
-
<termexample id="ABC">
|
660
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
661
|
+
<termexample id="ABC" tag='X' multilingual-rendering='common'>
|
576
662
|
<p id="_">This is an example</p>
|
577
663
|
</termexample></term>
|
578
664
|
</terms>
|
@@ -631,7 +717,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
631
717
|
<sections>
|
632
718
|
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
633
719
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
|
634
|
-
<preferred>Term1</preferred>
|
720
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
635
721
|
</term>
|
636
722
|
<definitions id="_" obligation="normative" type="symbols">
|
637
723
|
<title>Symbols</title>
|
@@ -651,7 +737,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
651
737
|
#{ASCIIDOC_BLANK_HDR}
|
652
738
|
|
653
739
|
[[ABC]]
|
654
|
-
[example,subsequence=A,keep-with-next=true,keep-lines-together=next]
|
740
|
+
[example,subsequence=A,keep-with-next=true,keep-lines-together=next,tag=X,multilingual-rendering=common]
|
655
741
|
.Title
|
656
742
|
====
|
657
743
|
This is an example
|
@@ -672,7 +758,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
672
758
|
output = <<~OUTPUT
|
673
759
|
#{BLANK_HDR}
|
674
760
|
<sections>
|
675
|
-
<example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
|
761
|
+
<example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next' tag='X' multilingual-rendering='common'>
|
676
762
|
<name>Title</name>
|
677
763
|
<p id="_">This is an example</p>
|
678
764
|
<p id="_">Amen</p></example>
|
@@ -858,7 +944,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
858
944
|
it "accepts attributes on images" do
|
859
945
|
input = <<~INPUT
|
860
946
|
#{ASCIIDOC_BLANK_HDR}
|
861
|
-
[height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
|
947
|
+
[height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE",tag=X,multilingual-rendering=common]
|
862
948
|
.Caption
|
863
949
|
image::spec/examples/rice_images/rice_image1.png[]
|
864
950
|
|
@@ -866,7 +952,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
866
952
|
output = <<~OUTPUT
|
867
953
|
#{BLANK_HDR}
|
868
954
|
<sections>
|
869
|
-
<figure id="_"><name>Caption</name>
|
955
|
+
<figure id="_" tag='X' multilingual-rendering='common'><name>Caption</name>
|
870
956
|
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="3" title="TITLE" alt="IMAGE" filename="riceimg1.png"/>
|
871
957
|
</figure>
|
872
958
|
</sections>
|
@@ -928,18 +1014,62 @@ RSpec.describe Asciidoctor::Standoc do
|
|
928
1014
|
INPUT
|
929
1015
|
expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
|
930
1016
|
.to include '<image src="data:image/png;base64'
|
1017
|
+
|
1018
|
+
input = <<~INPUT
|
1019
|
+
= Document title
|
1020
|
+
Author
|
1021
|
+
:docfile: test.adoc
|
1022
|
+
:nodoc:
|
1023
|
+
:novalid:
|
1024
|
+
:no-isobib:
|
1025
|
+
:data-uri-image: true
|
1026
|
+
|
1027
|
+
.Split-it-right sample divider
|
1028
|
+
image::spec/examples/rice_images/rice_image1.png[]
|
1029
|
+
INPUT
|
1030
|
+
expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
|
1031
|
+
.to include '<image src="data:image/png;base64'
|
1032
|
+
|
1033
|
+
input = <<~INPUT
|
1034
|
+
= Document title
|
1035
|
+
Author
|
1036
|
+
:docfile: test.adoc
|
1037
|
+
:nodoc:
|
1038
|
+
:novalid:
|
1039
|
+
:no-isobib:
|
1040
|
+
:data-uri-image: false
|
1041
|
+
|
1042
|
+
.Split-it-right sample divider
|
1043
|
+
image::spec/examples/rice_images/rice_image1.png[]
|
1044
|
+
INPUT
|
1045
|
+
expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
|
1046
|
+
.not_to include '<image src="data:image/png;base64'
|
1047
|
+
|
1048
|
+
input = <<~INPUT
|
1049
|
+
= Document title
|
1050
|
+
Author
|
1051
|
+
:docfile: test.adoc
|
1052
|
+
:nodoc:
|
1053
|
+
:novalid:
|
1054
|
+
:no-isobib:
|
1055
|
+
|
1056
|
+
.Split-it-right sample divider
|
1057
|
+
image::spec/examples/rice_images/rice_image1.png[]
|
1058
|
+
INPUT
|
1059
|
+
expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
|
1060
|
+
.to include '<image src="data:image/png;base64'
|
931
1061
|
end
|
932
1062
|
|
933
1063
|
it "accepts attributes on paragraphs" do
|
934
1064
|
input = <<~INPUT
|
935
1065
|
#{ASCIIDOC_BLANK_HDR}
|
936
|
-
[align=right,keep-with-next=true,keep-lines-together=true]
|
1066
|
+
[align=right,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
|
937
1067
|
This para is right-aligned.
|
938
1068
|
INPUT
|
939
1069
|
output = <<~OUTPUT
|
940
1070
|
#{BLANK_HDR}
|
941
1071
|
<sections>
|
942
|
-
<p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
|
1072
|
+
<p align="right" id="_" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>This para is right-aligned.</p>
|
943
1073
|
</sections>
|
944
1074
|
</standard-document>
|
945
1075
|
OUTPUT
|
@@ -952,7 +1082,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
952
1082
|
#{ASCIIDOC_BLANK_HDR}
|
953
1083
|
|
954
1084
|
[[ABC]]
|
955
|
-
[quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true]
|
1085
|
+
[quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
|
956
1086
|
____
|
957
1087
|
Block quotation
|
958
1088
|
____
|
@@ -960,7 +1090,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
960
1090
|
output = <<~OUTPUT
|
961
1091
|
#{BLANK_HDR}
|
962
1092
|
<sections>
|
963
|
-
<quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
|
1093
|
+
<quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
|
964
1094
|
<source type="inline" bibitemid="ISO7301" citeas="">
|
965
1095
|
<localityStack>
|
966
1096
|
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
@@ -982,7 +1112,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
982
1112
|
|
983
1113
|
[[ABC]]
|
984
1114
|
.Caption
|
985
|
-
[source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
|
1115
|
+
[source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
|
986
1116
|
--
|
987
1117
|
puts "Hello, world."
|
988
1118
|
%w{a b c}.each do |x|
|
@@ -993,7 +1123,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
993
1123
|
output = <<~OUTPUT
|
994
1124
|
#{BLANK_HDR}
|
995
1125
|
<sections>
|
996
|
-
<sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
1126
|
+
<sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
|
997
1127
|
<name>Caption</name>puts "Hello, world."
|
998
1128
|
%w{a b c}.each do |x|
|
999
1129
|
puts x
|
@@ -1042,6 +1172,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1042
1172
|
|
1043
1173
|
=== Term1
|
1044
1174
|
|
1175
|
+
Definition 0
|
1176
|
+
|
1045
1177
|
[.source]
|
1046
1178
|
<<ISO2191,section=1>>
|
1047
1179
|
|
@@ -1068,15 +1200,16 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1068
1200
|
<title>Terms and definitions</title><p id="_">For the purposes of this document,
|
1069
1201
|
the following terms and definitions apply.</p>
|
1070
1202
|
<term id="term-term1">
|
1071
|
-
<preferred>Term1</preferred>
|
1072
|
-
<
|
1203
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1204
|
+
<definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
|
1205
|
+
<termsource status="identical" type="authoritative">
|
1073
1206
|
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1074
1207
|
<localityStack>
|
1075
1208
|
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1076
1209
|
</localityStack>
|
1077
1210
|
</origin>
|
1078
1211
|
</termsource>
|
1079
|
-
<termsource status="identical">
|
1212
|
+
<termsource status="identical" type="authoritative">
|
1080
1213
|
<origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
|
1081
1214
|
<localityStack>
|
1082
1215
|
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
@@ -1085,21 +1218,23 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1085
1218
|
</termsource>
|
1086
1219
|
</term>
|
1087
1220
|
<term id='term-term2'>
|
1088
|
-
<preferred>Term2</preferred>
|
1221
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
1089
1222
|
<definition>
|
1223
|
+
<verbaldefinition>
|
1090
1224
|
<p id='_'>Definition</p>
|
1225
|
+
</verbaldefinition>
|
1091
1226
|
</definition>
|
1092
|
-
<termsource status='identical'>
|
1227
|
+
<termsource status='identical' type="authoritative">
|
1093
1228
|
<origin citeas=''>
|
1094
1229
|
<termref base='IEV' target='xyz'/>
|
1095
1230
|
</origin>
|
1096
1231
|
</termsource>
|
1097
|
-
<termsource status='identical'>
|
1232
|
+
<termsource status='identical' type="authoritative">
|
1098
1233
|
<origin citeas=''>
|
1099
1234
|
<termref base='IEV' target='xyz'/>
|
1100
1235
|
</origin>
|
1101
1236
|
</termsource>
|
1102
|
-
<termsource status='identical'>
|
1237
|
+
<termsource status='identical' type="authoritative">
|
1103
1238
|
<origin citeas=''>
|
1104
1239
|
<termref base='IEV' target='xyz'/>
|
1105
1240
|
</origin>
|
@@ -1120,6 +1255,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1120
1255
|
|
1121
1256
|
=== Term1
|
1122
1257
|
|
1258
|
+
Definition 0
|
1259
|
+
|
1123
1260
|
[.source]
|
1124
1261
|
<<ISO2191,section=1>>, with adjustments
|
1125
1262
|
|
@@ -1138,8 +1275,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1138
1275
|
<p id="_">For the purposes of this document,
|
1139
1276
|
the following terms and definitions apply.</p>
|
1140
1277
|
<term id="term-term1">
|
1141
|
-
<preferred>Term1</preferred>
|
1142
|
-
<
|
1278
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1279
|
+
<definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
|
1280
|
+
<termsource status="modified" type="authoritative">
|
1143
1281
|
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1144
1282
|
<localityStack>
|
1145
1283
|
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
@@ -1151,11 +1289,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1151
1289
|
</termsource>
|
1152
1290
|
</term>
|
1153
1291
|
<term id='term-term2'>
|
1154
|
-
<preferred>Term2</preferred>
|
1155
|
-
<definition>
|
1292
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
1293
|
+
<definition><verbaldefinition>
|
1156
1294
|
<p id='_'>Definition</p>
|
1157
|
-
</definition>
|
1158
|
-
<termsource status='modified'>
|
1295
|
+
</verbaldefinition></definition>
|
1296
|
+
<termsource status='modified' type="authoritative">
|
1159
1297
|
<origin citeas=''>
|
1160
1298
|
<termref base='IEV' target='xyz'/>
|
1161
1299
|
</origin>
|
@@ -1172,10 +1310,82 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1172
1310
|
.to be_equivalent_to xmlpp(output)
|
1173
1311
|
end
|
1174
1312
|
|
1313
|
+
|
1314
|
+
it "processes term source attributes" do
|
1315
|
+
input = <<~INPUT
|
1316
|
+
#{ASCIIDOC_BLANK_HDR}
|
1317
|
+
== Terms and Definitions
|
1318
|
+
|
1319
|
+
=== Term1
|
1320
|
+
|
1321
|
+
Definition 0
|
1322
|
+
|
1323
|
+
[.source,status=generalisation]
|
1324
|
+
<<ISO2191,section=1>>, with adjustments
|
1325
|
+
|
1326
|
+
=== Term2
|
1327
|
+
|
1328
|
+
Definition
|
1329
|
+
|
1330
|
+
[.source,type=lineage]
|
1331
|
+
{{<<IEV:xyz>>}}, with adjustments
|
1332
|
+
INPUT
|
1333
|
+
output = <<~OUTPUT
|
1334
|
+
#{BLANK_HDR}
|
1335
|
+
<sections>
|
1336
|
+
<terms id='_' obligation='normative'>
|
1337
|
+
<title>Terms and definitions</title>
|
1338
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1339
|
+
<term id='term-term1'>
|
1340
|
+
<preferred>
|
1341
|
+
<expression>
|
1342
|
+
<name>Term1</name>
|
1343
|
+
</expression>
|
1344
|
+
</preferred>
|
1345
|
+
<definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
|
1346
|
+
<termsource status='generalisation' type='authoritative'>
|
1347
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
1348
|
+
<localityStack>
|
1349
|
+
<locality type='section'>
|
1350
|
+
<referenceFrom>1</referenceFrom>
|
1351
|
+
</locality>
|
1352
|
+
</localityStack>
|
1353
|
+
</origin>
|
1354
|
+
<modification>
|
1355
|
+
<p id='_'>with adjustments</p>
|
1356
|
+
</modification>
|
1357
|
+
</termsource>
|
1358
|
+
</term>
|
1359
|
+
<term id='term-term2'>
|
1360
|
+
<preferred>
|
1361
|
+
<expression>
|
1362
|
+
<name>Term2</name>
|
1363
|
+
</expression>
|
1364
|
+
</preferred>
|
1365
|
+
<definition><verbaldefinition>
|
1366
|
+
<p id='_'>Definition</p>
|
1367
|
+
</verbaldefinition></definition>
|
1368
|
+
<termsource status='modified' type='lineage'>
|
1369
|
+
<origin citeas=''>
|
1370
|
+
<termref base='IEV' target='xyz'/>
|
1371
|
+
</origin>
|
1372
|
+
<modification>
|
1373
|
+
<p id='_'>with adjustments</p>
|
1374
|
+
</modification>
|
1375
|
+
</termsource>
|
1376
|
+
</term>
|
1377
|
+
</terms>
|
1378
|
+
</sections>
|
1379
|
+
</standard-document>
|
1380
|
+
OUTPUT
|
1381
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1382
|
+
.to be_equivalent_to xmlpp(output)
|
1383
|
+
end
|
1384
|
+
|
1175
1385
|
it "processes recommendation" do
|
1176
1386
|
input = <<~"INPUT"
|
1177
1387
|
#{ASCIIDOC_BLANK_HDR}
|
1178
|
-
[.recommendation,label="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc]
|
1388
|
+
[.recommendation,label="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc,tag=X,multilingual-rendering=common]
|
1179
1389
|
====
|
1180
1390
|
I recommend this
|
1181
1391
|
====
|
@@ -1183,7 +1393,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1183
1393
|
output = <<~"OUTPUT"
|
1184
1394
|
#{BLANK_HDR}
|
1185
1395
|
<sections>
|
1186
|
-
<recommendation id="_" unnumbered="true" type="verification" model="ogc">
|
1396
|
+
<recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
|
1187
1397
|
<label>/ogc/recommendation/wfs/2</label>
|
1188
1398
|
<subject>user</subject>
|
1189
1399
|
<subject>developer, implementer</subject>
|
@@ -1203,7 +1413,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1203
1413
|
input = <<~"INPUT"
|
1204
1414
|
#{ASCIIDOC_BLANK_HDR}
|
1205
1415
|
[[ABC]]
|
1206
|
-
[.requirement,subsequence="A",inherit="/ss/584/2015/level/1 & /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true]
|
1416
|
+
[.requirement,subsequence="A",inherit="/ss/584/2015/level/1 & /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
|
1207
1417
|
.Title
|
1208
1418
|
====
|
1209
1419
|
I recommend this
|
@@ -1212,7 +1422,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1212
1422
|
output = <<~OUTPUT
|
1213
1423
|
#{BLANK_HDR}
|
1214
1424
|
<sections>
|
1215
|
-
<requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
|
1425
|
+
<requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
|
1216
1426
|
<title>Title</title>
|
1217
1427
|
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
1218
1428
|
<description><p id="_">I recommend this</p></description>
|
@@ -1230,7 +1440,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1230
1440
|
#{ASCIIDOC_BLANK_HDR}
|
1231
1441
|
|
1232
1442
|
[[ABC]]
|
1233
|
-
[.permission]
|
1443
|
+
[.permission,tag=X,multilingual-rendering=common]
|
1234
1444
|
====
|
1235
1445
|
I recommend this
|
1236
1446
|
====
|
@@ -1238,7 +1448,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1238
1448
|
output = <<~"OUTPUT"
|
1239
1449
|
#{BLANK_HDR}
|
1240
1450
|
<sections>
|
1241
|
-
<permission id="ABC">
|
1451
|
+
<permission id="ABC" tag='X' multilingual-rendering='common'>
|
1242
1452
|
<description><p id="_">I recommend this</p></description>
|
1243
1453
|
</permission>
|
1244
1454
|
</sections>
|
@@ -1264,10 +1474,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1264
1474
|
=====
|
1265
1475
|
I also permit this
|
1266
1476
|
=====
|
1477
|
+
|
1478
|
+
[requirement,type="general",label="/req/core/quantities-uom"]
|
1479
|
+
======
|
1480
|
+
======
|
1267
1481
|
====
|
1268
1482
|
INPUT
|
1269
1483
|
output = <<~"OUTPUT"
|
1270
|
-
|
1484
|
+
#{BLANK_HDR}
|
1271
1485
|
<sections>
|
1272
1486
|
<permission id="_"><description><p id="_">I permit this</p>
|
1273
1487
|
<example id="_">
|
@@ -1275,7 +1489,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1275
1489
|
</example></description>
|
1276
1490
|
<permission id="_">
|
1277
1491
|
<description><p id="_">I also permit this</p></description>
|
1278
|
-
</permission
|
1492
|
+
</permission>
|
1493
|
+
<requirement id='_' type='general'>
|
1494
|
+
<label>/req/core/quantities-uom</label>
|
1495
|
+
</requirement>
|
1496
|
+
</permission>
|
1279
1497
|
</sections>
|
1280
1498
|
</standard-document>
|
1281
1499
|
OUTPUT
|
@@ -1515,4 +1733,35 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1515
1733
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1516
1734
|
.to be_equivalent_to xmlpp(output)
|
1517
1735
|
end
|
1736
|
+
|
1737
|
+
it "processes hard breaks" do
|
1738
|
+
input = <<~INPUT
|
1739
|
+
#{ASCIIDOC_BLANK_HDR}
|
1740
|
+
|
1741
|
+
[%hardbreaks]
|
1742
|
+
One hardbreak
|
1743
|
+
Two
|
1744
|
+
|
1745
|
+
Three hardbreaks +
|
1746
|
+
Four
|
1747
|
+
INPUT
|
1748
|
+
output = <<~OUTPUT
|
1749
|
+
#{BLANK_HDR}
|
1750
|
+
<sections>
|
1751
|
+
<p id='_'>
|
1752
|
+
One hardbreak
|
1753
|
+
<br/>
|
1754
|
+
Two
|
1755
|
+
</p>
|
1756
|
+
<p id='_'>
|
1757
|
+
Three hardbreaks
|
1758
|
+
<br/>
|
1759
|
+
Four
|
1760
|
+
</p>
|
1761
|
+
</sections>
|
1762
|
+
</standard-document>
|
1763
|
+
OUTPUT
|
1764
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1765
|
+
.to be_equivalent_to xmlpp(output)
|
1766
|
+
end
|
1518
1767
|
end
|