metanorma-standoc 1.10.7 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +19 -23
  3. data/Rakefile +1 -1
  4. data/lib/asciidoctor/standoc/base.rb +7 -4
  5. data/lib/asciidoctor/standoc/basicdoc.rng +21 -4
  6. data/lib/asciidoctor/standoc/blocks.rb +23 -23
  7. data/lib/asciidoctor/standoc/blocks_notes.rb +17 -22
  8. data/lib/asciidoctor/standoc/cleanup.rb +20 -11
  9. data/lib/asciidoctor/standoc/cleanup_image.rb +6 -7
  10. data/lib/asciidoctor/standoc/cleanup_inline.rb +45 -7
  11. data/lib/asciidoctor/standoc/cleanup_maths.rb +5 -6
  12. data/lib/asciidoctor/standoc/cleanup_ref.rb +5 -0
  13. data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -21
  14. data/lib/asciidoctor/standoc/cleanup_symbols.rb +48 -0
  15. data/lib/asciidoctor/standoc/cleanup_terms.rb +48 -77
  16. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +162 -0
  17. data/lib/asciidoctor/standoc/cleanup_text.rb +23 -0
  18. data/lib/asciidoctor/standoc/converter.rb +2 -0
  19. data/lib/asciidoctor/standoc/inline.rb +7 -5
  20. data/lib/asciidoctor/standoc/isodoc.rng +420 -76
  21. data/lib/asciidoctor/standoc/lists.rb +14 -16
  22. data/lib/asciidoctor/standoc/macros_plantuml.rb +29 -14
  23. data/lib/asciidoctor/standoc/macros_terms.rb +55 -8
  24. data/lib/asciidoctor/standoc/ref.rb +1 -1
  25. data/lib/asciidoctor/standoc/ref_sect.rb +26 -18
  26. data/lib/asciidoctor/standoc/reqt.rng +23 -2
  27. data/lib/asciidoctor/standoc/section.rb +13 -12
  28. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +50 -11
  29. data/lib/asciidoctor/standoc/terms.rb +12 -2
  30. data/lib/asciidoctor/standoc/utils.rb +36 -23
  31. data/lib/asciidoctor/standoc/validate.rb +45 -27
  32. data/lib/asciidoctor/standoc/validate_section.rb +5 -2
  33. data/lib/metanorma/standoc/version.rb +1 -1
  34. data/metanorma-standoc.gemspec +1 -1
  35. data/spec/asciidoctor/base_spec.rb +4 -3
  36. data/spec/asciidoctor/blocks_spec.rb +230 -49
  37. data/spec/asciidoctor/cleanup_sections_spec.rb +7 -7
  38. data/spec/asciidoctor/cleanup_spec.rb +105 -286
  39. data/spec/asciidoctor/cleanup_terms_spec.rb +1020 -0
  40. data/spec/asciidoctor/inline_spec.rb +2 -2
  41. data/spec/asciidoctor/lists_spec.rb +6 -6
  42. data/spec/asciidoctor/macros_plantuml_spec.rb +36 -1
  43. data/spec/asciidoctor/macros_spec.rb +190 -113
  44. data/spec/asciidoctor/refs_dl_spec.rb +4 -4
  45. data/spec/asciidoctor/refs_spec.rb +268 -108
  46. data/spec/asciidoctor/section_spec.rb +18 -18
  47. data/spec/asciidoctor/validate_spec.rb +87 -2
  48. data/spec/spec_helper.rb +8 -8
  49. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +50 -50
  50. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
  51. data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
  52. data/spec/vcr_cassettes/isobib_get_123_1.yml +25 -25
  53. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +31 -31
  54. data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
  55. data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
  56. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  57. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +45 -45
  58. metadata +8 -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>
@@ -353,10 +353,11 @@ RSpec.describe Asciidoctor::Standoc do
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
355
  <term id='term-term1'>
356
- <preferred>Term1</preferred>
356
+ <preferred><expression><name>Term1</name></expression></preferred>
357
357
  <definition>
358
+ <verbaldefinition>
358
359
  <p id='_'>first definition</p>
359
- <termsource status='identical'>
360
+ <termsource status='identical' type="authoritative">
360
361
  <origin bibitemid='ISO2191' type='inline' citeas=''>
361
362
  <localityStack>
362
363
  <locality type='section'>
