metanorma-standoc 1.11.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -31
  3. data/.gitignore +23 -0
  4. data/Gemfile +2 -0
  5. data/lib/asciidoctor/standoc/base.rb +2 -241
  6. data/lib/asciidoctor/standoc/blocks.rb +2 -238
  7. data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
  8. data/lib/asciidoctor/standoc/cleanup.rb +2 -207
  9. data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
  10. data/lib/asciidoctor/standoc/cleanup_block.rb +2 -173
  11. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -204
  12. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
  13. data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
  14. data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -179
  15. data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
  16. data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
  17. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -93
  18. data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
  19. data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
  20. data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
  21. data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
  22. data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
  23. data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -113
  24. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -161
  25. data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
  26. data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
  27. data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
  28. data/lib/asciidoctor/standoc/converter.rb +2 -123
  29. data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
  30. data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
  31. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
  32. data/lib/asciidoctor/standoc/deprecated.rb +5 -0
  33. data/lib/asciidoctor/standoc/front.rb +2 -219
  34. data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
  35. data/lib/asciidoctor/standoc/inline.rb +2 -229
  36. data/lib/asciidoctor/standoc/lists.rb +2 -119
  37. data/lib/asciidoctor/standoc/macros.rb +2 -203
  38. data/lib/asciidoctor/standoc/macros_form.rb +2 -62
  39. data/lib/asciidoctor/standoc/macros_note.rb +2 -44
  40. data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
  41. data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
  42. data/lib/asciidoctor/standoc/ref.rb +2 -225
  43. data/lib/asciidoctor/standoc/ref_sect.rb +2 -143
  44. data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
  45. data/lib/asciidoctor/standoc/render.rb +3 -0
  46. data/lib/asciidoctor/standoc/reqt.rb +2 -89
  47. data/lib/asciidoctor/standoc/section.rb +2 -190
  48. data/lib/asciidoctor/standoc/table.rb +2 -84
  49. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
  50. data/lib/asciidoctor/standoc/terms.rb +2 -153
  51. data/lib/asciidoctor/standoc/utils.rb +2 -116
  52. data/lib/asciidoctor/standoc/validate.rb +2 -157
  53. data/lib/asciidoctor/standoc/validate_section.rb +2 -54
  54. data/lib/isodoc/html/htmlstyle.css +20 -11
  55. data/lib/isodoc/html/htmlstyle.scss +11 -11
  56. data/lib/metanorma/standoc/base.rb +149 -0
  57. data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
  58. data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +0 -0
  59. data/lib/metanorma/standoc/blocks.rb +239 -0
  60. data/lib/metanorma/standoc/blocks_notes.rb +101 -0
  61. data/lib/metanorma/standoc/cleanup.rb +146 -0
  62. data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
  63. data/lib/metanorma/standoc/cleanup_block.rb +173 -0
  64. data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
  65. data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
  66. data/lib/metanorma/standoc/cleanup_image.rb +70 -0
  67. data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
  68. data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
  69. data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
  70. data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
  71. data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
  72. data/lib/metanorma/standoc/cleanup_section.rb +212 -0
  73. data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
  74. data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
  75. data/lib/metanorma/standoc/cleanup_table.rb +68 -0
  76. data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
  77. data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
  78. data/lib/metanorma/standoc/cleanup_text.rb +96 -0
  79. data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
  80. data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
  81. data/lib/metanorma/standoc/converter.rb +124 -0
  82. data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
  83. data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
  84. data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
  85. data/lib/metanorma/standoc/front.rb +224 -0
  86. data/lib/metanorma/standoc/front_contributor.rb +192 -0
  87. data/lib/metanorma/standoc/inline.rb +232 -0
  88. data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +90 -18
  89. data/lib/metanorma/standoc/lists.rb +120 -0
  90. data/lib/metanorma/standoc/macros.rb +204 -0
  91. data/lib/metanorma/standoc/macros_form.rb +63 -0
  92. data/lib/metanorma/standoc/macros_note.rb +45 -0
  93. data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
  94. data/lib/metanorma/standoc/macros_terms.rb +181 -0
  95. data/lib/metanorma/standoc/ref.rb +243 -0
  96. data/lib/metanorma/standoc/ref_sect.rb +153 -0
  97. data/lib/metanorma/standoc/ref_utility.rb +129 -0
  98. data/lib/metanorma/standoc/render.rb +115 -0
  99. data/lib/metanorma/standoc/reqt.rb +90 -0
  100. data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
  101. data/lib/metanorma/standoc/section.rb +209 -0
  102. data/lib/metanorma/standoc/table.rb +85 -0
  103. data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
  104. data/lib/metanorma/standoc/terms.rb +160 -0
  105. data/lib/metanorma/standoc/utils.rb +101 -0
  106. data/lib/metanorma/standoc/validate.rb +158 -0
  107. data/lib/metanorma/standoc/validate_section.rb +55 -0
  108. data/lib/metanorma/standoc/version.rb +1 -1
  109. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
  110. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
  111. data/lib/metanorma-standoc.rb +1 -1
  112. data/metanorma-standoc.gemspec +4 -4
  113. data/spec/{asciidoctor → metanorma}/base_spec.rb +73 -8
  114. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  115. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +49 -20
  116. data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +25 -1
  117. data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +2 -2
  118. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +9 -9
  119. data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +528 -91
  120. data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +22 -22
  121. data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +17 -17
  122. data/spec/{asciidoctor → metanorma}/inline_spec.rb +175 -6
  123. data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +5 -9
  124. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  125. data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
  126. data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
  127. data/spec/{asciidoctor → metanorma}/macros_spec.rb +8 -8
  128. data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
  129. data/spec/metanorma/refs_dl_spec.rb +863 -0
  130. data/spec/{asciidoctor → metanorma}/refs_spec.rb +1277 -687
  131. data/spec/{asciidoctor → metanorma}/section_spec.rb +90 -3
  132. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  133. data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
  134. data/spec/spec_helper.rb +0 -1
  135. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +179 -179
  136. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
  137. data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
  138. data/spec/vcr_cassettes/isobib_get_123_1.yml +98 -98
  139. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +111 -111
  140. data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
  141. data/spec/vcr_cassettes/isobib_get_124.yml +14 -14
  142. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  143. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  144. metadata +89 -38
  145. data/lib/asciidoctor/standoc/ref_date_id.rb +0 -62
  146. data/spec/asciidoctor/refs_dl_spec.rb +0 -864
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
  require "relaton_iec"
