metanorma-standoc 1.5.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +66 -0
  3. data/README.adoc +1 -3
  4. data/lib/asciidoctor/standoc/base.rb +6 -1
  5. data/lib/asciidoctor/standoc/basicdoc.rng +4 -11
  6. data/lib/asciidoctor/standoc/cleanup.rb +78 -12
  7. data/lib/asciidoctor/standoc/cleanup_block.rb +41 -4
  8. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +14 -0
  9. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +25 -0
  10. data/lib/asciidoctor/standoc/cleanup_inline.rb +6 -2
  11. data/lib/asciidoctor/standoc/cleanup_ref.rb +3 -4
  12. data/lib/asciidoctor/standoc/converter.rb +58 -3
  13. data/lib/asciidoctor/standoc/front.rb +9 -3
  14. data/lib/asciidoctor/standoc/front_contributor.rb +43 -11
  15. data/lib/asciidoctor/standoc/inline.rb +18 -40
  16. data/lib/asciidoctor/standoc/isodoc.rng +27 -50
  17. data/lib/asciidoctor/standoc/lists.rb +4 -2
  18. data/lib/asciidoctor/standoc/macros.rb +28 -2
  19. data/lib/asciidoctor/standoc/ref.rb +46 -48
  20. data/lib/asciidoctor/standoc/ref_sect.rb +16 -8
  21. data/lib/asciidoctor/standoc/section.rb +5 -9
  22. data/lib/liquid/custom_blocks/with_json_nested_context.rb +18 -0
  23. data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +19 -0
  24. data/lib/metanorma/standoc.rb +0 -5
  25. data/lib/metanorma/standoc/version.rb +20 -1
  26. data/metanorma-standoc.gemspec +7 -3
  27. data/spec/asciidoctor-standoc/base_spec.rb +246 -9
  28. data/spec/asciidoctor-standoc/blocks_spec.rb +1 -1
  29. data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +1514 -0
  30. data/spec/asciidoctor-standoc/cleanup_spec.rb +384 -1547
  31. data/spec/asciidoctor-standoc/inline_spec.rb +128 -4
  32. data/spec/asciidoctor-standoc/isobib_cache_spec.rb +15 -22
  33. data/spec/asciidoctor-standoc/lists_spec.rb +10 -1
  34. data/spec/asciidoctor-standoc/macros_json2text_spec.rb +1 -1
  35. data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +80 -0
  36. data/spec/asciidoctor-standoc/macros_spec.rb +258 -0
  37. data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +1 -1
  38. data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -8
  39. data/spec/asciidoctor-standoc/refs_spec.rb +362 -104
  40. data/spec/asciidoctor-standoc/validate_spec.rb +26 -0
  41. data/spec/fixtures/diagram_definitions.lutaml +22 -0
  42. data/spec/fixtures/test.exp +121 -0
  43. data/spec/spec_helper.rb +34 -1
  44. data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +201 -3
  45. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +47 -231
  46. data/spec/vcr_cassettes/isobib_get_123.yml +14 -60
  47. data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -116
  48. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +361 -0
  49. data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -60
  50. data/spec/vcr_cassettes/isobib_get_124.yml +12 -58
  51. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
  52. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +292 -162
  53. metadata +59 -17
  54. data/.github/workflows/macos.yml +0 -46
  55. data/.github/workflows/ubuntu.yml +0 -49
  56. data/.github/workflows/windows.yml +0 -53
  57. data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +0 -123
  58. data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +0 -43
  59. data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +0 -43
  60. data/lib/metanorma/standoc/latexml_requirement.rb +0 -62
  61. data/lib/metanorma/standoc/requirement.rb +0 -13
@@ -273,7 +273,7 @@ RSpec.describe Asciidoctor::Standoc do
273
273
  For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
274
274
  ****
275
275
  INPUT
276
- <standard-document xmlns="https://www.metanorma.org/ns/standoc">
276
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
277
277
  <bibdata type="standard">
278
278
  <title language="en" format="text/plain">Document title</title>
279
279
 