@@ -365,10 +366,12 @@ RSpec.describe Asciidoctor::Standoc do
365
366
  </localityStack>
366
367
  </origin>
367
368
  </termsource>
369
+ </verbaldefinition>
368
370
  </definition>
369
371
  <definition>
372
+ <verbaldefinition>
370
373
  <p id='_'>second definition</p>
371
- <termsource status='identical'>
374
+ <termsource status='identical' type="authoritative">
372
375
  <origin bibitemid='ISO2191' type='inline' citeas=''>
373
376
  <localityStack>
374
377
  <locality type='section'>
@@ -377,11 +380,12 @@ RSpec.describe Asciidoctor::Standoc do
377
380
  </localityStack>
378
381
  </origin>
379
382
  </termsource>
383
+ </verbaldefinition>
380
384
  </definition>
381
385
  <termnote id='_'>
382
386
  <p id='_'>This is a note</p>
383
387
  </termnote>
384
- <termsource status='identical'>
388
+ <termsource status='identical' type="authoritative">
385
389
  <origin bibitemid='ISO2191' type='inline' citeas=''>
386
390
  <localityStack>
387
391
  <locality type='section'>
@@ -408,7 +412,7 @@ RSpec.describe Asciidoctor::Standoc do
408
412
 
409
413
  NOTE: This is a note
410
414
 
411
- [NOTE,keep-separate=true]
415
+ [NOTE,keep-separate=true,tag=X,multilingual-rendering=common]
412
416
  ====
413
417
  XYZ
414
418
  ====
@@ -420,11 +424,11 @@ RSpec.describe Asciidoctor::Standoc do
420
424
  <title>Terms and definitions</title>
421
425
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
422
426
  <term id="term-term1">
423
- <preferred>Term1</preferred>
427
+ <preferred><expression><name>Term1</name></expression></preferred>
424
428
  <termnote id="_">
425
429
  <p id="_">This is a note</p>
426
430
  </termnote>
427
- <termnote id='_'>
431
+ <termnote id='_' tag='X' multilingual-rendering='common'>
428
432
  <p id='_'>XYZ</p>
429
433
  </termnote>
430
434
  </term>
@@ -495,7 +499,7 @@ RSpec.describe Asciidoctor::Standoc do
495
499
  <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
496
500
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
497
501
  <term id="term-term1">
498
- <preferred>Term1</preferred>
502
+ <preferred><expression><name>Term1</name></expression></preferred>
499
503
  </term>
500
504
  <definitions id="_" obligation="normative" type="symbols">
501
505
  <title>Symbols</title>
@@ -510,6 +514,59 @@ RSpec.describe Asciidoctor::Standoc do
510
514
  .to be_equivalent_to xmlpp(output)
511
515
  end
512
516
 
517
+ it "processes nested terms" do
518
+ input = <<~INPUT
519
+ #{ASCIIDOC_BLANK_HDR}
520
+ == Terms and Definitions
521
+
522
+ [.term]
523
+ === Term1
524
+
525
+ definition
526
+
527
+ NOTE: Note 1
528
+
529
+ ==== Term11
530
+ definition2
531
+
532
+ NOTE: Note 2
533
+ INPUT
534
+ output = <<~OUTPUT
535
+ #{BLANK_HDR}
536
+ <sections>
537
+ <clause id='_' obligation='normative'>
538
+ <title>Terms and definitions</title>
539
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
540
+ <terms id='_' obligation='normative'>
541
+ <title>Term1</title>
542
+ <p id='_'>definition</p>
543
+ <note id='_'>
544
+ <p id='_'>Note 1</p>
545
+ </note>
546
+ <term id='term-term11'>
547
+ <preferred>
548
+ <expression>
549
+ <name>Term11</name>
550
+ </expression>
551
+ </preferred>
552
+ <definition>
553
+ <verbaldefinition>
554
+ <p id='_'>definition2</p>
555
+ </verbaldefinition>
556
+ </definition>
557
+ <termnote id='_'>
558
+ <p id='_'>Note 2</p>
559
+ </termnote>
560
+ </term>
561
+ </terms>
562
+ </clause>
563
+ </sections>
564
+ </standard-document>
565
+ OUTPUT
566
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
567
+ .to be_equivalent_to xmlpp(output)
568
+ end
569
+
513
570
  it "processes notes" do