3
3
  require "fileutils"
4
4
 
5
- RSpec.describe Asciidoctor::Standoc do
5
+ RSpec.describe Metanorma::Standoc do
6
6
  it "processes term and designation metadata and term sources" do
7
7
  input = <<~INPUT
8
8
  #{ASCIIDOC_BLANK_HDR}
@@ -15,11 +15,12 @@ RSpec.describe Asciidoctor::Standoc do
15
15
  script:: Latn
16
16
  type:: prefix
17
17
  isInternational:: true
18
- abbreviationType:: acronym
18
+ abbreviation-type:: acronym
19
19
  pronunciation:: fəɹst
20
20
  domain:: Hydraulics
21
21
  subject:: pipes
22
- usageinfo:: This is usage.
22
+ field-of-application:: Field
23
+ usage-info:: This is usage.
23
24
 
24
25
  [.source]
25
26
  <<ISO2191,section=1>>
@@ -32,7 +33,7 @@ RSpec.describe Asciidoctor::Standoc do
32
33
  type:: suffix
33
34
  domain:: Hydraulics1
34
35
  subject: pipes1
35
- usageinfo:: This is usage 1.
36
+ usage-info:: This is usage 1.
36
37
  absent:: true
37
38
 
38
39
  deprecated:[Fourth Designation]
@@ -41,12 +42,14 @@ RSpec.describe Asciidoctor::Standoc do
41
42
  language:: jp
42
43
  script:: Japn
43
44
  type:: full
45
+ field-of-application:: Field
44
46
  grammar::
45
47
  gender::: masculine, feminine
48
+ number::: singular, plural
46
49
  isPreposition::: false
47
50
  isNoun::: true
48
- grammarValue::: irregular declension
49
- geographicArea:: AUS
51
+ grammar-value::: irregular declension
52
+ geographic-area:: AUS
50
53
 
51
54
  related:see[<<second>>,Fifth Designation]
52
55
 
@@ -55,7 +58,7 @@ RSpec.describe Asciidoctor::Standoc do
55
58
  grammar::
56
59
  gender::: neuter
57
60
  isVerb::: true
58
- geographicArea:: GRC
61
+ geographic-area:: GRC
59
62
 
60
63
  [.source]
61
64
  <<ISO2191,section=2>>
@@ -69,7 +72,7 @@ RSpec.describe Asciidoctor::Standoc do
69
72
  === Second Term
70
73
 
71
74
  [%metadata]
72
- usageinfo::
75
+ usage-info::
73
76
  +
74
77
  --
75
78
  Usage Info 1.
@@ -85,12 +88,14 @@ RSpec.describe Asciidoctor::Standoc do
85
88
  <title>Terms and definitions</title>
86
89
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
87
90
  <term id='term-first-designation'>
88
- <preferred language='fr' script='Latn' type='prefix' isInternational="true">
89
- <expression>
91
+ <preferred>
92
+ <expression language='fr' script='Latn' type='prefix' isInternational="true">
90
93
  <name>First Designation</name>
91
- <abbreviationType>acronym</abbreviationType>
94
+ <abbreviation-type>acronym</abbreviation-type>
92
95
  <pronunciation>f&#601;&#633;st</pronunciation>
93
96
  </expression>
