metanorma-standoc 2.2.6 → 2.2.7

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/lib/metanorma/standoc/base.rb +3 -5
  3. data/lib/metanorma/standoc/biblio.rng +5 -0
  4. data/lib/metanorma/standoc/cleanup.rb +17 -17
  5. data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
  6. data/lib/metanorma/standoc/cleanup_biblio.rb +2 -1
  7. data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
  8. data/lib/metanorma/standoc/cleanup_section.rb +19 -9
  9. data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
  10. data/lib/metanorma/standoc/cleanup_text.rb +10 -4
  11. data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
  12. data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
  13. data/lib/metanorma/standoc/inline.rb +27 -12
  14. data/lib/metanorma/standoc/isodoc.rng +46 -12
  15. data/lib/metanorma/standoc/ref_utility.rb +1 -0
  16. data/lib/metanorma/standoc/render.rb +10 -1
  17. data/lib/metanorma/standoc/section.rb +10 -3
  18. data/lib/metanorma/standoc/utils.rb +6 -1
  19. data/lib/metanorma/standoc/validate.rb +1 -1
  20. data/lib/metanorma/standoc/version.rb +1 -1
  21. data/metanorma-standoc.gemspec +5 -2
  22. metadata +4 -128
  23. data/.github/workflows/automerge.yml +0 -31
  24. data/.github/workflows/rake.yml +0 -15
  25. data/.github/workflows/release.yml +0 -24
  26. data/Rakefile +0 -8
  27. data/bin/rspec +0 -18
  28. data/spec/assets/a1.adoc +0 -8
  29. data/spec/assets/a2.adoc +0 -10
  30. data/spec/assets/a3.adoc +0 -9
  31. data/spec/assets/a3a.adoc +0 -7
  32. data/spec/assets/a4.adoc +0 -4
  33. data/spec/assets/boilerplate.xml +0 -4
  34. data/spec/assets/codes.yml +0 -695
  35. data/spec/assets/correct.png +0 -0
  36. data/spec/assets/corrupt.png +0 -0
  37. data/spec/assets/header.html +0 -7
  38. data/spec/assets/html-override.css +0 -1
  39. data/spec/assets/html.scss +0 -13
  40. data/spec/assets/htmlcover.html +0 -4
  41. data/spec/assets/htmlintro.html +0 -5
  42. data/spec/assets/i18n.yaml +0 -17
  43. data/spec/assets/iso.adoc +0 -10
  44. data/spec/assets/iso.headless.html +0 -33
  45. data/spec/assets/iso.xml +0 -8
  46. data/spec/assets/iso123.rxl +0 -107
  47. data/spec/assets/rice_image1.png +0 -0
  48. data/spec/assets/scripts.html +0 -3
  49. data/spec/assets/std.css +0 -2
  50. data/spec/assets/word-override.css +0 -1
  51. data/spec/assets/word.scss +0 -13
  52. data/spec/assets/wordcover.html +0 -3
  53. data/spec/assets/wordintro.html +0 -4
  54. data/spec/assets/xref_error.adoc +0 -8
  55. data/spec/examples/103_01_02.html +0 -247
  56. data/spec/examples/codes_table.html +0 -3174
  57. data/spec/examples/datamodel/address_class_profile.adoc +0 -5
  58. data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
  59. data/spec/examples/datamodel/address_component_profile.adoc +0 -5
  60. data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
  61. data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
  62. data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
  63. data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
  64. data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
  65. data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
  66. data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
  67. data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
  68. data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
  69. data/spec/examples/datamodel/models/models/Localization.yml +0 -23
  70. data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
  71. data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
  72. data/spec/examples/datamodel/models/models/Signature.yml +0 -20
  73. data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
  74. data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
  75. data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
  76. data/spec/examples/datamodel/models/models/Validity.yml +0 -14
  77. data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
  78. data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
  79. data/spec/examples/datamodel/models/style.uml.inc +0 -37
  80. data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
  81. data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
  82. data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
  83. data/spec/examples/english.yaml +0 -69
  84. data/spec/examples/iso_123_.xml +0 -46
  85. data/spec/examples/iso_123_all_parts.xml +0 -46
  86. data/spec/examples/iso_123_no_year_note.xml +0 -47
  87. data/spec/examples/iso_124_.xml +0 -42
  88. data/spec/examples/iso_216_.xml +0 -48
  89. data/spec/examples/iso_iec_12382_.xml +0 -49
  90. data/spec/examples/rice.adoc +0 -715
  91. data/spec/examples/rice.preview.html +0 -1877
  92. data/spec/examples/rice.sh +0 -4
  93. data/spec/examples/rice_images/rice_image1.png +0 -0
  94. data/spec/examples/rice_images/rice_image2.png +0 -0
  95. data/spec/examples/rice_images/rice_image3_1.png +0 -0
  96. data/spec/examples/rice_images/rice_image3_2.png +0 -0
  97. data/spec/examples/rice_images/rice_image3_3.png +0 -0
  98. data/spec/fixtures/action_schemaexpg1.svg +0 -122
  99. data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
  100. data/spec/fixtures/diagram_definitions.lutaml +0 -22
  101. data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
  102. data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
  103. data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
  104. data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
  105. data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
  106. data/spec/fixtures/test.exp +0 -121
  107. data/spec/fixtures/test.xmi +0 -9250
  108. data/spec/metanorma/base_spec.rb +0 -1125
  109. data/spec/metanorma/biblio_spec.rb +0 -1012
  110. data/spec/metanorma/blank_spec.rb +0 -37
  111. data/spec/metanorma/blocks_spec.rb +0 -1784
  112. data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
  113. data/spec/metanorma/cleanup_sections_spec.rb +0 -1849
  114. data/spec/metanorma/cleanup_spec.rb +0 -1931
  115. data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
  116. data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
  117. data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
  118. data/spec/metanorma/inline_spec.rb +0 -785
  119. data/spec/metanorma/isobib_cache_spec.rb +0 -742
  120. data/spec/metanorma/lists_spec.rb +0 -232
  121. data/spec/metanorma/macros_concept_spec.rb +0 -1052
  122. data/spec/metanorma/macros_json2text_spec.rb +0 -10
  123. data/spec/metanorma/macros_plantuml_spec.rb +0 -402
  124. data/spec/metanorma/macros_spec.rb +0 -1183
  125. data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
  126. data/spec/metanorma/processor_spec.rb +0 -96
  127. data/spec/metanorma/refs_spec.rb +0 -2807
  128. data/spec/metanorma/reqt_spec.rb +0 -130
  129. data/spec/metanorma/section_spec.rb +0 -1325
  130. data/spec/metanorma/table_spec.rb +0 -474
  131. data/spec/metanorma/validate_spec.rb +0 -886
  132. data/spec/spec_helper.rb +0 -290
  133. data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
  134. data/spec/vcr_cassettes/bsi16341.yml +0 -486
  135. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
  136. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
  137. data/spec/vcr_cassettes/hide_refs.yml +0 -587
  138. data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
  139. data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
  140. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
  141. data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
  142. data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
  143. data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
  144. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -367
  145. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
  146. data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -1,1543 +0,0 @@