@@ -0,0 +1,1514 @@
1
+ require "spec_helper"
2
+ require "relaton_iec"
3
+ require "fileutils"
4
+
5
+ RSpec.describe Asciidoctor::Standoc do
6
+ it "strips any initial boilerplate from terms and definitions" do
7
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
8
+ #{ASCIIDOC_BLANK_HDR}
9
+ == Terms and Definitions
10
+
11
+ I am boilerplate
12
+
13
+ * So am I
14
+
15
+ === Time
16
+
17
+ This paragraph is extraneous
18
+ INPUT
19
+ #{BLANK_HDR}
20
+ <sections>
21
+ <terms id="_" obligation="normative"><title>Terms and definitions</title>
22
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
23
+
24
+ <term id="_">
25
+ <preferred>Time</preferred>
26
+ <definition><p id="_">This paragraph is extraneous</p></definition>
27
+ </term></terms>
28
+ </sections>
29
+ </standard-document>
30
+ OUTPUT
31
+ end
32
+
33
+ it "removes initial extraneous material from Normative References" do
34
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
35
+ #{ASCIIDOC_BLANK_HDR}
36
+ [bibliography]
37
+ == Normative References
38
+
39
+ This is extraneous information
40
+
41
+ * [[[iso216,ISO 216]]], _Reference_
42
+
43
+ This is also extraneous information
44
+ INPUT
45
+ #{BLANK_HDR}
46
+ <sections></sections>
47
+ <bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
48
+ #{NORM_REF_BOILERPLATE}
49
+ <bibitem id="iso216" type="standard">
50
+ <title format="text/plain">Reference</title>
51
+ <docidentifier>ISO 216</docidentifier>
52
+ <docnumber>216</docnumber>
53
+ <contributor>
54
+ <role type="publisher"/>
55
+ <organization>
56
+ <name>ISO</name>
57
+ </organization>
58
+ </contributor>
59
+ </bibitem>
60
+ <p id='_'>This is also extraneous information</p>
61
+ </references>
62
+ </bibliography>
63
+ </standard-document>
64
+ OUTPUT
65
+ end
66
+
67
+ it "sorts references with their notes in Bibliography" do
68
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
69
+ #{ASCIIDOC_BLANK_HDR}
70
+ [bibliography]
71
+ == Bibliography
72
+
73
+ This is extraneous information
74
+
75
+ * [[[iso216,ISO 216]]], _Reference_
76
+
77
+ NOTE: ABC
78
+
79
+ NOTE: DEF
80
+
81
+ This is further extraneous information
82
+
83
+ NOTE: GHI
84
+
85
+ * [[[iso216,ISO 215]]], _Reference_
86
+
87
+ NOTE: JKL
88
+
89
+ This is also extraneous information
90
+ INPUT
91
+ #{BLANK_HDR}
92
+ <sections> </sections>
93
+ <bibliography>
94
+ <references id='_' obligation='informative' normative="false">
95
+ <title>Bibliography</title>
96
+ <p id='_'>This is extraneous information</p>
97
+ <bibitem id='iso216' type='standard'>
98
+ <title format='text/plain'>Reference</title>
99
+ <docidentifier>ISO 216</docidentifier>
100
+ <docnumber>216</docnumber>
101
+ <contributor>
102
+ <role type='publisher'/>
103
+ <organization>
104
+ <name>ISO</name>
105
+ </organization>
106
+ </contributor>
107
+ </bibitem>
108
+ <note id='_'>
109
+ <p id='_'>ABC</p>
110
+ </note>
111
+ <note id='_'>
112
+ <p id='_'>DEF</p>
113
+ </note>
114
+ <bibitem id='iso216' type='standard'>
115
+ <title format='text/plain'>Reference</title>
116
+ <docidentifier>ISO 215</docidentifier>
117
+ <docnumber>215</docnumber>
118
+ <contributor>
119
+ <role type='publisher'/>
120
+ <organization>
121
+ <name>ISO</name>
122
+ </organization>
123
+ </contributor>
124
+ </bibitem>
125
+ <note id='_'>
126
+ <p id='_'>JKL</p>
127
+ </note>
128
+ <p id='_'>
129
+ This is further extraneous information
130
+ <note id='_'>
131
+ <p id='_'>GHI</p>
132
+ </note>
133
+ </p>
134
+ <p id='_'>This is also extraneous information</p>
135
+ </references>
136
+ </bibliography>
137
+ </standard-document>
138
+ OUTPUT
139
+ end
140
+
141
+ it "defaults section obligations" do
142
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
143
+ #{ASCIIDOC_BLANK_HDR}
144
+
145
+ == Clause
146
+ Text
147
+
148
+ [appendix]
149
+ == Clause
150
+
151
+ Text
152
+ INPUT
153
+ #{BLANK_HDR}
154
+ <sections><clause id="_" inline-header="false" obligation="normative">
155
+ <title>Clause</title>
156
+ <p id="_">Text</p>
157
+ </clause>
158
+ </sections><annex id="_" inline-header="false" obligation="normative">
159
+ <title>Clause</title>
160
+ <p id="_">Text</p>
161
+ </annex>
162
+ </standard-document>
163
+ OUTPUT
164
+ end
165
+
166
+ it "extends clause levels past 5" do
167
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
168
+ #{ASCIIDOC_BLANK_HDR}
169
+
170
+ == Clause1
171
+
172
+ === Clause2
173
+
174
+ ==== Clause3
175
+
176
+ ===== Clause4
177
+
178
+ ====== Clause 5
179
+
180
+ [level=6]
181
+ ====== Clause 6
182
+
183
+ [level=7]
184
+ ====== Clause 7A
185
+
186
+ [level=7]
187
+ ====== Clause 7B
188
+
189
+ [level=6]
190
+ ====== Clause 6B
191
+
192
+ ====== Clause 5B
193
+
194
+ INPUT
195
+ #{BLANK_HDR}
196
+ <sections>
197
+ <clause id="_" inline-header="false" obligation="normative">
198
+ <title>Clause1</title>
199
+ <clause id="_" inline-header="false" obligation="normative">
200
+ <title>Clause2</title>
201
+ <clause id="_" inline-header="false" obligation="normative">
202
+ <title>Clause3</title>
203
+ <clause id="_" inline-header="false" obligation="normative"><title>Clause4</title><clause id="_" inline-header="false" obligation="normative">
204
+ <title>Clause 5</title>
205
+ <clause id="_" inline-header="false" obligation="normative">
206
+ <title>Clause 6</title>
207
+ <clause id="_" inline-header="false" obligation="normative">
208
+ <title>Clause 7A</title>
209
+ </clause><clause id="_" inline-header="false" obligation="normative">
210
+ <title>Clause 7B</title>
211
+ </clause></clause><clause id="_" inline-header="false" obligation="normative">
212
+ <title>Clause 6B</title>
213
+ </clause></clause>
214
+
215
+
216
+
217
+
218
+ <clause id="_" inline-header="false" obligation="normative">
219
+ <title>Clause 5B</title>
220
+ </clause></clause>
221
+ </clause>
222
+ </clause>
223
+ </clause>
224
+ </sections>
225
+ </standard-document>
226
+ OUTPUT
227
+ end
228
+
229
+ it "inserts boilerplate before empty Normative References" do
230
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
231
+ #{ASCIIDOC_BLANK_HDR}
232
+
233
+ [bibliography]
234
+ == Normative References
235
+
236
+ INPUT
237
+ #{BLANK_HDR}
238
+ <sections>
239
+
240
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
241
+ <title>Normative references</title><p id="_">There are no normative references in this document.</p>
242
+ </references></bibliography>
243
+ </standard-document>
244
+ OUTPUT
245
+ end
246
+
247
+ it "inserts boilerplate before non-empty Normative References" do
248
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
249
+ #{ASCIIDOC_BLANK_HDR}
250
+
251
+ [bibliography]
252
+ == Normative References
253
+ * [[[a,b]]] A
254
+
255
+ INPUT
256
+ #{BLANK_HDR}
257
+ <sections>
258
+
259
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
260
+ <title>Normative references</title><p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
261
+ <bibitem id="a">
262
+ <formattedref format="application/x-isodoc+xml">A</formattedref>
263
+ <docidentifier>b</docidentifier>
264
+ </bibitem>
265
+ </references></bibliography>
266
+ </standard-document>
267
+
268
+ OUTPUT
269
+ end
270
+
271
+ it "inserts boilerplate before empty Normative References in French" do
272
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
273
+ = Document title
274
+ Author
275
+ :docfile: test.adoc
276
+ :nodoc:
277
+ :novalid:
278
+ :no-isobib:
279
+ :language: fr
280
+
281
+ [bibliography]
282
+ == Normative References
283
+
284
+ INPUT
285
+ #{BLANK_HDR.sub(/<language>en/, "<language>fr")}
286
+ <sections>
287
+
288
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
289
+ <title>Références normatives</title><p id="_">Le présent document ne contient aucune référence normative.</p>
290
+ </references></bibliography>
291
+ </standard-document>
292
+ OUTPUT
293
+ end
294
+
295
+ it "processes section names, with footnotes" do
296
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
297
+ #{ASCIIDOC_BLANK_HDR}
298
+ .Foreword.footnote:[A]
299
+
300
+ Text
301
+
302
+ [abstract]
303
+ == Abstract.footnote:[A]
304
+
305
+ Text
306
+
307
+ [heading=introduction]
308
+ == Introduction.footnote:[A]
309
+
310
+ === Introduction Subsection
311
+
312
+ [heading=acknowledgements]
313
+ == Acknowledgements.footnote:[A]
314
+
315
+ [.preface]
316
+ == Dedication
317
+
318
+ [heading=scope]
319
+ == Scope.footnote:[A]
320
+
321
+ Text
322
+
323
+ [bibliography,heading=normative references]
324
+ == Normative References.footnote:[A]
325
+
326
+ [bibliography,normative=true]
327
+ == Normative References 2.footnote:[A]
328
+
329
+ [heading=terms and definitions]
330
+ == Terms and Definitions.footnote:[A]
331
+
332
+ === Term1
333
+
334
+ [heading="terms and definitions"]
335
+ == Terms, Definitions, Symbols and Abbreviated Terms.footnote:[A]
336
+
337
+ [.nonterm]
338
+ === Introduction
339
+
340
+ ==== Intro 1
341
+
342
+ === Intro 2
343
+
344
+ [.nonterm]
345
+ ==== Intro 3
346
+
347
+ === Intro 4
348
+
349
+ ==== Intro 5
350
+
351
+ ===== Term1
352
+
353
+ === Normal Terms
354
+
355
+ ==== Term2
356
+
357
+ [heading=symbols and abbreviated terms]
358
+ === Symbols and Abbreviated Terms.footnote:[A]
359
+
360
+ [.nonterm]
361
+ ==== General
362
+
363
+ [heading=symbols]
364
+ ==== Symbols 1.footnote:[A]
365
+
366
+ [heading=abbreviated terms]
367
+ == Abbreviated Terms.footnote:[A]
368
+
369
+ == Clause 4
370
+
371
+ === Introduction
372
+
373
+ === Clause 4.2
374
+
375
+ == Terms and Definitions
376
+
377
+ [appendix]
378
+ == Annex.footnote:[A]
379
+
380
+ === Annex A.1
381
+
382
+ [bibliography,heading=bibliography]
383
+ == Bibliography.footnote:[A]
384
+
385
+ [bibliography,normative=false]
386
+ == Bibliography 2.footnote:[A]
387
+
388
+ === Bibliography Subsection
389
+
390
+ INPUT
391
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
392
+ <bibdata type='standard'>
393
+ <title language='en' format='text/plain'>Document title</title>
394
+ <language>en</language>
395
+ <script>Latn</script>
396
+ <abstract>
397
+ <p>Text</p>
398
+ </abstract>
399
+ <status>
400
+ <stage>published</stage>
401
+ </status>
402
+ <copyright>
403
+ <from>2020</from>
404
+ </copyright>
405
+ <ext>
406
+ <doctype>article</doctype>
407
+ </ext>
408
+ </bibdata>
409
+ <preface>
410
+ <abstract id='_'>
411
+ <title>Abstract</title>
412
+ <p id='_'>Text</p>
413
+ </abstract>
414
+ <foreword id='_' obligation='informative'>
415
+ <title>
416
+ Foreword
417
+ <fn reference='1'>
418
+ <p id='_'>A</p>
419
+ </fn>
420
+ </title>
421
+ <p id='_'>Text</p>
422
+ </foreword>
423
+ <introduction id='_' obligation='informative'>
424
+ <title>Introduction</title>
425
+ <clause id='_' inline-header='false' obligation='informative'>
426
+ <title>Introduction Subsection</title>
427
+ </clause>
428
+ </introduction>
429
+ <clause id='_' inline-header='false' obligation='informative'>
430
+ <title>Dedication</title>
431
+ </clause>
432
+ <acknowledgements id='_' obligation='informative'>
433
+ <title>
434
+ Acknowledgements
435
+ <fn reference='1'>
436
+ <p id='_'>A</p>
437
+ </fn>
438
+ </title>
439
+ </acknowledgements>
440
+ </preface>
441
+ <sections>
442
+ <clause id='_' type='scope' inline-header='false' obligation='normative'>
443
+ <title>
444
+ Scope
445
+ <fn reference='1'>
446
+ <p id='_'>A</p>
447
+ </fn>
448
+ </title>
449
+ <p id='_'>Text</p>
450
+ </clause>
451
+ <terms id='_' obligation='normative'>
452
+ <title>
453
+ Terms and definitions
454
+ <fn reference='1'>
455
+ <p id='_'>A</p>
456
+ </fn>
457
+ </title>
458
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
459
+ <term id='_'>
460
+ <preferred>Term1</preferred>
461
+ </term>
462
+ </terms>
463
+ <clause id='_' inline-header='false' obligation='normative'>
464
+ <title>
465
+ Terms, Definitions, Symbols and Abbreviated Terms.
466
+ <fn reference='1'>
467
+ <p id='_'>A</p>
468
+ </fn>
469
+ </title>
470
+ <clause id='_' inline-header='false' obligation='normative'>
471
+ <title>Introduction</title>
472
+ <clause id='_' inline-header='false' obligation='normative'>
473
+ <title>Intro 1</title>
474
+ </clause>
475
+ </clause>
476
+ <clause id='_' inline-header='false' obligation='normative'>
477
+ <title>Intro 2</title>
478
+ <clause id='_' inline-header='false' obligation='normative'>
479
+ <title>Intro 3</title>
480
+ </clause>
481
+ </clause>
482
+ <clause id='_' inline-header='false' obligation='normative'>
483
+ <title>Intro 4</title>
484
+ <clause id='_' inline-header='false' obligation='normative'>
485
+ <title>Intro 5</title>
486
+ <clause id='_' inline-header='false' obligation='normative'>
487
+ <title>Term1</title>
488
+ </clause>
489
+ </clause>
490
+ </clause>
491
+ <clause id='_' inline-header='false' obligation='normative'>
492
+ <title>Normal Terms</title>
493
+ <clause id='_' inline-header='false' obligation='normative'>
494
+ <title>Term2</title>
495
+ </clause>
496
+ </clause>
497
+ <definitions id='_' obligation='normative'>
498
+ <title>
499
+ Symbols and abbreviated terms
500
+ <fn reference='1'>
501
+ <p id='_'>A</p>
502
+ </fn>
503
+ </title>
504
+ <clause id='_' inline-header='false' obligation='normative'>
505
+ <title>General</title>
506
+ </clause>
507
+ <definitions id='_' type='symbols' obligation='normative'>
508
+ <title>
509
+ Symbols
510
+ <fn reference='1'>
511
+ <p id='_'>A</p>
512
+ </fn>
513
+ </title>
514
+ </definitions>
515
+ </definitions>
516
+ </clause>
517
+ <definitions id='_' type='abbreviated_terms' obligation='normative'>
518
+ <title>
519
+ Abbreviated terms
520
+ <fn reference='1'>
521
+ <p id='_'>A</p>
522
+ </fn>
523
+ </title>
524
+ </definitions>
525
+ <clause id='_' inline-header='false' obligation='normative'>
526
+ <title>Clause 4</title>
527
+ <clause id='_' inline-header='false' obligation='normative'>
528
+ <title>Introduction</title>
529
+ </clause>
530
+ <clause id='_' inline-header='false' obligation='normative'>
531
+ <title>Clause 4.2</title>
532
+ </clause>
533
+ </clause>
534
+ <clause id='_' inline-header='false' obligation='normative'>
535
+ <title>Terms and Definitions</title>
536
+ </clause>
537
+ </sections>
538
+ <annex id='_' inline-header='false' obligation='normative'>
539
+ <title>
540
+ Annex.
541
+ <fn reference='1'>
542
+ <p id='_'>A</p>
543
+ </fn>
544
+ </title>
545
+ <clause id='_' inline-header='false' obligation='normative'>
546
+ <title>Annex A.1</title>
547
+ </clause>
548
+ </annex>
549
+ <bibliography>
550
+ <references id='_' normative='true' obligation='informative'>
551
+ <title>Normative references
552
+ <fn reference='1'>
553
+ <p id='_'>A</p>
554
+ </fn>
555
+ </title>
556
+ <p id='_'>There are no normative references in this document.</p>
557
+ </references>
558
+ <references id='_' normative='false' obligation='informative'>
559
+ <title>Bibliography
560
+ <fn reference='1'>
561
+ <p id='_'>A</p>
562
+ </fn>
563
+ </title>
564
+ </references>
565
+ <references id='_' normative='false' obligation='informative'>
566
+ <title>Bibliography.
567
+ <fn reference='1'>
568
+ <p id='_'>A</p>
569
+ </fn>
570
+ </title>
571
+ </references>
572
+ <clause id='_' obligation='informative'>
573
+ <title>Bibliography 2.
574
+ <fn reference='1'>
575
+ <p id='_'>A</p>
576
+ </fn>
577
+ </title>
578
+ <references id='_' normative='false' obligation='informative'>
579
+ <title>Bibliography Subsection</title>
580
+ </references>
581
+ </clause>
582
+ </bibliography>
583
+ </standard-document>
584
+ OUTPUT
585
+ end
586
+
587
+ it "processes section names, default to English" do
588
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
589
+ #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
590
+ .Foreword
591
+
592
+ Text
593
+
594
+ [abstract]
595
+ == Abstract
596
+
597
+ Text
598
+
599
+ [heading=introduction]
600
+ == Introduction
601
+
602
+ === Introduction Subsection
603
+
604
+ [heading=acknowledgements]
605
+ == Acknowledgements
606
+
607
+ [.preface]
608
+ == Dedication
609
+
610
+ [heading=scope]
611
+ == Scope
612
+
613
+ Text
614
+
615
+ [bibliography,heading=normative references]
616
+ == Normative References
617
+
618
+ [bibliography,normative=true]
619
+ == Normative References 2
620
+
621
+ [heading=terms and definitions]
622
+ == Terms and Definitions
623
+
624
+ === Term1
625
+
626
+ [heading="terms and definitions"]
627
+ == Terms, Definitions, Symbols and Abbreviated Terms
628
+
629
+ [.nonterm]
630
+ === Introduction
631
+
632
+ ==== Intro 1
633
+
634
+ === Intro 2
635
+
636
+ [.nonterm]
637
+ ==== Intro 3
638
+
639
+ === Intro 4
640
+
641
+ ==== Intro 5
642
+
643
+ ===== Term1
644
+
645
+ === Normal Terms
646
+
647
+ ==== Term2
648
+
649
+ [heading=symbols and abbreviated terms]
650
+ === Symbols and Abbreviated Terms
651
+
652
+ [.nonterm]
653
+ ==== General
654
+
655
+ [heading=symbols]
656
+ ==== Symbols 1
657
+
658
+ [heading=abbreviated terms]
659
+ == Abbreviated Terms
660
+
661
+ == Clause 4
662
+
663
+ === Introduction
664
+
665
+ === Clause 4.2
666
+
667
+ == Terms and Definitions
668
+
669
+ [appendix]
670
+ == Annex
671
+
672
+ === Annex A.1
673
+
674
+ [bibliography,heading=bibliography]
675
+ == Bibliography
676
+
677
+ [bibliography,normative=false]
678
+ == Bibliography 2
679
+
680
+ === Bibliography Subsection
681
+
682
+ INPUT
683
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
684
+ <bibdata type='standard'>
685
+ <title language='en' format='text/plain'>Document title</title>
686
+ <language>tlh</language>
687
+ <script>Latn</script>
688
+ <abstract>
689
+ <p>Text</p>
690
+ </abstract>
691
+ <status>
692
+ <stage>published</stage>
693
+ </status>
694
+ <copyright>
695
+ <from>2020</from>
696
+ </copyright>
697
+ <ext>
698
+ <doctype>article</doctype>
699
+ </ext>
700
+ </bibdata>
701
+ <preface>
702
+ <abstract id='_'>
703
+ <title>Abstract</title>
704
+ <p id='_'>Text</p>
705
+ </abstract>
706
+ <foreword id='_' obligation='informative'>
707
+ <title>Foreword</title>
708
+ <p id='_'>Text</p>
709
+ </foreword>
710
+ <introduction id='_' obligation='informative'>
711
+ <title>Introduction</title>
712
+ <clause id='_' inline-header='false' obligation='informative'>
713
+ <title>Introduction Subsection</title>
714
+ </clause>
715
+ </introduction>
716
+ <clause id='_' inline-header='false' obligation='informative'>
717
+ <title>Dedication</title>
718
+ </clause>
719
+ <acknowledgements id='_' obligation='informative'>
720
+ <title>Acknowledgements</title>
721
+ </acknowledgements>
722
+ </preface>
723
+ <sections>
724
+ <clause id='_' type='scope' inline-header='false' obligation='normative'>
725
+ <title>Scope</title>
726
+ <p id='_'>Text</p>
727
+ </clause>
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='_'>
732
+ <preferred>Term1</preferred>
733
+ </term>
734
+ </terms>
735
+ <clause id='_' inline-header='false' obligation='normative'>
736
+ <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
737
+ <clause id='_' inline-header='false' obligation='normative'>
738
+ <title>Introduction</title>
739
+ <clause id='_' inline-header='false' obligation='normative'>
740
+ <title>Intro 1</title>
741
+ </clause>
742
+ </clause>
743
+ <clause id='_' inline-header='false' obligation='normative'>
744
+ <title>Intro 2</title>
745
+ <clause id='_' inline-header='false' obligation='normative'>
746
+ <title>Intro 3</title>
747
+ </clause>
748
+ </clause>
749
+ <clause id='_' inline-header='false' obligation='normative'>
750
+ <title>Intro 4</title>
751
+ <clause id='_' inline-header='false' obligation='normative'>
752
+ <title>Intro 5</title>
753
+ <clause id='_' inline-header='false' obligation='normative'>
754
+ <title>Term1</title>
755
+ </clause>
756
+ </clause>
757
+ </clause>
758
+ <clause id='_' inline-header='false' obligation='normative'>
759
+ <title>Normal Terms</title>
760
+ <clause id='_' inline-header='false' obligation='normative'>
761
+ <title>Term2</title>
762
+ </clause>
763
+ </clause>
764
+ <definitions id='_' obligation='normative'>
765
+ <title>Symbols and abbreviated terms</title>
766
+ <clause id='_' inline-header='false' obligation='normative'>
767
+ <title>General</title>
768
+ </clause>
769
+ <definitions id='_' type='symbols' obligation='normative'>
770
+ <title>Symbols</title>
771
+ </definitions>
772
+ </definitions>
773
+ </clause>
774
+ <definitions id='_' type='abbreviated_terms' obligation='normative'>
775
+ <title>Abbreviated terms</title>
776
+ </definitions>
777
+ <clause id='_' inline-header='false' obligation='normative'>
778
+ <title>Clause 4</title>
779
+ <clause id='_' inline-header='false' obligation='normative'>
780
+ <title>Introduction</title>
781
+ </clause>
782
+ <clause id='_' inline-header='false' obligation='normative'>
783
+ <title>Clause 4.2</title>
784
+ </clause>
785
+ </clause>
786
+ <clause id='_' inline-header='false' obligation='normative'>
787
+ <title>Terms and Definitions</title>
788
+ </clause>
789
+ </sections>
790
+ <annex id='_' inline-header='false' obligation='normative'>
791
+ <title>Annex</title>
792
+ <clause id='_' inline-header='false' obligation='normative'>
793
+ <title>Annex A.1</title>
794
+ </clause>
795
+ </annex>
796
+ <bibliography>
797
+ <references id='_' normative='true' obligation='informative'>
798
+ <title>Normative references</title>
799
+ <p id='_'>There are no normative references in this document.</p>
800
+ </references>
801
+ <references id='_' normative='false' obligation='informative'>
802
+ <title>Bibliography</title>
803
+ </references>
804
+ <references id='_' normative='false' obligation='informative'>
805
+ <title>Bibliography</title>
806
+ </references>
807
+ <clause id='_' obligation='informative'>
808
+ <title>Bibliography 2</title>
809
+ <references id='_' normative='false' obligation='informative'>
810
+ <title>Bibliography Subsection</title>
811
+ </references>
812
+ </clause>
813
+ </bibliography>
814
+ </standard-document>
815
+ OUTPUT
816
+ end
817
+
818
+ it "processes section names, French" do
819
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
820
+ #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
821
+ .Foreword
822
+
823
+ Text
824
+
825
+ [abstract]
826
+ == Abstract
827
+
828
+ Text
829
+
830
+ [heading=introduction]
831
+ == Introduction
832
+
833
+ === Introduction Subsection
834
+
835
+ [heading=acknowledgements]
836
+ == Acknowledgements
837
+
838
+ [.preface]
839
+ == Dedication
840
+
841
+ [heading=scope]
842
+ == Scope
843
+
844
+ Text
845
+
846
+ [bibliography,heading=normative references]
847
+ == Normative References
848
+
849
+ [bibliography,normative=true]
850
+ == Normative References 2
851
+
852
+ [heading=terms and definitions]
853
+ == Terms and Definitions
854
+
855
+ === Term1
856
+
857
+ [heading="terms and definitions"]
858
+ == Terms, Definitions, Symbols and Abbreviated Terms
859
+
860
+ [.nonterm]
861
+ === Introduction
862
+
863
+ ==== Intro 1
864
+
865
+ === Intro 2
866
+
867
+ [.nonterm]
868
+ ==== Intro 3
869
+
870
+ === Intro 4
871
+
872
+ ==== Intro 5
873
+
874
+ ===== Term1
875
+
876
+ === Normal Terms
877
+
878
+ ==== Term2
879
+
880
+ [heading=symbols and abbreviated terms]
881
+ === Symbols and Abbreviated Terms
882
+
883
+ [.nonterm]
884
+ ==== General
885
+
886
+ [heading=symbols]
887
+ ==== Symbols 1
888
+
889
+ [heading=abbreviated terms]
890
+ == Abbreviated Terms
891
+
892
+ == Clause 4
893
+
894
+ === Introduction
895
+
896
+ === Clause 4.2
897
+
898
+ == Terms and Definitions
899
+
900
+ [appendix]
901
+ == Annex
902
+
903
+ === Annex A.1
904
+
905
+ [bibliography,heading=bibliography]
906
+ == Bibliography
907
+
908
+ [bibliography,normative=false]
909
+ == Bibliography 2
910
+
911
+ === Bibliography Subsection
912
+
913
+ INPUT
914
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
915
+ <bibdata type='standard'>
916
+ <title language='en' format='text/plain'>Document title</title>
917
+ <language>fr</language>
918
+ <script>Latn</script>
919
+ <abstract>
920
+ <p>Text</p>
921
+ </abstract>
922
+ <status>
923
+ <stage>published</stage>
924
+ </status>
925
+ <copyright>
926
+ <from>2020</from>
927
+ </copyright>
928
+ <ext>
929
+ <doctype>article</doctype>
930
+ </ext>
931
+ </bibdata>
932
+ <preface>
933
+ <abstract id='_'>
934
+ <title>Résumé</title>
935
+ <p id='_'>Text</p>
936
+ </abstract>
937
+ <foreword id='_' obligation='informative'>
938
+ <title>Avant-propos</title>
939
+ <p id='_'>Text</p>
940
+ </foreword>
941
+ <introduction id='_' obligation='informative'>
942
+ <title>Introduction</title>
943
+ <clause id='_' inline-header='false' obligation='informative'>
944
+ <title>Introduction Subsection</title>
945
+ </clause>
946
+ </introduction>
947
+ <clause id='_' inline-header='false' obligation='informative'>
948
+ <title>Dedication</title>
949
+ </clause>
950
+ <acknowledgements id='_' obligation='informative'>
951
+ <title>Remerciements</title>
952
+ </acknowledgements>
953
+ </preface>
954
+ <sections>
955
+ <clause id='_' type='scope' inline-header='false' obligation='normative'>
956
+ <title>Domaine d’application</title>
957
+ <p id='_'>Text</p>
958
+ </clause>
959
+ <terms id='_' obligation='normative'>
960
+ <title>Terms et définitions</title>
961
+ <p id='_'>
962
+ Pour les besoins du présent document, les termes et définitions suivants
963
+ s’appliquent.
964
+ </p>
965
+ <term id='_'>
966
+ <preferred>Term1</preferred>
967
+ </term>
968
+ </terms>
969
+ <clause id='_' inline-header='false' obligation='normative'>
970
+ <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
971
+ <clause id='_' inline-header='false' obligation='normative'>
972
+ <title>Introduction</title>
973
+ <clause id='_' inline-header='false' obligation='normative'>
974
+ <title>Intro 1</title>
975
+ </clause>
976
+ </clause>
977
+ <clause id='_' inline-header='false' obligation='normative'>
978
+ <title>Intro 2</title>
979
+ <clause id='_' inline-header='false' obligation='normative'>
980
+ <title>Intro 3</title>
981
+ </clause>
982
+ </clause>
983
+ <clause id='_' inline-header='false' obligation='normative'>
984
+ <title>Intro 4</title>
985
+ <clause id='_' inline-header='false' obligation='normative'>
986
+ <title>Intro 5</title>
987
+ <clause id='_' inline-header='false' obligation='normative'>
988
+ <title>Term1</title>
989
+ </clause>
990
+ </clause>
991
+ </clause>
992
+ <clause id='_' inline-header='false' obligation='normative'>
993
+ <title>Normal Terms</title>
994
+ <clause id='_' inline-header='false' obligation='normative'>
995
+ <title>Term2</title>
996
+ </clause>
997
+ </clause>
998
+ <definitions id='_' obligation='normative'>
999
+ <title>Symboles et termes abrégés</title>
1000
+ <clause id='_' inline-header='false' obligation='normative'>
1001
+ <title>General</title>
1002
+ </clause>
1003
+ <definitions id='_' type='symbols' obligation='normative'>
1004
+ <title>Symboles</title>
1005
+ </definitions>
1006
+ </definitions>
1007
+ </clause>
1008
+ <definitions id='_' type='abbreviated_terms' obligation='normative'>
1009
+ <title>Termes abrégés</title>
1010
+ </definitions>
1011
+ <clause id='_' inline-header='false' obligation='normative'>
1012
+ <title>Clause 4</title>
1013
+ <clause id='_' inline-header='false' obligation='normative'>
1014
+ <title>Introduction</title>
1015
+ </clause>
1016
+ <clause id='_' inline-header='false' obligation='normative'>
1017
+ <title>Clause 4.2</title>
1018
+ </clause>
1019
+ </clause>
1020
+ <clause id='_' inline-header='false' obligation='normative'>
1021
+ <title>Terms and Definitions</title>
1022
+ </clause>
1023
+ </sections>
1024
+ <annex id='_' inline-header='false' obligation='normative'>
1025
+ <title>Annex</title>
1026
+ <clause id='_' inline-header='false' obligation='normative'>
1027
+ <title>Annex A.1</title>
1028
+ </clause>
1029
+ </annex>
1030
+ <bibliography>
1031
+ <references id='_' normative='true' obligation='informative'>
1032
+ <title>Références normatives</title>
1033
+ <p id='_'>Le présent document ne contient aucune référence normative.</p>
1034
+ </references>
1035
+ <references id='_' normative='false' obligation='informative'>
1036
+ <title>Bibliographie</title>
1037
+ </references>
1038
+ <references id='_' normative='false' obligation='informative'>
1039
+ <title>Bibliography</title>
1040
+ </references>
1041
+ <clause id='_' obligation='informative'>
1042
+ <title>Bibliography 2</title>
1043
+ <references id='_' normative='false' obligation='informative'>
1044
+ <title>Bibliography Subsection</title>
1045
+ </references>
1046
+ </clause>
1047
+ </bibliography>
1048
+ </standard-document>
1049
+ OUTPUT
1050
+ end
1051
+
1052
+ it "processes section names, Simplified Chinese" do
1053
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1054
+ #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
1055
+ .Foreword
1056
+
1057
+ Text
1058
+
1059
+ [abstract]
1060
+ == Abstract
1061
+
1062
+ Text
1063
+
1064
+ [heading=introduction]
1065
+ == Introduction
1066
+
1067
+ === Introduction Subsection
1068
+
1069
+ [heading=acknowledgements]
1070
+ == Acknowledgements
1071
+
1072
+ [.preface]
1073
+ == Dedication
1074
+
1075
+ [heading=scope]
1076
+ == Scope
1077
+
1078
+ Text
1079
+
1080
+ [bibliography,heading=normative references]
1081
+ == Normative References
1082
+
1083
+ [bibliography,normative=true]
1084
+ == Normative References 2
1085
+
1086
+ [heading=terms and definitions]
1087
+ == Terms and Definitions
1088
+
1089
+ === Term1
1090
+
1091
+ [heading="terms and definitions"]
1092
+ == Terms, Definitions, Symbols and Abbreviated Terms
1093
+
1094
+ [.nonterm]
1095
+ === Introduction
1096
+
1097
+ ==== Intro 1
1098
+
1099
+ === Intro 2
1100
+
1101
+ [.nonterm]
1102
+ ==== Intro 3
1103
+
1104
+ === Intro 4
1105
+
1106
+ ==== Intro 5
1107
+
1108
+ ===== Term1
1109
+
1110
+ === Normal Terms
1111
+
1112
+ ==== Term2
1113
+
1114
+ [heading=symbols and abbreviated terms]
1115
+ === Symbols and Abbreviated Terms
1116
+
1117
+ [.nonterm]
1118
+ ==== General
1119
+
1120
+ [heading=symbols]
1121
+ ==== Symbols 1
1122
+
1123
+ [heading=abbreviated terms]
1124
+ == Abbreviated Terms
1125
+
1126
+ == Clause 4
1127
+
1128
+ === Introduction
1129
+
1130
+ === Clause 4.2
1131
+
1132
+ == Terms and Definitions
1133
+
1134
+ [appendix]
1135
+ == Annex
1136
+
1137
+ === Annex A.1
1138
+
1139
+ [bibliography,heading=bibliography]
1140
+ == Bibliography
1141
+
1142
+ [bibliography,normative=false]
1143
+ == Bibliography 2
1144
+
1145
+ === Bibliography Subsection
1146
+
1147
+ INPUT
1148
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
1149
+ <bibdata type='standard'>
1150
+ <title language='en' format='text/plain'>Document title</title>
1151
+ <language>zh</language>
1152
+ <script>Hans</script>
1153
+ <abstract>
1154
+ <p>Text</p>
1155
+ </abstract>
1156
+ <status>
1157
+ <stage>published</stage>
1158
+ </status>
1159
+ <copyright>
1160
+ <from>2020</from>
1161
+ </copyright>
1162
+ <ext>
1163
+ <doctype>article</doctype>
1164
+ </ext>
1165
+ </bibdata>
1166
+ <preface>
1167
+ <abstract id='_'>
1168
+ <title>摘要</title>
1169
+ <p id='_'>Text</p>
1170
+ </abstract>
1171
+ <foreword id='_' obligation='informative'>
1172
+ <title>前言</title>
1173
+ <p id='_'>Text</p>
1174
+ </foreword>
1175
+ <introduction id='_' obligation='informative'>
1176
+ <title>引言</title>
1177
+ <clause id='_' inline-header='false' obligation='informative'>
1178
+ <title>Introduction Subsection</title>
1179
+ </clause>
1180
+ </introduction>
1181
+ <clause id='_' inline-header='false' obligation='informative'>
1182
+ <title>Dedication</title>
1183
+ </clause>
1184
+ <acknowledgements id='_' obligation='informative'>
1185
+ <title>致謝</title>
1186
+ </acknowledgements>
1187
+ </preface>
1188
+ <sections>
1189
+ <clause id='_' type='scope' inline-header='false' obligation='normative'>
1190
+ <title>范围</title>
1191
+ <p id='_'>Text</p>
1192
+ </clause>
1193
+ <terms id='_' obligation='normative'>
1194
+ <title>术语和定义</title>
1195
+ <p id='_'>下列术语和定义适用于本文件。</p>
1196
+ <term id='_'>
1197
+ <preferred>Term1</preferred>
1198
+ </term>
1199
+ </terms>
1200
+ <clause id='_' inline-header='false' obligation='normative'>
1201
+ <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1202
+ <clause id='_' inline-header='false' obligation='normative'>
1203
+ <title>Introduction</title>
1204
+ <clause id='_' inline-header='false' obligation='normative'>
1205
+ <title>Intro 1</title>
1206
+ </clause>
1207
+ </clause>
1208
+ <clause id='_' inline-header='false' obligation='normative'>
1209
+ <title>Intro 2</title>
1210
+ <clause id='_' inline-header='false' obligation='normative'>
1211
+ <title>Intro 3</title>
1212
+ </clause>
1213
+ </clause>
1214
+ <clause id='_' inline-header='false' obligation='normative'>
1215
+ <title>Intro 4</title>
1216
+ <clause id='_' inline-header='false' obligation='normative'>
1217
+ <title>Intro 5</title>
1218
+ <clause id='_' inline-header='false' obligation='normative'>
1219
+ <title>Term1</title>
1220
+ </clause>
1221
+ </clause>
1222
+ </clause>
1223
+ <clause id='_' inline-header='false' obligation='normative'>
1224
+ <title>Normal Terms</title>
1225
+ <clause id='_' inline-header='false' obligation='normative'>
1226
+ <title>Term2</title>
1227
+ </clause>
1228
+ </clause>
1229
+ <definitions id='_' obligation='normative'>
1230
+ <title>符号、代号和缩略语</title>
1231
+ <clause id='_' inline-header='false' obligation='normative'>
1232
+ <title>General</title>
1233
+ </clause>
1234
+ <definitions id='_' type='symbols' obligation='normative'>
1235
+ <title>符号</title>
1236
+ </definitions>
1237
+ </definitions>
1238
+ </clause>
1239
+ <definitions id='_' type='abbreviated_terms' obligation='normative'>
1240
+ <title>代号和缩略语</title>
1241
+ </definitions>
1242
+ <clause id='_' inline-header='false' obligation='normative'>
1243
+ <title>Clause 4</title>
1244
+ <clause id='_' inline-header='false' obligation='normative'>
1245
+ <title>Introduction</title>
1246
+ </clause>
1247
+ <clause id='_' inline-header='false' obligation='normative'>
1248
+ <title>Clause 4.2</title>
1249
+ </clause>
1250
+ </clause>
1251
+ <clause id='_' inline-header='false' obligation='normative'>
1252
+ <title>Terms and Definitions</title>
1253
+ </clause>
1254
+ </sections>
1255
+ <annex id='_' inline-header='false' obligation='normative'>
1256
+ <title>Annex</title>
1257
+ <clause id='_' inline-header='false' obligation='normative'>
1258
+ <title>Annex A.1</title>
1259
+ </clause>
1260
+ </annex>
1261
+ <bibliography>
1262
+ <references id='_' normative='true' obligation='informative'>
1263
+ <title>规范性引用文件</title>
1264
+ <p id='_'>本文件并没有规范性引用文件。</p>
1265
+ </references>
1266
+ <references id='_' normative='false' obligation='informative'>
1267
+ <title>参考文献</title>
1268
+ </references>
1269
+ <references id='_' normative='false' obligation='informative'>
1270
+ <title>Bibliography</title>
1271
+ </references>
1272
+ <clause id='_' obligation='informative'>
1273
+ <title>Bibliography 2</title>
1274
+ <references id='_' normative='false' obligation='informative'>
1275
+ <title>Bibliography Subsection</title>
1276
+ </references>
1277
+ </clause>
1278
+ </bibliography>
1279
+ </standard-document>
1280
+ OUTPUT
1281
+ end
1282
+
1283
+ it "processes section names, internationalisation file" do
1284
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1285
+ #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":i18nyaml: spec/assets/i18n.yaml")}
1286
+ .Foreword
1287
+
1288
+ Text
1289
+
1290
+ [abstract]
1291
+ == Abstract
1292
+
1293
+ Text
1294
+
1295
+ [heading=introduction]
1296
+ == Introduction
1297
+
1298
+ === Introduction Subsection
1299
+
1300
+ [heading=acknowledgements]
1301
+ == Acknowledgements
1302
+
1303
+ [.preface]
1304
+ == Dedication
1305
+
1306
+ [heading=scope]
1307
+ == Scope
1308
+
1309
+ Text
1310
+
1311
+ [bibliography,heading=normative references]
1312
+ == Normative References
1313
+
1314
+ [bibliography,normative=true]
1315
+ == Normative References 2
1316
+
1317
+ [heading=terms and definitions]
1318
+ == Terms and Definitions
1319
+
1320
+ === Term1
1321
+
1322
+ [heading="terms and definitions"]
1323
+ == Terms, Definitions, Symbols and Abbreviated Terms
1324
+
1325
+ [.nonterm]
1326
+ === Introduction
1327
+
1328
+ ==== Intro 1
1329
+
1330
+ === Intro 2
1331
+
1332
+ [.nonterm]
1333
+ ==== Intro 3
1334
+
1335
+ === Intro 4
1336
+
1337
+ ==== Intro 5
1338
+
1339
+ ===== Term1
1340
+
1341
+ === Normal Terms
1342
+
1343
+ ==== Term2
1344
+
1345
+ [heading=symbols and abbreviated terms]
1346
+ === Symbols and Abbreviated Terms
1347
+
1348
+ [.nonterm]
1349
+ ==== General
1350
+
1351
+ [heading=symbols]
1352
+ ==== Symbols 1
1353
+
1354
+ [heading=abbreviated terms]
1355
+ == Abbreviated Terms
1356
+
1357
+ == Clause 4
1358
+
1359
+ === Introduction
1360
+
1361
+ === Clause 4.2
1362
+
1363
+ == Terms and Definitions
1364
+
1365
+ [appendix]
1366
+ == Annex
1367
+
1368
+ === Annex A.1
1369
+
1370
+ [bibliography,heading=bibliography]
1371
+ == Bibliography
1372
+
1373
+ [bibliography,normative=false]
1374
+ == Bibliography 2
1375
+
1376
+ === Bibliography Subsection
1377
+
1378
+ INPUT
1379
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
1380
+ <bibdata type='standard'>
1381
+ <title language='en' format='text/plain'>Document title</title>
1382
+ <language>en</language>
1383
+ <script>Latn</script>
1384
+ <abstract>
1385
+ <p>Text</p>
1386
+ </abstract>
1387
+ <status>
1388
+ <stage>published</stage>
1389
+ </status>
1390
+ <copyright>
1391
+ <from>2020</from>
1392
+ </copyright>
1393
+ <ext>
1394
+ <doctype>article</doctype>
1395
+ </ext>
1396
+ </bibdata>
1397
+ <preface>
1398
+ <abstract id='_'>
1399
+ <title>Abstract</title>
1400
+ <p id='_'>Text</p>
1401
+ </abstract>
1402
+ <foreword id='_' obligation='informative'>
1403
+ <title>Antaŭparolo</title>
1404
+ <p id='_'>Text</p>
1405
+ </foreword>
1406
+ <introduction id='_' obligation='informative'>
1407
+ <title>Enkonduko</title>
1408
+ <clause id='_' inline-header='false' obligation='informative'>
1409
+ <title>Introduction Subsection</title>
1410
+ </clause>
1411
+ </introduction>
1412
+ <clause id='_' inline-header='false' obligation='informative'>
1413
+ <title>Dedication</title>
1414
+ </clause>
1415
+ <acknowledgements id='_' obligation='informative'>
1416
+ <title>Acknowledgements</title>
1417
+ </acknowledgements>
1418
+ </preface>
1419
+ <sections>
1420
+ <clause id='_' type='scope' inline-header='false' obligation='normative'>
1421
+ <title>Amplekso</title>
1422
+ <p id='_'>Text</p>
1423
+ </clause>
1424
+ <terms id='_' obligation='normative'>
1425
+ <title>Terms and definitions</title>
1426
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1427
+ <term id='_'>
1428
+ <preferred>Term1</preferred>
1429
+ </term>
1430
+ </terms>
1431
+ <clause id='_' inline-header='false' obligation='normative'>
1432
+ <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1433
+ <clause id='_' inline-header='false' obligation='normative'>
1434
+ <title>Introduction</title>
1435
+ <clause id='_' inline-header='false' obligation='normative'>
1436
+ <title>Intro 1</title>
1437
+ </clause>
1438
+ </clause>
1439
+ <clause id='_' inline-header='false' obligation='normative'>
1440
+ <title>Intro 2</title>
1441
+ <clause id='_' inline-header='false' obligation='normative'>
1442
+ <title>Intro 3</title>
1443
+ </clause>
1444
+ </clause>
1445
+ <clause id='_' inline-header='false' obligation='normative'>
1446
+ <title>Intro 4</title>
1447
+ <clause id='_' inline-header='false' obligation='normative'>
1448
+ <title>Intro 5</title>
1449
+ <clause id='_' inline-header='false' obligation='normative'>
1450
+ <title>Term1</title>
1451
+ </clause>
1452
+ </clause>
1453
+ </clause>
1454
+ <clause id='_' inline-header='false' obligation='normative'>
1455
+ <title>Normal Terms</title>
1456
+ <clause id='_' inline-header='false' obligation='normative'>
1457
+ <title>Term2</title>
1458
+ </clause>
1459
+ </clause>
1460
+ <definitions id='_' obligation='normative'>
1461
+ <title>Symbols and abbreviated terms</title>
1462
+ <clause id='_' inline-header='false' obligation='normative'>
1463
+ <title>General</title>
1464
+ </clause>
1465
+ <definitions id='_' type='symbols' obligation='normative'>
1466
+ <title>Simboloj kai mallongigitaj terminoj</title>
1467
+ </definitions>
1468
+ </definitions>
1469
+ </clause>
1470
+ <definitions id='_' type='abbreviated_terms' obligation='normative'>
1471
+ <title>Abbreviated terms</title>
1472
+ </definitions>
1473
+ <clause id='_' inline-header='false' obligation='normative'>
1474
+ <title>Clause 4</title>
1475
+ <clause id='_' inline-header='false' obligation='normative'>
1476
+ <title>Introduction</title>
1477
+ </clause>
1478
+ <clause id='_' inline-header='false' obligation='normative'>
1479
+ <title>Clause 4.2</title>
1480
+ </clause>
1481
+ </clause>
1482
+ <clause id='_' inline-header='false' obligation='normative'>
1483
+ <title>Terms and Definitions</title>
1484
+ </clause>
1485
+ </sections>
1486
+ <annex id='_' inline-header='false' obligation='normative'>
1487
+ <title>Annex</title>
1488
+ <clause id='_' inline-header='false' obligation='normative'>
1489
+ <title>Annex A.1</title>
1490
+ </clause>
1491
+ </annex>
1492
+ <bibliography>
1493
+ <references id='_' normative='true' obligation='informative'>
1494
+ <title>Normaj citaĵoj</title>
1495
+ <p id='_'>There are no normative references in this document.</p>
1496
+ </references>
1497
+ <references id='_' normative='false' obligation='informative'>
1498
+ <title>Bibliografio</title>
1499
+ </references>
1500
+ <references id='_' normative='false' obligation='informative'>
1501
+ <title>Bibliography</title>
1502
+ </references>
1503
+ <clause id='_' obligation='informative'>
1504
+ <title>Bibliography 2</title>
1505
+ <references id='_' normative='false' obligation='informative'>
1506
+ <title>Bibliography Subsection</title>
1507
+ </references>
1508
+ </clause>
1509
+ </bibliography>
1510
+ </standard-document>
1511
+ OUTPUT
1512
+ end
1513
+
1514
+ end