97
+ <field-of-application>Field</field-of-application>
98
+ <usage-info>This is usage.</usage-info>
94
99
  <termsource status='identical' type='authoritative'>
95
100
  <origin bibitemid='ISO2191' type='inline' citeas=''>
96
101
  <localityStack>
@@ -101,26 +106,30 @@ RSpec.describe Asciidoctor::Standoc do
101
106
  </origin>
102
107
  </termsource>
103
108
  </preferred>
104
- <admitted language='he' script='Hebr' type='suffix' absent="true">
105
- <expression>
109
+ <admitted absent="true">
110
+ <expression language='he' script='Hebr' type='suffix'>
106
111
  <name>Third Designation</name>
107
112
  </expression>
113
+ <usage-info>This is usage 1.</usage-info>
108
114
  </admitted>
109
- <deprecates language='jp' script='Japn' type='full' geographicArea="AUS">
110
- <expression>
115
+ <deprecates geographic-area="AUS">
116
+ <expression language='jp' script='Japn' type='full'>
111
117
  <name>Fourth Designation</name>
112
118
  <grammar>
113
119
  <gender>masculine</gender>
114
120
  <gender>feminine</gender>
121
+ <number>singular</number>
122
+ <number>plural</number>
115
123
  <isPreposition>false</isPreposition>
116
124
  <isNoun>true</isNoun>
117
- <grammarValue>irregular declension</grammarValue>
125
+ <grammar-value>irregular declension</grammar-value>
118
126
  </grammar>
119
127
  </expression>
128
+ <field-of-application>Field</field-of-application>
120
129
  </deprecates>
121
- <related type='abbreviation'>
122
- <preferred geographicArea="GRC">
123
- <expression>
130
+ <related type='see'>
131
+ <preferred geographic-area="GRC">
132
+ <expression type="abbreviation">
124
133
  <name>Fifth Designation</name>
125
134
  <grammar>
126
135
  <gender>neuter</gender>
@@ -140,10 +149,9 @@ RSpec.describe Asciidoctor::Standoc do
140
149
  </related>
141
150
  <domain>Hydraulics</domain>
142
151
  <subject>pipes</subject>
143
- <usageinfo>This is usage.</usageinfo>
144
- <definition><verbaldefinition>
152
+ <definition><verbal-definition>
145
153
  <p id='_'>Definition</p>
146
- </verbaldefinition></definition>
154
+ </verbal-definition></definition>
147
155
  <termsource status='identical' type='authoritative'>
148
156
  <origin bibitemid='ISO2191' type='inline' citeas=''>
149
157
  <localityStack>
@@ -159,11 +167,11 @@ RSpec.describe Asciidoctor::Standoc do
159
167
  <expression>
160
168
  <name>Second Term</name>
161
169
  </expression>
162
- </preferred>
163
- <usageinfo>
170
+ <usage-info>
164
171
  <p id='_'>Usage Info 1.</p>
165
172
  <p id='_'>Usage Info 2.</p>
166
- </usageinfo>
173
+ </usage-info>
174
+ </preferred>
167
175
  </term>
168
176
  </terms>
169
177
  </sections>
@@ -255,9 +263,9 @@ RSpec.describe Asciidoctor::Standoc do
255
263
  <tt>seventh-designation</tt>
256
264
  </strong>
257
265
  </related>
258
- <definition><verbaldefinition>
266
+ <definition><verbal-definition>
259
267
  <p id='_'>Definition</p>
260
- </verbaldefinition></definition>
268
+ </verbal-definition></definition>
261
269
  </term>
262
270
  </terms>
263
271
  <clause id='_' inline-header='false' obligation='normative'>
@@ -361,9 +369,9 @@ RSpec.describe Asciidoctor::Standoc do
361
369
  </preferred>
362
370
  <xref target='second'/>
363
371
  </related>
364
- <definition><verbaldefinition>
372
+ <definition><verbal-definition>
365
373
  <p id='_'>Definition</p>
366
- </verbaldefinition></definition>
374
+ </verbal-definition></definition>
367
375
  </term>
368
376
  </terms>
369
377
  </sections>
@@ -401,8 +409,8 @@ RSpec.describe Asciidoctor::Standoc do
401
409
  <title>Terms and definitions</title>
402
410
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
403
411
  <term id='second'>
404
- <preferred isInternational='true'>
405
- <expression>
412
+ <preferred>
413
+ <expression isInternational='true'>
406
414
  <name/>
407
415
  </expression>
408
416
  </preferred>
@@ -424,9 +432,9 @@ RSpec.describe Asciidoctor::Standoc do
424
432
  <related type='see'>
425
433
  <xref target='second'/>
426
434
  </related>
427
- <definition><verbaldefinition>
435
+ <definition><verbal-definition>
428
436
  <p id='_'>Definition</p>
429
- </verbaldefinition></definition>
437
+ </verbal-definition></definition>
430
438
  </term>