1
- require "spec_helper"
2
- require "relaton_iec"
3
- require "fileutils"
4
-
5
- RSpec.describe Metanorma::Standoc do
6
- it "processes term and designation metadata and term sources" do
7
- input = <<~INPUT
8
- #{ASCIIDOC_BLANK_HDR}
9
- == Terms and Definitions
10
-
11
- === First Designation
12
-
13
- [%metadata]
14
- language:: fr
15
- script:: Latn
16
- type:: prefix
17
- isInternational:: true
18
- abbreviation-type:: acronym
19
- pronunciation:: fəɹst
20
- domain:: Hydraulics
21
- subject:: pipes
22
- field-of-application:: Field
23
- usage-info:: This is usage.
24
-
25
- [.source]
26
- <<ISO2191,section=1>>
27
-
28
- alt:[Third Designation]
29
-
30
- [%metadata]
31
- language:: he
32
- script:: Hebr
33
- type:: suffix
34
- domain:: Hydraulics1
35
- subject: pipes1
36
- usage-info:: This is usage 1.
37
- absent:: true
38
-
39
- deprecated:[Fourth Designation]
40
-
41
- [%metadata]
42
- language:: jp
43
- script:: Japn
44
- type:: full
45
- field-of-application:: Field
46
- grammar::
47
- gender::: masculine, feminine
48
- number::: singular, plural
49
- isPreposition::: false
50
- isNoun::: true
51
- grammar-value::: irregular declension
52
- geographic-area:: AUS
53
-
54
- related:see[<<second>>,Fifth Designation]
55
-
56
- [%metadata]
57
- type:: abbreviation
58
- grammar::
59
- gender::: neuter
60
- isVerb::: true
61
- geographic-area:: GRC
62
-
63
- [.source]
64
- <<ISO2191,section=2>>
65
-
66
- Definition
67
-
68
- [.source]
69
- <<ISO2191,section=3>>
70
-
71
- [[second]]
72
- === Second Term
73
-
74
- [%metadata]
75
- usage-info::
76
- +
77
- --
78
- Usage Info 1.
79
-
80
- Usage Info 2.
81
- --
82
-
83
- INPUT
84
- output = <<~OUTPUT
85
- #{BLANK_HDR}
86
- <sections>
87
- <terms id='_' obligation='normative'>
88
- <title>Terms and definitions</title>
89
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
90
- <term id='term-First-Designation'>
91
- <preferred>
92
- <expression language='fr' script='Latn' type='prefix' isInternational="true">
93
- <name>First Designation</name>
94
- <abbreviation-type>acronym</abbreviation-type>
95
- <pronunciation>f&#601;&#633;st</pronunciation>
96
- </expression>
97
- <field-of-application>Field</field-of-application>
98
- <usage-info>This is usage.</usage-info>
99
- <termsource status='identical' type='authoritative'>
100
- <origin bibitemid='ISO2191' type='inline' citeas=''>
101
- <localityStack>
102
- <locality type='section'>
103
- <referenceFrom>1</referenceFrom>
104
- </locality>
105
- </localityStack>
106
- </origin>
107
- </termsource>
108
- </preferred>
109
- <admitted absent="true">
110
- <expression language='he' script='Hebr' type='suffix'>
111
- <name>Third Designation</name>
112
- </expression>
113
- <usage-info>This is usage 1.</usage-info>
114
- </admitted>
115
- <deprecates geographic-area="AUS">
116
- <expression language='jp' script='Japn' type='full'>
117
- <name>Fourth Designation</name>
118
- <grammar>
119
- <gender>masculine</gender>
120
- <gender>feminine</gender>
121
- <number>singular</number>
122
- <number>plural</number>
123
- <isPreposition>false</isPreposition>
124
- <isNoun>true</isNoun>
125
- <grammar-value>irregular declension</grammar-value>
126
- </grammar>
127
- </expression>
128
- <field-of-application>Field</field-of-application>
129
- </deprecates>
130
- <related type='see'>
131
- <preferred geographic-area="GRC">
132
- <expression type="abbreviation">
133
- <name>Fifth Designation</name>
134
- <grammar>
135
- <gender>neuter</gender>
136
- </grammar>
137
- </expression>
138
- <termsource status='identical' type='authoritative'>
139
- <origin bibitemid='ISO2191' type='inline' citeas=''>
140
- <localityStack>
141
- <locality type='section'>
142
- <referenceFrom>2</referenceFrom>
143
- </locality>
144
- </localityStack>
145
- </origin>
146
- </termsource>
147
- </preferred>
148
- <xref target='second'/>
149
- </related>
150
- <domain>Hydraulics</domain>
151
- <subject>pipes</subject>
152
- <definition><verbal-definition>
153
- <p id='_'>Definition</p>
154
- </verbal-definition></definition>
155
- <termsource status='identical' type='authoritative'>
156
- <origin bibitemid='ISO2191' type='inline' citeas=''>
157
- <localityStack>
158
- <locality type='section'>
159
- <referenceFrom>3</referenceFrom>
160
- </locality>
161
- </localityStack>
162
- </origin>
163
- </termsource>
164
- </term>
165
- <term id='second'>
166
- <preferred>
167
- <expression>
168
- <name>Second Term</name>
169
- </expression>
170
- <usage-info>
171
- <p id='_'>Usage Info 1.</p>
172
- <p id='_'>Usage Info 2.</p>
173
- </usage-info>
174
- </preferred>
175
- </term>
176
- </terms>
177
- </sections>
178
- </standard-document>
179
- OUTPUT
180
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
181
- .to be_equivalent_to xmlpp(output)
182
- end
183
-
184
- it "permits multiple preferred terms and admitted terms, "\
185
- "and treats them as synonyms in concepts" do
186
- input = <<~INPUT
187
- #{ASCIIDOC_BLANK_HDR}
188
- == Terms and Definitions
189
-
190
- === First Designation
191
-
192
- preferred:[Second Designation]
193
-
194
- alt:[Third Designation]
195
-
196
- alt:[Fourth Designation]
197
-
198
- deprecated:[Fourth Designation]
199
-
200
- deprecated:[Fifth Designation]
201
-
202
- related:see[Sixth Designation]
203
-
204
- related:contrast[Seventh Designation]
205
-
206
- Definition
207
-
208
- == Clause
209
-
210
- {{First Designation}}
211
-
212
- {{Second Designation}}
213
-
214
- {{Third Designation}}
215
-
216
- INPUT
217
- output = <<~OUTPUT
218
- #{BLANK_HDR}
219
- <sections>
220
- <terms id='_' obligation='normative'>
221
- <title>Terms and definitions</title>
222
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
223
- <term id='term-First-Designation'>
224
- <preferred>
225
- <expression>
226
- <name>First Designation</name>
227
- </expression>
228
- </preferred>
229
- <preferred>
230
- <expression>
231
- <name>Second Designation</name>
232
- </expression>
233
- </preferred>
234
- <admitted>
235
- <expression>
236
- <name>Third Designation</name>
237
- </expression>
238
- </admitted>
239
- <admitted>
240
- <expression>
241
- <name>Fourth Designation</name>
242
- </expression>
243
- </admitted>
244
- <deprecates>
245
- <expression>
246
- <name>Fourth Designation</name>
247
- </expression>
248
- </deprecates>
249
- <deprecates>
250
- <expression>
251
- <name>Fifth Designation</name>
252
- </expression>
253
- </deprecates>
254
- <related type='see'>
255
- <strong>
256
- term
257
- <tt>Sixth Designation</tt>
258
- not resolved via ID
259
- <tt>Sixth-Designation</tt>
260
- </strong>
261
- </related>
262
- <related type='contrast'>
263
- <strong>
264
- term
265
- <tt>Seventh Designation</tt>
266
- not resolved via ID
267
- <tt>Seventh-Designation</tt>
268
- </strong>
269
- </related>
270
- <definition><verbal-definition>
271
- <p id='_'>Definition</p>
272
- </verbal-definition></definition>
273
- </term>
274
- </terms>
275
- <clause id='_' inline-header='false' obligation='normative'>
276
- <title>Clause</title>
277
- <p id='_'>
278
- <concept>
279
- <refterm>First Designation</refterm>
280
- <renderterm>First Designation</renderterm>
281
- <xref target='term-First-Designation'/>
282
- </concept>
283
- </p>
284
- <p id='_'>
285
- <concept>
286
- <refterm>First Designation</refterm>
287
- <renderterm>Second Designation</renderterm>
288
- <xref target='term-First-Designation'/>
289
- </concept>
290
- </p>
291
- <p id='_'>
292
- <concept>
293
- <refterm>First Designation</refterm>
294
- <renderterm>Third Designation</renderterm>
295
- <xref target='term-First-Designation'/>
296
- </concept>
297
- </p>
298
- </clause>
299
- </sections>
300
- </standard-document>
301
- OUTPUT
302
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
303
- .to be_equivalent_to xmlpp(output)
304
- end
305
-
306
- it "respects case in tagging of concepts" do
307
- input = <<~INPUT
308
- #{ASCIIDOC_BLANK_HDR}
309
- == Terms and Definitions
310
-
311
- === First Designation
312
-
313
- Definition
314
-
315
- === First designation
316
-
317
- Definition
318
-
319
- == Clause
320
-
321
- {{First Designation}}
322
-
323
- {{First designation}}
324
-
325
- INPUT
326
- output = <<~OUTPUT
327
- #{BLANK_HDR}
328
- <sections>
329
- <terms id='_' obligation='normative'>
330
- <title>Terms and definitions</title>
331
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
332
- <term id='term-First-Designation'>
333
- <preferred>
334
- <expression>
335
- <name>First Designation</name>
336
- </expression>
337
- </preferred>
338
- <definition>
339
- <verbal-definition>
340
- <p id='_'>Definition</p>
341
- </verbal-definition>
342
- </definition>
343
- </term>
344
- <term id='term-First-designation'>
345
- <preferred>
346
- <expression>
347
- <name>First designation</name>
348
- </expression>
349
- </preferred>
350
- <definition>
351
- <verbal-definition>
352
- <p id='_'>Definition</p>
353
- </verbal-definition>
354
- </definition>
355
- </term>
356
- </terms>
357
- <clause id='_' inline-header='false' obligation='normative'>
358
- <title>Clause</title>
359
- <p id='_'>
360
- <concept>
361
- <refterm>First Designation</refterm>
362
- <renderterm>First Designation</renderterm>
363
- <xref target='term-First-Designation'/>
364
- </concept>
365
- </p>
366
- <p id='_'>
367
- <concept>
368
- <refterm>First designation</refterm>
369
- <renderterm>First designation</renderterm>
370
- <xref target='term-First-designation'/>
371
- </concept>
372
- </p>
373
- </clause>
374
- </sections>
375
- </standard-document>
376
- OUTPUT
377
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
378
- .to be_equivalent_to xmlpp(output)
379
- end
380
-
381
- it "processes letter-symbol designations" do
382
- input = <<~INPUT
383
- #{ASCIIDOC_BLANK_HDR}
384
- == Terms and Definitions
385
-
386
- === First Designation
387
-
388
- [%metadata]
389
- letter-symbol:: true
390
-
391
- preferred:[Second Designation]
392
-
393
- [%metadata]
394
- letter-symbol:: false
395
-
396
- alt:[Third Designation]
397
-
398
- [%metadata]
399
- letter-symbol:: true
400
-
401
- deprecated:[stem:[t_90]]
402
-
403
- related:see[<<second>>,Fifth Designation]
404
-
405
- [%metadata]
406
- letter-symbol:: true
407
-
408
- Definition
409
- INPUT
410
- output = <<~OUTPUT
411
- #{BLANK_HDR}
412
- <sections>
413
- <terms id='_' obligation='normative'>
414
- <title>Terms and definitions</title>
415
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
416
- <term id='term-First-Designation'>
417
- <preferred>
418
- <letter-symbol>
419
- <name>First Designation</name>
420
- </letter-symbol>
421
- </preferred>
422
- <preferred>
423
- <expression>
424
- <name>Second Designation</name>
425
- </expression>
426
- </preferred>
427
- <admitted>
428
- <letter-symbol>
429
- <name>Third Designation</name>
430
- </letter-symbol>
431
- </admitted>
432
- <deprecates>
433
- <letter-symbol>
434
- <name>
435
- <stem type='MathML'>
436
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
437
- <msub>
438
- <mrow>
439
- <mi>t</mi>
440
- </mrow>
441
- <mrow>
442
- <mn>90</mn>
443
- </mrow>
444
- </msub>
445
- </math>
446
- </stem>
447
- </name>
448
- </letter-symbol>
449
- </deprecates>
450
- <related type='see'>
451
- <preferred>
452
- <letter-symbol>
453
- <name>Fifth Designation</name>
454
- </letter-symbol>
455
- </preferred>
456
- <xref target='second'/>
457
- </related>
458
- <definition><verbal-definition>
459
- <p id='_'>Definition</p>
460
- </verbal-definition></definition>
461
- </term>
462
- </terms>
463
- </sections>
464
- </standard-document>
465
- OUTPUT
466
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
467
- .to be_equivalent_to xmlpp(output)
468
- end
469
-
470
- it "processes empty designations" do
471
- input = <<~INPUT
472
- #{ASCIIDOC_BLANK_HDR}
473
- == Terms and Definitions
474
-
475
- [[second]]
476
- === {blank}
477
-
478
- [%metadata]
479
- isInternational:: true
480
-
481
- preferred:[]
482
-
483
- alt:[]
484
-
485
- deprecated:[]
486
-
487
- related:see[<<second>>,]
488
-
489
- Definition
490
- INPUT
491
- output = <<~OUTPUT
492
- #{BLANK_HDR}
493
- <sections>
494
- <terms id='_' obligation='normative'>
495
- <title>Terms and definitions</title>
496
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
497
- <term id='second'>
498
- <preferred>
499
- <expression isInternational='true'>
500
- <name/>
501
- </expression>
502
- </preferred>
503
- <preferred>
504
- <expression>
505
- <name/>
506
- </expression>
507
- </preferred>
508
- <admitted>
509
- <expression>
510
- <name/>
511
- </expression>
512
- </admitted>
513
- <deprecates>
514
- <expression>
515
- <name> </name>
516
- </expression>
517
- </deprecates>
518
- <related type='see'>
519
- <xref target='second'/>
520
- </related>
521
- <definition><verbal-definition>
522
- <p id='_'>Definition</p>
523
- </verbal-definition></definition>
524
- </term>
525
- </terms>
526
- </sections>
527
- </standard-document>
528
- OUTPUT
529
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
530
- .to be_equivalent_to xmlpp(output)
531
- end
532
-
533
- it "processes graphical-symbol designations" do
534
- input = <<~INPUT
535
- #{ASCIIDOC_BLANK_HDR}
536
- == Terms and Definitions
537
-
538
- [[second]]
539
- === {blank}
540
-
541
- .Caption
542
- ....
543
- <LITERAL>
544
- FIGURATIVE
545
- ....
546
-
547
- [%metadata]
548
- isInternational:: true
549
-
550
- preferred:[]
551
-
552
- .Caption
553
- ....
554
- <LITERAL>
555
- FIGURATIVE
556
- ....
557
-
558
- alt:[]
559
-
560
- .Caption
561
- ....
562
- <LITERAL>
563
- FIGURATIVE
564
- ....
565
-
566
- deprecated:[]
567
-
568
- .Caption
569
- ....
570
- <LITERAL>
571
- FIGURATIVE
572
- ....
573
-
574
- related:see[<<second>>,]
575
-
576
- .Caption
577
- ....
578
- <LITERAL>
579
- FIGURATIVE
580
- ....
581
-
582
- Definition
583
- INPUT
584
- output = <<~OUTPUT
585
- #{BLANK_HDR}
586
- <sections>
587
- <terms id='_' obligation='normative'>
588
- <title>Terms and definitions</title>
589
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
590
- <term id='second'>
591
- <preferred>
592
- <graphical-symbol isInternational='true'>
593
- <figure id='_'>
594
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
595
- </figure>
596
- </graphical-symbol>
597
- </preferred>
598
- <preferred>
599
- <graphical-symbol>
600
- <figure id='_'>
601
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
602
- </figure>
603
- </graphical-symbol>
604
- </preferred>
605
- <admitted>
606
- <graphical-symbol>
607
- <figure id='_'>
608
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
609
- </figure>
610
- </graphical-symbol>
611
- </admitted>
612
- <deprecates>
613
- <graphical-symbol>
614
- <figure id='_'>
615
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
616
- </figure>
617
- </graphical-symbol>
618
- </deprecates>
619
- <related type='see'>
620
- <xref target='second'/>
621
- </related>
622
- <definition>
623
- <verbal-definition>
624
- <figure id='_'>
625
- <name>Caption</name>
626
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
627
- </figure>
628
- <p id='_'>Definition</p>
629
- </verbal-definition>
630
- </definition>
631
- </term>
632
- </terms>
633
- </sections>
634
- </standard-document>
635
- OUTPUT
636
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
637
- .to be_equivalent_to xmlpp(output)
638
- end
639
-
640
- it "sorts designations" do
641
- input = <<~INPUT
642
- #{ASCIIDOC_BLANK_HDR}
643
- == Terms and Definitions
644
-
645
- [[des1]]
646
- === First Designation
647
-
648
- [%metadata]
649
- language:: fr
650
- script:: Latn
651
- type:: prefix
652
- isInternational:: true
653
- abbreviation-type:: acronym
654
- pronunciation:: fəɹst
655
- domain:: Hydraulics
656
- subject:: pipes
657
- usage-info:: This is usage.
658
-
659
- related:see[<<des1>>,Fifth Designation]
660
-
661
- [%metadata]
662
- grammar::
663
- gender::: neuter
664
- isVerb::: true
665
-
666
- deprecated:[Fourth Designation]
667
-
668
- [%metadata]
669
- language:: jp
670
- script:: Japn
671
- type:: full
672
- grammar::
673
- gender::: masculine, feminine
674
- isPreposition::: false
675
- isNoun::: true
676
- grammar-value::: irregular declension
677
-
678
- alt:[Third Designation]
679
-
680
- [%metadata]
681
- language:: he
682
- script:: Hebr
683
- type:: suffix
684
- domain:: Hydraulics1
685
- subject: pipes1
686
- usage-info:: This is usage 1.
687
-
688
- preferred:[Second Designation]
689
-
690
- [%metadata]
691
- type:: abbreviation
692
-
693
- Definition
694
-
695
- INPUT
696
- output = <<~OUTPUT
697
- #{BLANK_HDR}
698
- <sections>
699
- <terms id='_' obligation='normative'>
700
- <title>Terms and definitions</title>
701
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
702
- <term id='des1'>
703
- <preferred>
704
- <expression language='fr' script='Latn' type='prefix' isInternational="true">
705
- <name>First Designation</name>
706
- <abbreviation-type>acronym</abbreviation-type>
707
- <pronunciation>f&#601;&#633;st</pronunciation>
708
- </expression>
709
- <usage-info>This is usage.</usage-info>
710
- </preferred>
711
- <preferred>
712
- <expression type='abbreviation'>
713
- <name>Second Designation</name>
714
- </expression>
715
- </preferred>
716
- <admitted>
717
- <expression language='he' script='Hebr' type='suffix'>
718
- <name>Third Designation</name>
719
- </expression>
720
- <usage-info>This is usage 1.</usage-info>
721
- </admitted>
722
- <deprecates>
723
- <expression language='jp' script='Japn' type='full'>
724
- <name>Fourth Designation</name>
725
- <grammar>
726
- <gender>masculine</gender>
727
- <gender>feminine</gender>
728
- <isPreposition>false</isPreposition>
729
- <isNoun>true</isNoun>
730
- <grammar-value>irregular declension</grammar-value>
731
- </grammar>
732
- </expression>
733
- </deprecates>
734
- <related type='see'>
735
- <preferred><expression><name>Fifth Designation</name><grammar><gender>neuter</gender></grammar></expression>
736
- </preferred><xref target='des1'/>
737
- </related>
738
- <domain>Hydraulics</domain>
739
- <subject>pipes</subject>
740
- <definition><verbal-definition>
741
- <p id='_'>Definition</p>
742
- </verbal-definition></definition>
743
- </term>
744
- </terms>
745
- </sections>
746
- </standard-document>
747
- OUTPUT
748
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
749
- .to be_equivalent_to xmlpp(output)
750
- end
751
-
752
- it "processes stem-only terms as admitted" do
753
- input = <<~INPUT
754
- #{ASCIIDOC_BLANK_HDR}
755
- == Terms and Definitions
756
-
757
- === stem:[t_90]
758
-
759
- stem:[t_91]
760
-
761
- Time
762
- INPUT
763
- output = <<~OUTPUT
764
- #{BLANK_HDR}
765
- <sections>
766
- <terms id="_" obligation="normative">
767
- <title>Terms and definitions</title>
768
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
769
- <term id="term-t90"><preferred><letter-symbol><name><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
770
- <mrow>
771
- <mi>t</mi>
772
- </mrow>
773
- <mrow>
774
- <mn>90</mn>
775
- </mrow>
776
- </msub></math></stem></name></letter-symbol></preferred>
777
- <admitted><letter-symbol><name><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
778
- <mrow>
779
- <mi>t</mi>
780
- </mrow>
781
- <mrow>
782
- <mn>91</mn>
783
- </mrow>
784
- </msub></math></stem></name></letter-symbol></admitted>
785
- <definition><verbal-definition><p id="_">Time</p></verbal-definition></definition></term>
786
- </terms>
787
- </sections>
788
- </standard-document>
789
- OUTPUT
790
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
791
- .to be_equivalent_to xmlpp(output)
792
- end
793
-
794
- it "differentiates stem-only and mixed terms" do
795
- input = <<~INPUT
796
- #{ASCIIDOC_BLANK_HDR}
797
- == Terms and Definitions
798
-
799
- === stem:[t_90]
800
-
801
- Time
802
-
803
- === stem:[t_90]-sensitivity
804
-
805
- Sensitivity
806
-
807
- === sensitivity to stem:[t_90]
808
-
809
- Sensitivity #2
810
- INPUT
811
- output = <<~OUTPUT
812
- #{BLANK_HDR}
813
- <sections>
814
- <terms id='_' obligation='normative'>
815
- <title>Terms and definitions</title>
816
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
817
- <term id='term-t90'>
818
- <preferred>
819
- <letter-symbol>
820
- <name>
821
- <stem type='MathML'>
822
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
823
- <msub>
824
- <mrow>
825
- <mi>t</mi>
826
- </mrow>
827
- <mrow>
828
- <mn>90</mn>
829
- </mrow>
830
- </msub>
831
- </math>
832
- </stem>
833
- </name>
834
- </letter-symbol>
835
- </preferred>
836
- <definition>
837
- <verbal-definition>
838
- <p id='_'>Time</p>
839
- </verbal-definition>
840
- </definition>
841
- </term>
842
- <term id='term-t90-sensitivity'>
843
- <preferred>
844
- <expression>
845
- <name>
846
- <stem type='MathML'>
847
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
848
- <msub>
849
- <mrow>
850
- <mi>t</mi>
851
- </mrow>
852
- <mrow>
853
- <mn>90</mn>
854
- </mrow>
855
- </msub>
856
- </math>
857
- </stem>
858
- -sensitivity
859
- </name>
860
- </expression>
861
- </preferred>
862
- <definition>
863
- <verbal-definition>
864
- <p id='_'>Sensitivity</p>
865
- </verbal-definition>
866
- </definition>
867
- </term>
868
- <term id='term-sensitivity-to-t90'>
869
- <preferred>
870
- <expression>
871
- <name>
872
- sensitivity to#{' '}
873
- <stem type='MathML'>
874
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
875
- <msub>
876
- <mrow>
877
- <mi>t</mi>
878
- </mrow>
879
- <mrow>
880
- <mn>90</mn>
881
- </mrow>
882
- </msub>
883
- </math>
884
- </stem>
885
- </name>
886
- </expression>
887
- </preferred>
888
- <definition>
889
- <verbal-definition>
890
- <p id='_'>Sensitivity #2</p>
891
- </verbal-definition>
892
- </definition>
893
- </term>
894
- </terms>
895
- </sections>
896
- </standard-document>
897
- OUTPUT
898
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
899
- .to be_equivalent_to xmlpp(output)
900
- end
901
-
902
- it "moves term domains out of the term definition paragraph" do
903
- input = <<~INPUT
904
- #{ASCIIDOC_BLANK_HDR}
905
- == Terms and Definitions
906
-
907
- === Tempus
908
-
909
- domain:[relativity] Time
910
-
911
- === Tempus1
912
-
913
- Time2
914
-
915
- domain:[relativity2]
916
- INPUT
917
- output = <<~OUTPUT
918
- #{BLANK_HDR}
919
- <sections>
920
- <terms id="_" obligation="normative">
921
- <title>Terms and definitions</title>
922
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
923
- <term id="term-Tempus">
924
- <preferred><expression><name>Tempus</name></expression></preferred>
925
- <domain>relativity</domain><definition><verbal-definition><p id="_"> Time</p></verbal-definition></definition>
926
- </term>
927
- <term id='term-Tempus1'>
928
- <preferred><expression><name>Tempus1</name></expression></preferred>
929
- <domain>relativity2</domain>
930
- <definition><verbal-definition>
931
- <p id='_'>Time2</p>
932
- </verbal-definition></definition>
933
- </term>
934
- </terms>
935
- </sections>
936
- </standard-document>
937
- OUTPUT
938
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
939
- .to be_equivalent_to xmlpp(output)
940
- end
941
-
942
- it "permits multiple blocks in term definition paragraph" do
943
- input = <<~INPUT
944
- = Document title
945
- Author
946
- :docfile: test.adoc
947
- :nodoc:
948
- :novalid:
949
- :stem:
950
-
951
- == Terms and Definitions
952
-
953
- === stem:[t_90]
954
-
955
- [stem]
956
- ++++
957
- t_A
958
- ++++
959
-
960
- This paragraph is extraneous
961
-
962
- * This is a list
963
-
964
- []
965
- . This too is a list
966
-
967
- []
968
- This is:: another list
969
-
970
-
971
- This is a concluding paragraph
972
- INPUT
973
- output = <<~OUTPUT
974
- #{BLANK_HDR}
975
- <sections>
976
- <terms id="_" obligation="normative">
977
- <title>Terms and definitions</title>
978
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
979
- <term id="term-t90"><preferred><letter-symbol><name><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
980
- <mrow>
981
- <mi>t</mi>
982
- </mrow>
983
- <mrow>
984
- <mn>90</mn>
985
- </mrow>
986
- </msub></math></stem></name></letter-symbol></preferred>
987
- <admitted>
988
- <letter-symbol>
989
- <name>
990
- <stem type='MathML'>
991
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
992
- <msub>
993
- <mrow>
994
- <mi>t</mi>
995
- </mrow>
996
- <mrow>
997
- <mi>A</mi>
998
- </mrow>
999
- </msub>
1000
- </math>
1001
- </stem>
1002
- </name>
1003
- </letter-symbol>
1004
- </admitted>
1005
- <definition>
1006
- <verbal-definition>
1007
- <p id="_">This paragraph is extraneous</p>
1008
- <ul id='_'>
1009
- <li>
1010
- <p id='_'>This is a list</p>
1011
- </li>
1012
- </ul>
1013
- <ol id='_' type='arabic'>
1014
- <li>
1015
- <p id='_'>This too is a list</p>
1016
- </li>
1017
- </ol>
1018
- <dl id='_'>
1019
- <dt>This is</dt>
1020
- <dd>
1021
- <p id='_'>another list</p>
1022
- </dd>
1023
- </dl>
1024
- <p id='_'>This is a concluding paragraph</p>
1025
- </verbal-definition>
1026
- </definition>
1027
- </term>
1028
- </terms>
1029
- </sections>
1030
- </standard-document>
1031
- OUTPUT
1032
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1033
- .to be_equivalent_to xmlpp(output)
1034
- end
1035
-
1036
- it "rearranges term note, term example, term source" do
1037
- input = <<~INPUT
1038
- #{ASCIIDOC_BLANK_HDR}
1039
-
1040
- == Terms and definitions
1041
-
1042
- === Term
1043
-
1044
- Definition
1045
-
1046
- [.source]
1047
- <<ISO2191,section=1>>
1048
-
1049
- NOTE: Note
1050
-
1051
- [example]
1052
- Example 1
1053
-
1054
- NOTE: Note 2
1055
-
1056
- [example]
1057
- Example 2
1058
- INPUT
1059
- output = <<~OUTPUT
1060
- #{BLANK_HDR}
1061
- <sections>
1062
- <terms id="_" obligation="normative">
1063
- <title>Terms and definitions</title>
1064
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
1065
- <term id="term-Term"><preferred><expression><name>Term</name></expression></preferred>
1066
- <definition><verbal-definition><p id='_'>Definition</p></verbal-definition></definition>
1067
- <termnote id="_">
1068
- <p id="_">Note</p>
1069
- </termnote><termnote id="_">
1070
- <p id="_">Note 2</p>
1071
- </termnote><termexample id="_">
1072
- <p id="_">Example 1</p>
1073
- </termexample><termexample id="_">
1074
- <p id="_">Example 2</p>
1075
- </termexample><termsource status="identical" type="authoritative">
1076
- <origin bibitemid="ISO2191" type="inline" citeas="">
1077
- <localityStack>
1078
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
1079
- </localityStack>
1080
- </origin>
1081
- </termsource></term>
1082
- </terms>
1083
- </sections>
1084
- </standard-document>
1085
- OUTPUT
1086
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1087
- .to be_equivalent_to xmlpp(output)
1088
- end
1089
-
1090
- it "supports non-verbal definitions" do
1091
- input = <<~INPUT
1092
- #{ASCIIDOC_BLANK_HDR}
1093
-
1094
- == Terms and definitions
1095
-
1096
- === Term
1097
-
1098
- [.definition]
1099
- --
1100
-
1101
- Definition
1102
-
1103
- [.source]
1104
- <<ISO2191,section=1>>
1105
- --
1106
-
1107
- [.definition]
1108
- --
1109
- |===
1110
- | A | B
1111
-
1112
- | C | D
1113
- |===
1114
- --
1115
-
1116
- [.source]
1117
- <<ISO2191,section=2>>
1118
-
1119
- === Term 2
1120
-
1121
- [.definition]
1122
- --
1123
-
1124
- ....
1125
- Literal
1126
- ....
1127
-
1128
- [stem]
1129
- ++++
1130
- x = y
1131
- ++++
1132
-
1133
- [.source]
1134
- <<ISO2191,section=3>>
1135
- --
1136
-
1137
- INPUT
1138
- output = <<~OUTPUT
1139
- #{BLANK_HDR}
1140
- <sections>
1141
- <terms id='_' obligation='normative'>
1142
- <title>Terms and definitions</title>
1143
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1144
- <term id='term-Term'>
1145
- <preferred>
1146
- <expression>
1147
- <name>Term</name>
1148
- </expression>
1149
- </preferred>
1150
- <definition>
1151
- <verbal-definition>
1152
- <p id='_'>Definition</p>
1153
- <termsource status='identical' type='authoritative'>
1154
- <origin bibitemid='ISO2191' type='inline' citeas=''>
1155
- <localityStack>
1156
- <locality type='section'>
1157
- <referenceFrom>1</referenceFrom>
1158
- </locality>
1159
- </localityStack>
1160
- </origin>
1161
- </termsource>
1162
- </verbal-definition>
1163
- <non-verbal-representation>
1164
- <table id='_'>
1165
- <thead>
1166
- <tr>
1167
- <th valign='top' align='left'>A</th>
1168
- <th valign='top' align='left'>B</th>
1169
- </tr>
1170
- </thead>
1171
- <tbody>
1172
- <tr>
1173
- <td valign='top' align='left'>C</td>
1174
- <td valign='top' align='left'>D</td>
1175
- </tr>
1176
- </tbody>
1177
- </table>
1178
- </non-verbal-representation>
1179
- </definition>
1180
- <termsource status='identical' type='authoritative'>
1181
- <origin bibitemid='ISO2191' type='inline' citeas=''>
1182
- <localityStack>
1183
- <locality type='section'>
1184
- <referenceFrom>2</referenceFrom>
1185
- </locality>
1186
- </localityStack>
1187
- </origin>
1188
- </termsource>
1189
- </term>
1190
- <term id='term-Term-2'>
1191
- <preferred>
1192
- <expression>
1193
- <name>Term 2</name>
1194
- </expression>
1195
- </preferred>
1196
- <definition>
1197
- <non-verbal-representation>
1198
- <figure id='_'>
1199
- <pre id='_'>Literal</pre>
1200
- </figure>
1201
- <formula id='_'>
1202
- <stem type='MathML'>
1203
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1204
- <mi>x</mi>
1205
- <mo>=</mo>
1206
- <mi>y</mi>
1207
- </math>
1208
- </stem>
1209
- </formula>
1210
- <termsource status='identical' type='authoritative'>
1211
- <origin bibitemid='ISO2191' type='inline' citeas=''>
1212
- <localityStack>
1213
- <locality type='section'>
1214
- <referenceFrom>3</referenceFrom>
1215
- </locality>
1216
- </localityStack>
1217
- </origin>
1218
- </termsource>
1219
- </non-verbal-representation>
1220
- </definition>
1221
- </term>
1222
- </terms>
1223
- </sections>
1224
- </standard-document>
1225
- OUTPUT
1226
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1227
- .to be_equivalent_to xmlpp(output)
1228
- end
1229
-
1230
- it "differentiates stem expressions before, after, and within verbal definitions" do
1231
- input = <<~INPUT
1232
- #{ASCIIDOC_BLANK_HDR}
1233
-
1234
- == Terms and definitions
1235
-
1236
- === Term
1237
-
1238
- stem:[lambda]
1239
-
1240
- [.definition]
1241
- --
1242
-
1243
- Definition
1244
-
1245
- stem:[mu]
1246
- --
1247
-
1248
- [.definition]
1249
- --
1250
-
1251
- stem:[nu]
1252
- --
1253
-
1254
- INPUT
1255
- output = <<~OUTPUT
1256
- #{BLANK_HDR}
1257
- <sections>
1258
- <terms id='_' obligation='normative'>
1259
- <title>Terms and definitions</title>
1260
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1261
- <term id='term-Term'>
1262
- <preferred>
1263
- <expression>
1264
- <name>Term</name>
1265
- </expression>
1266
- </preferred>
1267
- <admitted>
1268
- <letter-symbol>
1269
- <name>
1270
- <stem type='MathML'>
1271
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1272
- <mi>&#955;</mi>
1273
- </math>
1274
- </stem>
1275
- </name>
1276
- </letter-symbol>
1277
- </admitted>
1278
- <definition>
1279
- <verbal-definition>
1280
- <p id='_'>Definition</p>
1281
- <p id='_'>
1282
- <stem type='MathML'>
1283
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1284
- <mi>&#956;</mi>
1285
- </math>
1286
- </stem>
1287
- </p>
1288
- </verbal-definition>
1289
- </definition>
1290
- <definition>
1291
- <verbal-definition>
1292
- <p id='_'>
1293
- <stem type='MathML'>
1294
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1295
- <mi>&#957;</mi>
1296
- </math>
1297
- </stem>
1298
- </p>
1299
- </verbal-definition>
1300
- </definition>
1301
- </term>
1302
- </terms>
1303
- </sections>
1304
- </standard-document>
1305
- OUTPUT
1306
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1307
- .to be_equivalent_to xmlpp(output)
1308
- end
1309
-
1310
- it "differentiates formuals before, after, and within verbal definitions" do
1311
- input = <<~INPUT
1312
- #{ASCIIDOC_BLANK_HDR}
1313
-
1314
- == Terms and definitions
1315
-
1316
- === Term
1317
-
1318
- [stem]
1319
- ++++
1320
- lambda
1321
- ++++
1322
-
1323
- [.definition]
1324
- --
1325
-
1326
- Definition
1327
-
1328
- [stem]
1329
- ++++
1330
- mu
1331
- ++++
1332
- --
1333
-
1334
- [.definition]
1335
- --
1336
-
1337
- [stem]
1338
- ++++
1339
- nu
1340
- ++++
1341
- --
1342
-
1343
- INPUT
1344
- output = <<~OUTPUT
1345
- #{BLANK_HDR}
1346
- <sections>
1347
- <terms id='_' obligation='normative'>
1348
- <title>Terms and definitions</title>
1349
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1350
- <term id='term-Term'>
1351
- <preferred>
1352
- <expression>
1353
- <name>Term</name>
1354
- </expression>
1355
- </preferred>
1356
- <admitted>
1357
- <letter-symbol>
1358
- <name>
1359
- <stem type='MathML'>
1360
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1361
- <mi>&#955;</mi>
1362
- </math>
1363
- </stem>
1364
- </name>
1365
- </letter-symbol>
1366
- </admitted>
1367
- <definition>
1368
- <verbal-definition>
1369
- <p id='_'>Definition</p>
1370
- <formula id='_'>
1371
- <stem type='MathML'>
1372
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1373
- <mi>&#956;</mi>
1374
- </math>
1375
- </stem>
1376
- </formula>
1377
- </verbal-definition>
1378
- <non-verbal-representation>
1379
- <formula id='_'>
1380
- <stem type='MathML'>
1381
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1382
- <mi>&#957;</mi>
1383
- </math>
1384
- </stem>
1385
- </formula>
1386
- </non-verbal-representation>
1387
- </definition>
1388
- </term>
1389
- </terms>
1390
- </sections>
1391
- </standard-document>
1392
- OUTPUT
1393
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1394
- .to be_equivalent_to xmlpp(output)
1395
- end
1396
-
1397
- it "automatically indexes term indexes" do
1398
- input = <<~INPUT
1399
- #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:\n/, ":nodoc:\n:index-terms:\n")}
1400
-
1401
- == Terms and definitions
1402
-
1403
- === Term
1404
-
1405
- [stem]
1406
- ++++
1407
- lambda
1408
- ++++
1409
-
1410
- admitted:[x]
1411
-
1412
- === Term2
1413
-
1414
- preferred:[stem:[mu_0 // 2]]
1415
-
1416
- == Symbols and Abbreviated Terms
1417
-
1418
- x^2^:: Definition
1419
- INPUT
1420
- output = <<~OUTPUT
1421
- <standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='#{Metanorma::Standoc::VERSION}'>
1422
- <bibdata type='standard'>
1423
- <title language='en' format='text/plain'>Document title</title>
1424
- <language>en</language>
1425
- <script>Latn</script>
1426
- <status>
1427
- <stage>published</stage>
1428
- </status>
1429
- <copyright>
1430
- <from>#{Time.now.year}</from>
1431
- </copyright>
1432
- <ext>
1433
- <doctype>standard</doctype>
1434
- </ext>
1435
- </bibdata>
1436
- <sections>
1437
- <terms id='_' obligation='normative'>
1438
- <title>Terms and definitions</title>
1439
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1440
- <term id='term-Term'>
1441
- <preferred>
1442
- <expression>
1443
- <name>
1444
- Term
1445
- <index>
1446
- <primary>Term</primary>
1447
- </index>
1448
- </name>
1449
- </expression>
1450
- </preferred>
1451
- <admitted>
1452
- <expression>
1453
- <name>x</name>
1454
- </expression>
1455
- </admitted>
1456
- <admitted>
1457
- <letter-symbol>
1458
- <name>
1459
- <stem type='MathML'>
1460
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1461
- <mi>&#955;</mi>
1462
- </math>
1463
- </stem>
1464
- </name>
1465
- </letter-symbol>
1466
- </admitted>
1467
- </term>
1468
- <term id='term-Term2'>
1469
- <preferred>
1470
- <expression>
1471
- <name>
1472
- Term2
1473
- <index>
1474
- <primary>Term2</primary>
1475
- </index>
1476
- </name>
1477
- </expression>
1478
- </preferred>
1479
- <preferred>
1480
- <letter-symbol>
1481
- <name>
1482
- <stem type='MathML'>
1483
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1484
- <msub>
1485
- <mrow>
1486
- <mi>&#956;</mi>
1487
- </mrow>
1488
- <mrow>
1489
- <mn>0</mn>
1490
- </mrow>
1491
- </msub>
1492
- <mo>/</mo>
1493
- <mn>2</mn>
1494
- </math>
1495
- </stem>
1496
- <index>
1497
- <primary>
1498
- <stem type='MathML'>
1499
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1500
- <msub>
1501
- <mrow>
1502
- <mi>&#956;</mi>
1503
- </mrow>
1504
- <mrow>
1505
- <mn>0</mn>
1506
- </mrow>
1507
- </msub>
1508
- <mo>/</mo>
1509
- <mn>2</mn>
1510
- </math>
1511
- </stem>
1512
- </primary>
1513
- </index>
1514
- </name>
1515
- </letter-symbol>
1516
- </preferred>
1517
- </term>
1518
- </terms>
1519
- <definitions id='_' obligation='normative'>
1520
- <title>Symbols and abbreviated terms</title>
1521
- <dl id='_'>
1522
- <dt id='symbol-x2'>
1523
- x
1524
- <sup>2</sup>
1525
- <index>
1526
- <primary>
1527
- x
1528
- <sup>2</sup>
1529
- </primary>
1530
- </index>
1531
- </dt>
1532
- <dd>
1533
- <p id='_'>Definition</p>
1534
- </dd>
1535
- </dl>
1536
- </definitions>
1537
- </sections>
1538
- </standard-document>
1539
- OUTPUT
1540
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1541
- .to be_equivalent_to xmlpp(output)
1542
- end
1543
- end