514
571
  input = <<~INPUT
515
572
  #{ASCIIDOC_BLANK_HDR}
@@ -520,7 +577,7 @@ RSpec.describe Asciidoctor::Standoc do
520
577
  [[ABC]]
521
578
  NOTE: This is a note
522
579
 
523
- [NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified]
580
+ [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]
524
581
  ====
525
582
  XYZ
526
583
  ====
@@ -533,7 +590,7 @@ RSpec.describe Asciidoctor::Standoc do
533
590
  <p id="_">This is a note</p>
534
591
  </note>
535
592
  </foreword></preface><sections>
536
- <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
593
+ <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified" tag='X' multilingual-rendering='common'>
537
594
  <p id='_'>XYZ</p>
538
595
  </note>
539
596
  <clause id="_" inline-header="false" obligation="normative">
@@ -555,7 +612,7 @@ RSpec.describe Asciidoctor::Standoc do
555
612
  #{ASCIIDOC_BLANK_HDR}
556
613
 
557
614
  [[ABC]]
558
- [alt=Literal,keep-with-next=true,keep-lines-together=true]
615
+ [alt=Literal,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
559
616
  ....
560
617
  <LITERAL>
561
618
  FIGURATIVE
@@ -564,7 +621,7 @@ RSpec.describe Asciidoctor::Standoc do
564
621
  output = <<~OUTPUT
565
622
  #{BLANK_HDR}
566
623
  <sections>
567
- <figure id="ABC" keep-with-next="true" keep-lines-together="true">
624
+ <figure id="ABC" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
568
625
  <pre alt="Literal" id="_">&lt;LITERAL&gt;
569
626
  FIGURATIVE
570
627
  </pre>
@@ -601,7 +658,7 @@ RSpec.describe Asciidoctor::Standoc do
601
658
  #{ASCIIDOC_BLANK_HDR}
602
659
 
603
660
  [[ABC]]
604
- [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
661
+ [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true",tag=X,multilingual-rendering=common]
605
662
  .Precautions
606
663
  ====
607
664
  While werewolves are hardy community members, keep in mind the following dietary concerns:
@@ -614,7 +671,7 @@ RSpec.describe Asciidoctor::Standoc do
614
671
  output = <<~OUTPUT
615
672
  #{BLANK_HDR}
616
673
  <sections>
617
- <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
674
+ <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
618
675
  <name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
619
676
  <ol id="_" type="arabic">
620
677
  <li>
@@ -643,7 +700,7 @@ RSpec.describe Asciidoctor::Standoc do
643
700
  === Term1
644
701
 
645
702
  [[ABC]]
646
- [example]
703
+ [example,tag=X,multilingual-rendering=common]
647
704
  This is an example
648
705
  INPUT
649
706
  output = <<~OUTPUT
@@ -653,8 +710,8 @@ RSpec.describe Asciidoctor::Standoc do
653
710
  <title>Terms and definitions</title>
654
711
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
655
712
  <term id="term-term1">
656
- <preferred>Term1</preferred>
657
- <termexample id="ABC">
713
+ <preferred><expression><name>Term1</name></expression></preferred>
714
+ <termexample id="ABC" tag='X' multilingual-rendering='common'>
658
715
  <p id="_">This is an example</p>
659
716
  </termexample></term>
660
717
  </terms>
@@ -713,7 +770,7 @@ RSpec.describe Asciidoctor::Standoc do
713
770
  <sections>
714
771
  <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
715
772
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
716
- <preferred>Term1</preferred>
773
+ <preferred><expression><name>Term1</name></expression></preferred>
717
774
  </term>
718
775
  <definitions id="_" obligation="normative" type="symbols">
719
776
  <title>Symbols</title>
@@ -733,7 +790,7 @@ RSpec.describe Asciidoctor::Standoc do
733
790
  #{ASCIIDOC_BLANK_HDR}
734
791
 
735
792
  [[ABC]]
736
- [example,subsequence=A,keep-with-next=true,keep-lines-together=next]
793
+ [example,subsequence=A,keep-with-next=true,keep-lines-together=next,tag=X,multilingual-rendering=common]
737
794
  .Title
738
795
  ====
739
796
  This is an example
@@ -754,7 +811,7 @@ RSpec.describe Asciidoctor::Standoc do
754
811
  output = <<~OUTPUT
755
812
  #{BLANK_HDR}
756
813
  <sections>
757
- <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
814
+ <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next' tag='X' multilingual-rendering='common'>
758
815
  <name>Title</name>
759
816
  <p id="_">This is an example</p>
760
817
  <p id="_">Amen</p></example>
@@ -940,7 +997,7 @@ RSpec.describe Asciidoctor::Standoc do
940
997
  it "accepts attributes on images" do
941
998
  input = <<~INPUT
942
999
  #{ASCIIDOC_BLANK_HDR}
943
- [height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
1000
+ [height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE",tag=X,multilingual-rendering=common]
944
1001
  .Caption
945
1002
  image::spec/examples/rice_images/rice_image1.png[]
946
1003
 
@@ -948,7 +1005,7 @@ RSpec.describe Asciidoctor::Standoc do
948
1005
  output = <<~OUTPUT
949
1006
  #{BLANK_HDR}
950
1007
  <sections>
951
- <figure id="_"><name>Caption</name>
1008
+ <figure id="_" tag='X' multilingual-rendering='common'><name>Caption</name>
952
1009
  <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="3" title="TITLE" alt="IMAGE" filename="riceimg1.png"/>
953
1010
  </figure>
954
1011
  </sections>
@@ -1010,18 +1067,62 @@ RSpec.describe Asciidoctor::Standoc do
1010
1067
  INPUT
1011
1068
  expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1012
1069
  .to include '<image src="data:image/png;base64'
1070
+
1071
+ input = <<~INPUT
1072
+ = Document title
1073
+ Author
1074
+ :docfile: test.adoc
1075
+ :nodoc:
1076
+ :novalid:
1077
+ :no-isobib:
1078
+ :data-uri-image: true
1079
+
1080
+ .Split-it-right sample divider
1081
+ image::spec/examples/rice_images/rice_image1.png[]
1082
+ INPUT
1083
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1084
+ .to include '<image src="data:image/png;base64'
1085
+
1086
+ input = <<~INPUT
1087
+ = Document title
1088
+ Author
1089
+ :docfile: test.adoc
1090
+ :nodoc:
1091
+ :novalid:
1092
+ :no-isobib:
1093
+ :data-uri-image: false
1094
+
1095
+ .Split-it-right sample divider
1096
+ image::spec/examples/rice_images/rice_image1.png[]
1097
+ INPUT
1098
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1099
+ .not_to include '<image src="data:image/png;base64'
1100
+
1101
+ input = <<~INPUT
1102
+ = Document title
1103
+ Author
1104
+ :docfile: test.adoc
1105
+ :nodoc:
1106
+ :novalid:
1107
+ :no-isobib:
1108
+
1109
+ .Split-it-right sample divider
1110
+ image::spec/examples/rice_images/rice_image1.png[]
1111
+ INPUT
1112
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1113
+ .to include '<image src="data:image/png;base64'
1013
1114
  end
1014
1115
 
1015
1116
  it "accepts attributes on paragraphs" do
1016
1117
  input = <<~INPUT
1017
1118
  #{ASCIIDOC_BLANK_HDR}
1018
- [align=right,keep-with-next=true,keep-lines-together=true]
1119
+ [align=right,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1019
1120
  This para is right-aligned.
1020
1121
  INPUT
1021
1122
  output = <<~OUTPUT
1022
1123
  #{BLANK_HDR}
1023
1124
  <sections>
1024
- <p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
1125
+ <p align="right" id="_" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>This para is right-aligned.</p>
1025
1126
  </sections>
1026
1127
  </standard-document>
1027
1128
  OUTPUT
@@ -1034,7 +1135,7 @@ RSpec.describe Asciidoctor::Standoc do
1034
1135
  #{ASCIIDOC_BLANK_HDR}
1035
1136
 
1036
1137
  [[ABC]]
1037
- [quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true]
1138
+ [quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1038
1139
  ____
1039
1140
  Block quotation
1040
1141
  ____
@@ -1042,7 +1143,7 @@ RSpec.describe Asciidoctor::Standoc do
1042
1143
  output = <<~OUTPUT
1043
1144
  #{BLANK_HDR}
1044
1145
  <sections>
1045
- <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
1146
+ <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1046
1147
  <source type="inline" bibitemid="ISO7301" citeas="">
1047
1148
  <localityStack>
1048
1149
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -1064,7 +1165,7 @@ RSpec.describe Asciidoctor::Standoc do
1064
1165
 
1065
1166
  [[ABC]]
1066
1167
  .Caption
1067
- [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
1168
+ [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1068
1169
  --
1069
1170
  puts "Hello, world."
1070
1171
  %w{a b c}.each do |x|
@@ -1075,7 +1176,7 @@ RSpec.describe Asciidoctor::Standoc do
1075
1176
  output = <<~OUTPUT
1076
1177
  #{BLANK_HDR}
1077
1178
  <sections>
1078
- <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
1179
+ <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'>
1079
1180
  <name>Caption</name>puts "Hello, world."
1080
1181
  %w{a b c}.each do |x|
1081
1182
  puts x
@@ -1124,6 +1225,8 @@ RSpec.describe Asciidoctor::Standoc do
1124
1225
 
1125
1226
  === Term1
1126
1227
 
1228
+ Definition 0
1229
+
1127
1230
  [.source]
1128
1231
  <<ISO2191,section=1>>
1129
1232
 
@@ -1150,15 +1253,16 @@ RSpec.describe Asciidoctor::Standoc do
1150
1253
  <title>Terms and definitions</title><p id="_">For the purposes of this document,
1151
1254
  the following terms and definitions apply.</p>
1152
1255
  <term id="term-term1">
1153
- <preferred>Term1</preferred>
1154
- <termsource status="identical">
1256
+ <preferred><expression><name>Term1</name></expression></preferred>
1257
+ <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1258
+ <termsource status="identical" type="authoritative">
1155
1259
  <origin bibitemid="ISO2191" type="inline" citeas="">
1156
1260
  <localityStack>
1157
1261
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
1158
1262
  </localityStack>
1159
1263
  </origin>
1160
1264
  </termsource>
1161
- <termsource status="identical">
1265
+ <termsource status="identical" type="authoritative">
1162
1266
  <origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
1163
1267
  <localityStack>
1164
1268
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -1167,21 +1271,23 @@ RSpec.describe Asciidoctor::Standoc do
1167
1271
  </termsource>
1168
1272
  </term>
1169
1273
  <term id='term-term2'>
1170
- <preferred>Term2</preferred>
1274
+ <preferred><expression><name>Term2</name></expression></preferred>
1171
1275
  <definition>
1276
+ <verbaldefinition>
1172
1277
  <p id='_'>Definition</p>
1278
+ </verbaldefinition>
1173
1279
  </definition>
1174
- <termsource status='identical'>
1280
+ <termsource status='identical' type="authoritative">
1175
1281
  <origin citeas=''>
1176
1282
  <termref base='IEV' target='xyz'/>
1177
1283
  </origin>
1178
1284
  </termsource>
1179
- <termsource status='identical'>
1285
+ <termsource status='identical' type="authoritative">
1180
1286
  <origin citeas=''>
1181
1287
  <termref base='IEV' target='xyz'/>
1182
1288
  </origin>
1183
1289
  </termsource>
1184
- <termsource status='identical'>
1290
+ <termsource status='identical' type="authoritative">
1185
1291
  <origin citeas=''>
1186
1292
  <termref base='IEV' target='xyz'/>
1187
1293
  </origin>
@@ -1202,6 +1308,8 @@ RSpec.describe Asciidoctor::Standoc do
1202
1308
 
1203
1309
  === Term1
1204
1310
 
1311
+ Definition 0
1312
+
1205
1313
  [.source]
1206
1314
  <<ISO2191,section=1>>, with adjustments
1207
1315
 
@@ -1220,8 +1328,9 @@ RSpec.describe Asciidoctor::Standoc do
1220
1328
  <p id="_">For the purposes of this document,
1221
1329
  the following terms and definitions apply.</p>
1222
1330
  <term id="term-term1">
1223
- <preferred>Term1</preferred>
1224
- <termsource status="modified">
1331
+ <preferred><expression><name>Term1</name></expression></preferred>
1332
+ <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1333
+ <termsource status="modified" type="authoritative">
1225
1334
  <origin bibitemid="ISO2191" type="inline" citeas="">
1226
1335
  <localityStack>
1227
1336
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -1233,11 +1342,11 @@ RSpec.describe Asciidoctor::Standoc do
1233
1342
  </termsource>
1234
1343
  </term>
1235
1344
  <term id='term-term2'>
1236
- <preferred>Term2</preferred>
1237
- <definition>
1345
+ <preferred><expression><name>Term2</name></expression></preferred>
1346
+ <definition><verbaldefinition>
1238
1347
  <p id='_'>Definition</p>
1239
- </definition>
1240
- <termsource status='modified'>
1348
+ </verbaldefinition></definition>
1349
+ <termsource status='modified' type="authoritative">
1241
1350
  <origin citeas=''>
1242
1351
  <termref base='IEV' target='xyz'/>
1243
1352
  </origin>
@@ -1254,10 +1363,82 @@ RSpec.describe Asciidoctor::Standoc do
1254
1363
  .to be_equivalent_to xmlpp(output)
1255
1364
  end
1256
1365
 
1366
+
1367
+ it "processes term source attributes" do
1368
+ input = <<~INPUT
1369
+ #{ASCIIDOC_BLANK_HDR}
1370
+ == Terms and Definitions
1371
+
1372
+ === Term1
1373
+
1374
+ Definition 0
1375
+
1376
+ [.source,status=generalisation]
1377
+ <<ISO2191,section=1>>, with adjustments
1378
+
1379
+ === Term2
1380
+
1381
+ Definition
1382
+
1383
+ [.source,type=lineage]
1384
+ {{<<IEV:xyz>>}}, with adjustments
1385
+ INPUT
1386
+ output = <<~OUTPUT
1387
+ #{BLANK_HDR}
1388
+ <sections>
1389
+ <terms id='_' obligation='normative'>
1390
+ <title>Terms and definitions</title>
1391
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1392
+ <term id='term-term1'>
1393
+ <preferred>
1394
+ <expression>
1395
+ <name>Term1</name>
1396
+ </expression>
1397
+ </preferred>
1398
+ <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1399
+ <termsource status='generalisation' type='authoritative'>
1400
+ <origin bibitemid='ISO2191' type='inline' citeas=''>
1401
+ <localityStack>
1402
+ <locality type='section'>
1403
+ <referenceFrom>1</referenceFrom>
1404
+ </locality>
1405
+ </localityStack>
1406
+ </origin>
1407
+ <modification>
1408
+ <p id='_'>with adjustments</p>
1409
+ </modification>
1410
+ </termsource>
1411
+ </term>
1412
+ <term id='term-term2'>
1413
+ <preferred>
1414
+ <expression>
1415
+ <name>Term2</name>
1416
+ </expression>
1417
+ </preferred>
1418
+ <definition><verbaldefinition>
1419
+ <p id='_'>Definition</p>
1420
+ </verbaldefinition></definition>
1421
+ <termsource status='modified' type='lineage'>
1422
+ <origin citeas=''>
1423
+ <termref base='IEV' target='xyz'/>
1424
+ </origin>
1425
+ <modification>
1426
+ <p id='_'>with adjustments</p>
1427
+ </modification>
1428
+ </termsource>
1429
+ </term>
1430
+ </terms>
1431
+ </sections>
1432
+ </standard-document>
1433
+ OUTPUT
1434
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1435
+ .to be_equivalent_to xmlpp(output)
1436
+ end
1437
+
1257
1438
  it "processes recommendation" do
1258
1439
  input = <<~"INPUT"
1259
1440
  #{ASCIIDOC_BLANK_HDR}
1260
- [.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]
1441
+ [.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]
1261
1442
  ====
1262
1443
  I recommend this
1263
1444
  ====
@@ -1265,7 +1446,7 @@ RSpec.describe Asciidoctor::Standoc do
1265
1446
  output = <<~"OUTPUT"
1266
1447
  #{BLANK_HDR}
1267
1448
  <sections>
1268
- <recommendation id="_" unnumbered="true" type="verification" model="ogc">
1449
+ <recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
1269
1450
  <label>/ogc/recommendation/wfs/2</label>
1270
1451
  <subject>user</subject>
1271
1452
  <subject>developer, implementer</subject>
@@ -1285,7 +1466,7 @@ RSpec.describe Asciidoctor::Standoc do
1285
1466
  input = <<~"INPUT"
1286
1467
  #{ASCIIDOC_BLANK_HDR}
1287
1468
  [[ABC]]
1288
- [.requirement,subsequence="A",inherit="/ss/584/2015/level/1 &amp; /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true]
1469
+ [.requirement,subsequence="A",inherit="/ss/584/2015/level/1 &amp; /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1289
1470
  .Title
1290
1471
  ====
1291
1472
  I recommend this
@@ -1294,7 +1475,7 @@ RSpec.describe Asciidoctor::Standoc do
1294
1475
  output = <<~OUTPUT
1295
1476
  #{BLANK_HDR}
1296
1477
  <sections>
1297
- <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
1478
+ <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1298
1479
  <title>Title</title>
1299
1480
  <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
1300
1481
  <description><p id="_">I recommend this</p></description>
@@ -1312,7 +1493,7 @@ RSpec.describe Asciidoctor::Standoc do
1312
1493
  #{ASCIIDOC_BLANK_HDR}
1313
1494
 
1314
1495
  [[ABC]]
1315
- [.permission]
1496
+ [.permission,tag=X,multilingual-rendering=common]
1316
1497
  ====
1317
1498
  I recommend this
1318
1499
  ====
@@ -1320,7 +1501,7 @@ RSpec.describe Asciidoctor::Standoc do
1320
1501
  output = <<~"OUTPUT"
1321
1502
  #{BLANK_HDR}
1322
1503
  <sections>
1323
- <permission id="ABC">
1504
+ <permission id="ABC" tag='X' multilingual-rendering='common'>
1324
1505
  <description><p id="_">I recommend this</p></description>
1325
1506
  </permission>
1326
1507
  </sections>
@@ -28,8 +28,8 @@ RSpec.describe Asciidoctor::Standoc do
28
28
  </li>
29
29
  </ul>
30
30
  <term id="term-time">
31
- <preferred>Time</preferred>
32
- <definition><p id="_">This paragraph is extraneous</p></definition>
31
+ <preferred><expression><name>Time</name></expression></preferred>
32
+ <definition><verbaldefinition><p id="_">This paragraph is extraneous</p></verbaldefinition></definition>
33
33
  </term></terms>
34
34
  </sections>
35
35
  </standard-document>
@@ -521,7 +521,7 @@ RSpec.describe Asciidoctor::Standoc do
521
521
  </title>
522
522
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
523
523
  <term id='term-term1'>
524
- <preferred>Term1</preferred>
524
+ <preferred><expression><name>Term1</name></expression></preferred>
525
525
  </term>
526
526
  </terms>
527
527
  <clause id='_' inline-header='false' obligation='normative'>
@@ -796,7 +796,7 @@ RSpec.describe Asciidoctor::Standoc do
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
798
  <term id='term-term1'>
799
- <preferred>Term1</preferred>
799
+ <preferred><expression><name>Term1</name></expression></preferred>
800
800
  </term>
801
801
  </terms>
802
802
  <clause id='_' inline-header='false' obligation='normative'>
@@ -1033,7 +1033,7 @@ RSpec.describe Asciidoctor::Standoc do
1033
1033
  s’appliquent.
1034
1034
  </p>
1035
1035
  <term id='term-term1'>
1036
- <preferred>Term1</preferred>
1036
+ <preferred><expression><name>Term1</name></expression></preferred>
1037
1037
  </term>
1038
1038
  </terms>
1039
1039
  <clause id='_' inline-header='false' obligation='normative'>
@@ -1267,7 +1267,7 @@ RSpec.describe Asciidoctor::Standoc do
1267
1267
  <title>术语和定义</title>
1268
1268
  <p id='_'>下列术语和定义适用于本文件。</p>
1269
1269
  <term id='term-term1'>
1270
- <preferred>Term1</preferred>
1270
+ <preferred><expression><name>Term1</name></expression></preferred>
1271
1271
  </term>
1272
1272
  </terms>
1273
1273
  <clause id='_' inline-header='false' obligation='normative'>
@@ -1501,7 +1501,7 @@ RSpec.describe Asciidoctor::Standoc do
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
1503
  <term id='term-term1'>
1504
- <preferred>Term1</preferred>
1504
+ <preferred><expression><name>Term1</name></expression></preferred>
1505
1505
  </term>
1506
1506
  </terms>
1507
1507
  <clause id='_' inline-header='false' obligation='normative'>