431
439
  </terms>
432
440
  </sections>
@@ -494,8 +502,8 @@ RSpec.describe Asciidoctor::Standoc do
494
502
  <title>Terms and definitions</title>
495
503
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
496
504
  <term id='second'>
497
- <preferred isInternational='true'>
498
- <graphical-symbol>
505
+ <preferred>
506
+ <graphical-symbol isInternational='true'>
499
507
  <figure id='_'>
500
508
  <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
501
509
  </figure>
@@ -526,13 +534,13 @@ RSpec.describe Asciidoctor::Standoc do
526
534
  <xref target='second'/>
527
535
  </related>
528
536
  <definition>
529
- <verbaldefinition><p id='_'>Definition</p></verbaldefinition>
530
- <nonverbalrepresentation>
531
- <figure id='_'>
532
- <name>Caption</name>
533
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
534
- </figure>
535
- </nonverbalrepresentation>
537
+ <verbal-definition>
538
+ <figure id='_'>
539
+ <name>Caption</name>
540
+ <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
541
+ </figure>
542
+ <p id='_'>Definition</p>
543
+ </verbal-definition>
536
544
  </definition>
537
545
  </term>
538
546
  </terms>
@@ -548,6 +556,7 @@ RSpec.describe Asciidoctor::Standoc do
548
556
  #{ASCIIDOC_BLANK_HDR}
549
557
  == Terms and Definitions
550
558
 
559
+ [[des1]]
551
560
  === First Designation
552
561
 
553
562
  [%metadata]
@@ -555,13 +564,13 @@ RSpec.describe Asciidoctor::Standoc do
555
564
  script:: Latn
556
565
  type:: prefix
557
566
  isInternational:: true
558
- abbreviationType:: acronym
567
+ abbreviation-type:: acronym
559
568
  pronunciation:: fəɹst
560
569
  domain:: Hydraulics
561
570
  subject:: pipes
562
- usageinfo:: This is usage.
571
+ usage-info:: This is usage.
563
572
 
564
- related:see[Fifth Designation]
573
+ related:see[<<des1>>,Fifth Designation]
565
574
 
566
575
  [%metadata]
567
576
  grammar::
@@ -578,7 +587,7 @@ RSpec.describe Asciidoctor::Standoc do
578
587
  gender::: masculine, feminine
579
588
  isPreposition::: false
580
589
  isNoun::: true
581
- grammarValue::: irregular declension
590
+ grammar-value::: irregular declension
582
591
 
583
592
  alt:[Third Designation]
584
593
 
@@ -588,7 +597,7 @@ RSpec.describe Asciidoctor::Standoc do
588
597
  type:: suffix
589
598
  domain:: Hydraulics1
590
599
  subject: pipes1
591
- usageinfo:: This is usage 1.
600
+ usage-info:: This is usage 1.
592
601
 
593
602
  preferred:[Second Designation]
594
603
 
@@ -604,50 +613,47 @@ RSpec.describe Asciidoctor::Standoc do
604
613
  <terms id='_' obligation='normative'>
605
614
  <title>Terms and definitions</title>
606
615
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
607
- <term id='term-first-designation'>
608
- <preferred language='fr' script='Latn' type='prefix' isInternational="true">
609
- <expression>
616
+ <term id='des1'>
617
+ <preferred>
618
+ <expression language='fr' script='Latn' type='prefix' isInternational="true">
610
619
  <name>First Designation</name>
611
- <abbreviationType>acronym</abbreviationType>
620
+ <abbreviation-type>acronym</abbreviation-type>
612
621
  <pronunciation>f&#601;&#633;st</pronunciation>
613
622
  </expression>
623
+ <usage-info>This is usage.</usage-info>
614
624
  </preferred>
615
- <preferred type='abbreviation'>
616
- <expression>
625
+ <preferred>
626
+ <expression type='abbreviation'>
617
627
  <name>Second Designation</name>
618
628
  </expression>
619
629
  </preferred>
620
- <admitted language='he' script='Hebr' type='suffix'>
621
- <expression>
630
+ <admitted>
631
+ <expression language='he' script='Hebr' type='suffix'>
622
632
  <name>Third Designation</name>
623
633
  </expression>
634
+ <usage-info>This is usage 1.</usage-info>
624
635
  </admitted>
625
- <deprecates language='jp' script='Japn' type='full'>
626
- <expression>
636
+ <deprecates>
637
+ <expression language='jp' script='Japn' type='full'>
627
638
  <name>Fourth Designation</name>
628
639
  <grammar>
629
640
  <gender>masculine</gender>
630
641
  <gender>feminine</gender>
631
642
  <isPreposition>false</isPreposition>
632
643
  <isNoun>true</isNoun>
633
- <grammarValue>irregular declension</grammarValue>
644
+ <grammar-value>irregular declension</grammar-value>
634
645
  </grammar>
635
646
  </expression>
636
647
  </deprecates>
637
648
  <related type='see'>
638
- <strong>
639
- term
640
- <tt>Fifth Designation</tt>
641
- not resolved via ID
642
- <tt>fifth-designation</tt>
643
- </strong>
649
+ <preferred><expression><name>Fifth Designation</name><grammar><gender>neuter</gender></grammar></expression>
650
+ </preferred><xref target='des1'/>
644
651
  </related>
645
652
  <domain>Hydraulics</domain>
646
653
  <subject>pipes</subject>
647
- <usageinfo>This is usage.</usageinfo>
648
- <definition><verbaldefinition>
654
+ <definition><verbal-definition>
649
655
  <p id='_'>Definition</p>
650
- </verbaldefinition></definition>
656
+ </verbal-definition></definition>
651
657
  </term>
652
658
  </terms>
653
659
  </sections>
@@ -690,7 +696,7 @@ RSpec.describe Asciidoctor::Standoc do
690
696
  <mn>91</mn>
691
697
  </mrow>
692
698
  </msub></math></stem></name></letter-symbol></admitted>
693
- <definition><verbaldefinition><p id="_">Time</p></verbaldefinition></definition></term>
699
+ <definition><verbal-definition><p id="_">Time</p></verbal-definition></definition></term>
694
700
  </terms>
695
701
  </sections>
696
702
  </standard-document>
@@ -699,6 +705,114 @@ RSpec.describe Asciidoctor::Standoc do
699
705
  .to be_equivalent_to xmlpp(output)
700
706
  end
701
707
 
708
+ it "differentiates stem-only and mixed terms" do
709
+ input = <<~INPUT
710
+ #{ASCIIDOC_BLANK_HDR}
711
+ == Terms and Definitions
712
+
713
+ === stem:[t_90]
714
+
715
+ Time
716
+
717
+ === stem:[t_90]-sensitivity
718
+
719
+ Sensitivity
720
+
721
+ === sensitivity to stem:[t_90]
722
+
723
+ Sensitivity #2
724
+ INPUT
725
+ output = <<~OUTPUT
726
+ #{BLANK_HDR}
727
+ <sections>
728
+ <terms id='_' obligation='normative'>
729
+ <title>Terms and definitions</title>
730
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
731
+ <term id='term-_-t90-'>
732
+ <preferred>
733
+ <letter-symbol>
734
+ <name>
735
+ <stem type='MathML'>
736
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
737
+ <msub>
738
+ <mrow>
739
+ <mi>t</mi>
740
+ </mrow>
741
+ <mrow>
742
+ <mn>90</mn>
743
+ </mrow>
744
+ </msub>
745
+ </math>
746
+ </stem>
747
+ </name>
748
+ </letter-symbol>
749
+ </preferred>
750
+ <definition>
751
+ <verbal-definition>
752
+ <p id='_'>Time</p>
753
+ </verbal-definition>
754
+ </definition>
755
+ </term>
756
+ <term id='term-t90-sensitivity'>
757
+ <preferred>
758
+ <expression>
759
+ <name>
760
+ <stem type='MathML'>
761
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
762
+ <msub>
763
+ <mrow>
764
+ <mi>t</mi>
765
+ </mrow>
766
+ <mrow>
767
+ <mn>90</mn>
768
+ </mrow>
769
+ </msub>
770
+ </math>
771
+ </stem>
772
+ -sensitivity
773
+ </name>
774
+ </expression>
775
+ </preferred>
776
+ <definition>
777
+ <verbal-definition>
778
+ <p id='_'>Sensitivity</p>
779
+ </verbal-definition>
780
+ </definition>
781
+ </term>
782
+ <term id='term-sensitivity-to-t90'>
783
+ <preferred>
784
+ <expression>
785
+ <name>
786
+ sensitivity to
787
+ <stem type='MathML'>
788
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
789
+ <msub>
790
+ <mrow>
791
+ <mi>t</mi>
792
+ </mrow>
793
+ <mrow>
794
+ <mn>90</mn>
795
+ </mrow>
796
+ </msub>
797
+ </math>
798
+ </stem>
799
+ </name>
800
+ </expression>
801
+ </preferred>
802
+ <definition>
803
+ <verbal-definition>
804
+ <p id='_'>Sensitivity #2</p>
805
+ </verbal-definition>
806
+ </definition>
807
+ </term>
808
+ </terms>
809
+ </sections>
810
+ </standard-document>
811
+ OUTPUT
812
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
813
+ .to be_equivalent_to xmlpp(output)
814
+ end
815
+
702
816
  it "moves term domains out of the term definition paragraph" do
703
817
  input = <<~INPUT
704
818
  #{ASCIIDOC_BLANK_HDR}
@@ -722,15 +836,14 @@ RSpec.describe Asciidoctor::Standoc do
722
836
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
723
837
  <term id="term-tempus">
724
838
  <preferred><expression><name>Tempus</name></expression></preferred>
725
- <domain>relativity</domain><definition><verbaldefinition><p id="_"> Time</p></verbaldefinition></definition>
839
+ <domain>relativity</domain><definition><verbal-definition><p id="_"> Time</p></verbal-definition></definition>
726
840
  </term>
727
841
  <term id='term-tempus1'>
728
842
  <preferred><expression><name>Tempus1</name></expression></preferred>
729
843
  <domain>relativity2</domain>
730
- <definition><verbaldefinition>
844
+ <definition><verbal-definition>
731
845
  <p id='_'>Time2</p>
732
- <p id='_'> </p>
733
- </verbaldefinition></definition>
846
+ </verbal-definition></definition>
734
847
  </term>
735
848
  </terms>
736
849
  </sections>
@@ -785,8 +898,26 @@ RSpec.describe Asciidoctor::Standoc do
785
898
  <mn>90</mn>
786
899
  </mrow>
787
900
  </msub></math></stem></name></letter-symbol></preferred>
901
+ <admitted>
902
+ <letter-symbol>
903
+ <name>
904
+ <stem type='MathML'>
905
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
906
+ <msub>
907
+ <mrow>
908
+ <mi>t</mi>
909
+ </mrow>
910
+ <mrow>
911
+ <mi>A</mi>
912
+ </mrow>
913
+ </msub>
914
+ </math>
915
+ </stem>
916
+ </name>
917
+ </letter-symbol>
918
+ </admitted>
788
919
  <definition>
789
- <verbaldefinition>
920
+ <verbal-definition>
790
921
  <p id="_">This paragraph is extraneous</p>
791
922
  <ul id='_'>
792
923
  <li>
@@ -805,17 +936,7 @@ RSpec.describe Asciidoctor::Standoc do
805
936
  </dd>
806
937
  </dl>
807
938
  <p id='_'>This is a concluding paragraph</p>
808
- </verbaldefinition>
809
- <nonverbalrepresentation><formula id="_">
810
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
811
- <mrow>
812
- <mi>t</mi>
813
- </mrow>
814
- <mrow>
815
- <mi>A</mi>
816
- </mrow>
817
- </msub></math></stem>
818
- </formula></nonverbalrepresentation>
939
+ </verbal-definition>
819
940
  </definition>
820
941
  </term>
821
942
  </terms>
@@ -856,7 +977,7 @@ RSpec.describe Asciidoctor::Standoc do
856
977
  <title>Terms and definitions</title>
857
978
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
858
979
  <term id="term-term"><preferred><expression><name>Term</name></expression></preferred>
859
- <definition><verbaldefinition><p id='_'>Definition</p></verbaldefinition></definition>
980
+ <definition><verbal-definition><p id='_'>Definition</p></verbal-definition></definition>
860
981
  <termnote id="_">
861
982
  <p id="_">Note</p>
862
983
  </termnote><termnote id="_">
@@ -895,7 +1016,10 @@ RSpec.describe Asciidoctor::Standoc do
895
1016
 
896
1017
  [.source]
897
1018
  <<ISO2191,section=1>>
1019
+ --
898
1020
 
1021
+ [.definition]
1022
+ --
899
1023
  |===
900
1024
  | A | B
901
1025
 
@@ -938,7 +1062,7 @@ RSpec.describe Asciidoctor::Standoc do
938
1062
  </expression>
939
1063
  </preferred>
940
1064
  <definition>
941
- <verbaldefinition>
1065
+ <verbal-definition>
942
1066
  <p id='_'>Definition</p>
943
1067
  <termsource status='identical' type='authoritative'>
944
1068
  <origin bibitemid='ISO2191' type='inline' citeas=''>
@@ -949,8 +1073,8 @@ RSpec.describe Asciidoctor::Standoc do
949
1073
  </localityStack>
950
1074
  </origin>
951
1075
  </termsource>
952
- </verbaldefinition>
953
- <nonverbalrepresentation>
1076
+ </verbal-definition>
1077
+ <non-verbal-representation>
954
1078
  <table id='_'>
955
1079
  <thead>
956
1080
  <tr>
@@ -965,7 +1089,7 @@ RSpec.describe Asciidoctor::Standoc do
965
1089
  </tr>
966
1090
  </tbody>
967
1091
  </table>
968
- </nonverbalrepresentation>
1092
+ </non-verbal-representation>
969
1093
  </definition>
970
1094
  <termsource status='identical' type='authoritative'>
971
1095
  <origin bibitemid='ISO2191' type='inline' citeas=''>
@@ -984,7 +1108,7 @@ RSpec.describe Asciidoctor::Standoc do
984
1108
  </expression>
985
1109
  </preferred>
986
1110
  <definition>
987
- <nonverbalrepresentation>
1111
+ <non-verbal-representation>
988
1112
  <figure id='_'>
989
1113
  <pre id='_'>Literal</pre>
990
1114
  </figure>
@@ -1006,7 +1130,7 @@ RSpec.describe Asciidoctor::Standoc do
1006
1130
  </localityStack>
1007
1131
  </origin>
1008
1132
  </termsource>
1009
- </nonverbalrepresentation>
1133
+ </non-verbal-representation>
1010
1134
  </definition>
1011
1135
  </term>
1012
1136
  </terms>
@@ -1017,4 +1141,317 @@ RSpec.describe Asciidoctor::Standoc do
1017
1141
  .to be_equivalent_to xmlpp(output)
1018
1142
  end
1019
1143
 
1144
+ it "differentiates stem expressions before, after, and within verbal definitions" do
1145
+ input = <<~INPUT
1146
+ #{ASCIIDOC_BLANK_HDR}
1147
+
1148
+ == Terms and definitions
1149
+
1150
+ === Term
1151
+
1152
+ stem:[lambda]
1153
+
1154
+ [.definition]
1155
+ --
1156
+
1157
+ Definition
1158
+
1159
+ stem:[mu]
1160
+ --
1161
+
1162
+ [.definition]
1163
+ --
1164
+
1165
+ stem:[nu]
1166
+ --
1167
+
1168
+ INPUT
1169
+ output = <<~OUTPUT
1170
+ #{BLANK_HDR}
1171
+ <sections>
1172
+ <terms id='_' obligation='normative'>
1173
+ <title>Terms and definitions</title>
1174
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1175
+ <term id='term-term'>
1176
+ <preferred>
1177
+ <expression>
1178
+ <name>Term</name>
1179
+ </expression>
1180
+ </preferred>
1181
+ <admitted>
1182
+ <letter-symbol>
1183
+ <name>
1184
+ <stem type='MathML'>
1185
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1186
+ <mi>&#955;</mi>
1187
+ </math>
1188
+ </stem>
1189
+ </name>
1190
+ </letter-symbol>
1191
+ </admitted>
1192
+ <definition>
1193
+ <verbal-definition>
1194
+ <p id='_'>Definition</p>
1195
+ <p id='_'>
1196
+ <stem type='MathML'>
1197
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1198
+ <mi>&#956;</mi>
1199
+ </math>
1200
+ </stem>
1201
+ </p>
1202
+ </verbal-definition>
1203
+ </definition>
1204
+ <definition>
1205
+ <verbal-definition>
1206
+ <p id='_'>
1207
+ <stem type='MathML'>
1208
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1209
+ <mi>&#957;</mi>
1210
+ </math>
1211
+ </stem>
1212
+ </p>
1213
+ </verbal-definition>
1214
+ </definition>
1215
+ </term>
1216
+ </terms>
1217
+ </sections>
1218
+ </standard-document>
1219
+ OUTPUT
1220
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1221
+ .to be_equivalent_to xmlpp(output)
1222
+ end
1223
+
1224
+ it "differentiates formuals before, after, and within verbal definitions" do
1225
+ input = <<~INPUT
1226
+ #{ASCIIDOC_BLANK_HDR}
1227
+
1228
+ == Terms and definitions
1229
+
1230
+ === Term
1231
+
1232
+ [stem]
1233
+ ++++
1234
+ lambda
1235
+ ++++
1236
+
1237
+ [.definition]
1238
+ --
1239
+
1240
+ Definition
1241
+
1242
+ [stem]
1243
+ ++++
1244
+ mu
1245
+ ++++
1246
+ --
1247
+
1248
+ [.definition]
1249
+ --
1250
+
1251
+ [stem]
1252
+ ++++
1253
+ nu
1254
+ ++++
1255
+ --
1256
+
1257
+ INPUT
1258
+ output = <<~OUTPUT
1259
+ #{BLANK_HDR}
1260
+ <sections>
1261
+ <terms id='_' obligation='normative'>
1262
+ <title>Terms and definitions</title>
1263
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1264
+ <term id='term-term'>
1265
+ <preferred>
1266
+ <expression>
1267
+ <name>Term</name>
1268
+ </expression>
1269
+ </preferred>
1270
+ <admitted>
1271
+ <letter-symbol>
1272
+ <name>
1273
+ <stem type='MathML'>
1274
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1275
+ <mi>&#955;</mi>
1276
+ </math>
1277
+ </stem>
1278
+ </name>
1279
+ </letter-symbol>
1280
+ </admitted>
1281
+ <definition>
1282
+ <verbal-definition>
1283
+ <p id='_'>Definition</p>
1284
+ <formula id='_'>
1285
+ <stem type='MathML'>
1286
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1287
+ <mi>&#956;</mi>
1288
+ </math>
1289
+ </stem>
1290
+ </formula>
1291
+ </verbal-definition>
1292
+ <non-verbal-representation>
1293
+ <formula id='_'>
1294
+ <stem type='MathML'>
1295
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1296
+ <mi>&#957;</mi>
1297
+ </math>
1298
+ </stem>
1299
+ </formula>
1300
+ </non-verbal-representation>
1301
+ </definition>
1302
+ </term>
1303
+ </terms>
1304
+ </sections>
1305
+ </standard-document>
1306
+ OUTPUT
1307
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1308
+ .to be_equivalent_to xmlpp(output)
1309
+ end
1310
+
1311
+ it "automatically indexes term indexes" do
1312
+ input = <<~INPUT
1313
+ #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:\n/, ":nodoc:\n:index-terms:\n")}
1314
+
1315
+ == Terms and definitions
1316
+
1317
+ === Term
1318
+
1319
+ [stem]
1320
+ ++++
1321
+ lambda
1322
+ ++++
1323
+
1324
+ admitted:[x]
1325
+
1326
+ === Term2
1327
+
1328
+ preferred:[stem:[mu_0 // 2]]
1329
+
1330
+ == Symbols and Abbreviated Terms
1331
+
1332
+ x^2^:: Definition
1333
+ INPUT
1334
+ output = <<~OUTPUT
1335
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='#{Metanorma::Standoc::VERSION}'>
1336
+ <bibdata type='standard'>
1337
+ <title language='en' format='text/plain'>Document title</title>
1338
+ <language>en</language>
1339
+ <script>Latn</script>
1340
+ <status>
1341
+ <stage>published</stage>
1342
+ </status>
1343
+ <copyright>
1344
+ <from>#{Time.now.year}</from>
1345
+ </copyright>
1346
+ <ext>
1347
+ <doctype>article</doctype>
1348
+ </ext>
1349
+ </bibdata>
1350
+ <sections>
1351
+ <terms id='_' obligation='normative'>
1352
+ <title>Terms and definitions</title>
1353
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1354
+ <term id='term-term'>
1355
+ <preferred>
1356
+ <expression>
1357
+ <name>
1358
+ Term
1359
+ <index>
1360
+ <primary>Term</primary>
1361
+ </index>
1362
+ </name>
1363
+ </expression>
1364
+ </preferred>
1365
+ <admitted>
1366
+ <letter-symbol>
1367
+ <name>
1368
+ <stem type='MathML'>
1369
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1370
+ <mi>&#955;</mi>
1371
+ </math>
1372
+ </stem>
1373
+ </name>
1374
+ </letter-symbol>
1375
+ </admitted>
1376
+ <definition>
1377
+ <verbal-definition>
1378
+ <p id='_'>admitted:[x]</p>
1379
+ </verbal-definition>
1380
+ </definition>
1381
+ </term>
1382
+ <term id='term-term2'>
1383
+ <preferred>
1384
+ <expression>
1385
+ <name>
1386
+ Term2
1387
+ <index>
1388
+ <primary>Term2</primary>
1389
+ </index>
1390
+ </name>
1391
+ </expression>
1392
+ </preferred>
1393
+ <preferred>
1394
+ <letter-symbol>
1395
+ <name>
1396
+ <stem type='MathML'>
1397
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1398
+ <msub>
1399
+ <mrow>
1400
+ <mi>&#956;</mi>
1401
+ </mrow>
1402
+ <mrow>
1403
+ <mn>0</mn>
1404
+ </mrow>
1405
+ </msub>
1406
+ <mo>/</mo>
1407
+ <mn>2</mn>
1408
+ </math>
1409
+ </stem>
1410
+ <index>
1411
+ <primary>
1412
+ <stem type='MathML'>
1413
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
1414
+ <msub>
1415
+ <mrow>
1416
+ <mi>&#956;</mi>
1417
+ </mrow>
1418
+ <mrow>
1419
+ <mn>0</mn>
1420
+ </mrow>
1421
+ </msub>
1422
+ <mo>/</mo>
1423
+ <mn>2</mn>
1424
+ </math>
1425
+ </stem>
1426
+ </primary>
1427
+ </index>
1428
+ </name>
1429
+ </letter-symbol>
1430
+ </preferred>
1431
+ </term>
1432
+ </terms>
1433
+ <definitions id='_' obligation='normative'>
1434
+ <title>Symbols and abbreviated terms</title>
1435
+ <dl id='_'>
1436
+ <dt id='symbol-x2'>
1437
+ x
1438
+ <sup>2</sup>
1439
+ <index>
1440
+ <primary>
1441
+ x
1442
+ <sup>2</sup>
1443
+ </primary>
1444
+ </index>
1445
+ </dt>
1446
+ <dd>
1447
+ <p id='_'>Definition</p>
1448
+ </dd>
1449
+ </dl>
1450
+ </definitions>
1451
+ </sections>
1452
+ </standard-document>
1453
+ OUTPUT
1454
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1455
+ .to be_equivalent_to xmlpp(output)
1456
+ end
1020
1457
  end