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,1849 +0,0 @@
1
- require "spec_helper"
2
- require "relaton_iec"
3
- require "fileutils"
4
-
5
- RSpec.describe Metanorma::Standoc do
6
- it "appends any initial user-supplied text to boilerplate in terms and definitions" do
7
- input = <<~INPUT
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
- output = <<~OUTPUT
20
- #{BLANK_HDR}
21
- <sections>
22
- <terms id="_" obligation="normative"><title>Terms and definitions</title>
23
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
24
- <p id='_'>I am boilerplate</p>
25
- <ul id='_'>
26
- <li>
27
- <p id='_'>So am I</p>
28
- </li>
29
- </ul>
30
- <term id="term-Time">
31
- <preferred><expression><name>Time</name></expression></preferred>
32
- <definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
33
- </term></terms>
34
- </sections>
35
- </standard-document>
36
- OUTPUT
37
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
38
- .to be_equivalent_to xmlpp(output)
39
- end
40
-
41
- it "removes initial extraneous material from Normative References" do
42
- input = <<~INPUT
43
- #{ASCIIDOC_BLANK_HDR}
44
- [bibliography]
45
- == Normative References
46
-
47
- This is extraneous information
48
-
49
- * [[[iso216,ISO 216]]], _Reference_
50
-
51
- This is also extraneous information
52
- INPUT
53
- output = <<~OUTPUT
54
- #{BLANK_HDR}
55
- <sections></sections>
56
- <bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
57
- #{NORM_REF_BOILERPLATE}
58
- <bibitem id="iso216" type="standard">
59
- <title format="text/plain">Reference</title>
60
- <docidentifier>ISO 216</docidentifier>
61
- <docnumber>216</docnumber>
62
- <contributor>
63
- <role type="publisher"/>
64
- <organization>
65
- <name>ISO</name>
66
- </organization>
67
- </contributor>
68
- </bibitem>
69
- <p id='_'>This is also extraneous information</p>
70
- </references>
71
- </bibliography>
72
- </standard-document>
73
- OUTPUT
74
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
75
- .to be_equivalent_to xmlpp(output)
76
- end
77
-
78
- it "preserves user-supplied boilerplate in Normative References" do
79
- input = <<~INPUT
80
- #{ASCIIDOC_BLANK_HDR}
81
- [bibliography]
82
- == Normative References
83
-
84
- [NOTE,type=boilerplate]
85
- --
86
- This is extraneous information
87
- --
88
-
89
- * [[[iso216,ISO 216]]], _Reference_
90
-
91
- This is also extraneous information
92
- INPUT
93
- output = <<~OUTPUT
94
- #{BLANK_HDR}
95
- <sections></sections>
96
- <bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
97
- <p id='_'>This is extraneous information</p>
98
- <bibitem id="iso216" type="standard">
99
- <title format="text/plain">Reference</title>
100
- <docidentifier>ISO 216</docidentifier>
101
- <docnumber>216</docnumber>
102
- <contributor>
103
- <role type="publisher"/>
104
- <organization>
105
- <name>ISO</name>
106
- </organization>
107
- </contributor>
108
- </bibitem>
109
- <p id='_'>This is also extraneous information</p>
110
- </references>
111
- </bibliography>
112
- </standard-document>
113
- OUTPUT
114
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
115
- .to be_equivalent_to xmlpp(output)
116
- end
117
-
118
- it "sorts references with their notes in Bibliography" do
119
- input = <<~INPUT
120
- #{ASCIIDOC_BLANK_HDR}
121
- [bibliography]
122
- == Bibliography
123
-
124
- This is extraneous information
125
-
126
- * [[[iso216,ISO 216]]], _Reference_
127
-
128
- NOTE: ABC
129
-
130
- NOTE: DEF
131
-
132
- This is further extraneous information
133
-
134
- NOTE: GHI
135
-
136
- * [[[iso216,ISO 215]]], _Reference_
137
-
138
- NOTE: JKL
139
-
140
- This is also extraneous information
141
- INPUT
142
- output = <<~OUTPUT
143
- #{BLANK_HDR}
144
- <sections> </sections>
145
- <bibliography>
146
- <references id='_' obligation='informative' normative="false">
147
- <title>Bibliography</title>
148
- <p id='_'>This is extraneous information</p>
149
- <bibitem id='iso216' type='standard'>
150
- <title format='text/plain'>Reference</title>
151
- <docidentifier>ISO 216</docidentifier>
152
- <docnumber>216</docnumber>
153
- <contributor>
154
- <role type='publisher'/>
155
- <organization>
156
- <name>ISO</name>
157
- </organization>
158
- </contributor>
159
- </bibitem>
160
- <note id='_'>
161
- <p id='_'>ABC</p>
162
- </note>
163
- <note id='_'>
164
- <p id='_'>DEF</p>
165
- </note>
166
- <bibitem id='iso216' type='standard'>
167
- <title format='text/plain'>Reference</title>
168
- <docidentifier>ISO 215</docidentifier>
169
- <docnumber>215</docnumber>
170
- <contributor>
171
- <role type='publisher'/>
172
- <organization>
173
- <name>ISO</name>
174
- </organization>
175
- </contributor>
176
- </bibitem>
177
- <note id='_'>
178
- <p id='_'>JKL</p>
179
- </note>
180
- <p id='_'>
181
- This is further extraneous information
182
- <note id='_'>
183
- <p id='_'>GHI</p>
184
- </note>
185
- </p>
186
- <p id='_'>This is also extraneous information</p>
187
- </references>
188
- </bibliography>
189
- </standard-document>
190
- OUTPUT
191
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
192
- .to be_equivalent_to xmlpp(output)
193
- end
194
-
195
- it "defaults section obligations" do
196
- input = <<~INPUT
197
- #{ASCIIDOC_BLANK_HDR}
198
-
199
- == Clause
200
- Text
201
-
202
- [appendix]
203
- == Clause
204
-
205
- Text
206
- INPUT
207
- output = <<~OUTPUT
208
- #{BLANK_HDR}
209
- <sections><clause id="_" inline-header="false" obligation="normative">
210
- <title>Clause</title>
211
- <p id="_">Text</p>
212
- </clause>
213
- </sections><annex id="_" inline-header="false" obligation="normative">
214
- <title>Clause</title>
215
- <p id="_">Text</p>
216
- </annex>
217
- </standard-document>
218
- OUTPUT
219
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
220
- .to be_equivalent_to xmlpp(output)
221
- end
222
-
223
- it "extends clause levels past 5" do
224
- input = <<~INPUT
225
- #{ASCIIDOC_BLANK_HDR}
226
-
227
- == Clause1
228
-
229
- === Clause2
230
-
231
- ==== Clause3
232
-
233
- ===== Clause4
234
-
235
- ====== Clause 5
236
-
237
- [level=6]
238
- ====== Clause 6
239
-
240
- [level=7]
241
- ====== Clause 7A
242
-
243
- [level=7]
244
- ====== Clause 7B
245
-
246
- [level=6]
247
- ====== Clause 6B
248
-
249
- ====== Clause 5B
250
-
251
- INPUT
252
- output = <<~OUTPUT
253
- #{BLANK_HDR}
254
- <sections>
255
- <clause id="_" inline-header="false" obligation="normative">
256
- <title>Clause1</title>
257
- <clause id="_" inline-header="false" obligation="normative">
258
- <title>Clause2</title>
259
- <clause id="_" inline-header="false" obligation="normative">
260
- <title>Clause3</title>
261
- <clause id="_" inline-header="false" obligation="normative"><title>Clause4</title><clause id="_" inline-header="false" obligation="normative">
262
- <title>Clause 5</title>
263
- <clause id="_" inline-header="false" obligation="normative">
264
- <title>Clause 6</title>
265
- <clause id="_" inline-header="false" obligation="normative">
266
- <title>Clause 7A</title>
267
- </clause><clause id="_" inline-header="false" obligation="normative">
268
- <title>Clause 7B</title>
269
- </clause></clause><clause id="_" inline-header="false" obligation="normative">
270
- <title>Clause 6B</title>
271
- </clause></clause>
272
- <clause id="_" inline-header="false" obligation="normative">
273
- <title>Clause 5B</title>
274
- </clause></clause>
275
- </clause>
276
- </clause>
277
- </clause>
278
- </sections>
279
- </standard-document>
280
- OUTPUT
281
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
282
- .to be_equivalent_to xmlpp(output)
283
- end
284
-
285
- it "inserts boilerplate before empty Normative References" do
286
- input = <<~INPUT
287
- #{ASCIIDOC_BLANK_HDR}
288
-
289
- [bibliography]
290
- == Normative References
291
-
292
- INPUT
293
- output = <<~OUTPUT
294
- #{BLANK_HDR}
295
- <sections>
296
- </sections><bibliography><references id="_" obligation="informative" normative="true">
297
- <title>Normative references</title><p id="_">There are no normative references in this document.</p>
298
- </references></bibliography>
299
- </standard-document>
300
- OUTPUT
301
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
302
- .to be_equivalent_to xmlpp(output)
303
- end
304
-
305
- it "inserts boilerplate before non-empty Normative References" do
306
- input = <<~INPUT
307
- #{ASCIIDOC_BLANK_HDR}
308
-
309
- [bibliography]
310
- == Normative References
311
- * [[[a,b]]] A
312
-
313
- INPUT
314
- output = <<~OUTPUT
315
- #{BLANK_HDR}
316
- <sections>
317
-
318
- </sections><bibliography><references id="_" obligation="informative" normative="true">
319
- <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>
320
- <bibitem id="a">
321
- <formattedref format="application/x-isodoc+xml">A</formattedref>
322
- <docidentifier>b</docidentifier>
323
- </bibitem>
324
- </references></bibliography>
325
- </standard-document>
326
-
327
- OUTPUT
328
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
329
- .to be_equivalent_to xmlpp(output)
330
- end
331
-
332
- it "inserts boilerplate before empty Normative References in French" do
333
- input = <<~INPUT
334
- = Document title
335
- Author
336
- :docfile: test.adoc
337
- :nodoc:
338
- :novalid:
339
- :no-isobib:
340
- :language: fr
341
-
342
- [bibliography]
343
- == Normative References
344
-
345
- INPUT
346
- output = <<~OUTPUT
347
- #{BLANK_HDR.sub(/<language>en/, '<language>fr')}
348
- <sections>
349
- </sections><bibliography><references id="_" obligation="informative" normative="true">
350
- <title>Références normatives</title><p id="_">Le présent document ne contient aucune référence normative.</p>
351
- </references></bibliography>
352
- </standard-document>
353
- OUTPUT
354
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
355
- .to be_equivalent_to xmlpp(output)
356
- end
357
-
358
- it "processes section names, with footnotes" do
359
- input = <<~INPUT
360
- #{ASCIIDOC_BLANK_HDR}
361
- .Foreword.footnote:[A]
362
-
363
- Text
364
-
365
- [abstract]
366
- == Abstract.footnote:[A]
367
-
368
- Text
369
-
370
- [heading=introduction]
371
- == Introduction.footnote:[A]
372
-
373
- === Introduction Subsection
374
-
375
- [heading=acknowledgements]
376
- == Acknowledgements.footnote:[A]
377
-
378
- [.preface]
379
- == Dedication
380
-
381
- [heading=scope]
382
- == Scope.footnote:[A]
383
-
384
- Text
385
-
386
- [bibliography,heading=normative references]
387
- == Normative References.footnote:[A]
388
-
389
- [bibliography,normative=true]
390
- == Normative References 2.footnote:[A]
391
-
392
- [heading=terms and definitions]
393
- == Terms and Definitions.footnote:[A]
394
-
395
- === Term1
396
-
397
- [heading="terms and definitions"]
398
- == Terms, Definitions, Symbols and Abbreviated Terms.footnote:[A]
399
-
400
- [.nonterm]
401
- === Introduction
402
-
403
- ==== Intro 1
404
-
405
- === Intro 2
406
-
407
- [.nonterm]
408
- ==== Intro 3
409
-
410
- === Intro 4
411
-
412
- ==== Intro 5
413
-
414
- ===== Term1
415
-
416
- === Normal Terms
417
-
418
- ==== Term2
419
-
420
- [heading=symbols and abbreviated terms]
421
- === Symbols and Abbreviated Terms.footnote:[A]
422
-
423
- [.nonterm]
424
- ==== General
425
-
426
- [heading=symbols]
427
- ==== Symbols 1.footnote:[A]
428
-
429
- [heading=abbreviated terms]
430
- == Abbreviated Terms.footnote:[A]
431
-
432
- == Clause 4
433
-
434
- === Introduction
435
-
436
- === Clause 4.2
437
-
438
- == Terms and Definitions
439
-
440
- [appendix]
441
- == Annex.footnote:[A]
442
-
443
- === Annex A.1
444
-
445
- [bibliography,heading=bibliography]
446
- == Bibliography.footnote:[A]
447
-
448
- [bibliography,normative=false]
449
- == Bibliography 2.footnote:[A]
450
-
451
- === Bibliography Subsection
452
-
453
- INPUT
454
- output = <<~OUTPUT
455
- <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
456
- <bibdata type='standard'>
457
- <title language='en' format='text/plain'>Document title</title>
458
- <language>en</language>
459
- <script>Latn</script>
460
- <abstract>
461
- <p>Text</p>
462
- </abstract>
463
- <status>
464
- <stage>published</stage>
465
- </status>
466
- <copyright>
467
- <from>#{Time.now.year}</from>
468
- </copyright>
469
- <ext>
470
- <doctype>standard</doctype>
471
- </ext>
472
- </bibdata>
473
- <preface>
474
- <abstract id='_'>
475
- <title>Abstract</title>
476
- <p id='_'>Text</p>
477
- </abstract>
478
- <foreword id='_' obligation='informative'>
479
- <title>
480
- Foreword
481
- <fn reference='1'>
482
- <p id='_'>A</p>
483
- </fn>
484
- </title>
485
- <p id='_'>Text</p>
486
- </foreword>
487
- <introduction id='_' obligation='informative'>
488
- <title>Introduction</title>
489
- <clause id='_' inline-header='false' obligation='informative'>
490
- <title>Introduction Subsection</title>
491
- </clause>
492
- </introduction>
493
- <clause id='_' inline-header='false' obligation='informative'>
494
- <title>Dedication</title>
495
- </clause>
496
- <acknowledgements id='_' obligation='informative'>
497
- <title>
498
- Acknowledgements
499
- <fn reference='1'>
500
- <p id='_'>A</p>
501
- </fn>
502
- </title>
503
- </acknowledgements>
504
- </preface>
505
- <sections>
506
- <clause id='_' type='scope' inline-header='false' obligation='normative'>
507
- <title>
508
- Scope
509
- <fn reference='1'>
510
- <p id='_'>A</p>
511
- </fn>
512
- </title>
513
- <p id='_'>Text</p>
514
- </clause>
515
- <terms id='_' obligation='normative'>
516
- <title>
517
- Terms and definitions
518
- <fn reference='1'>
519
- <p id='_'>A</p>
520
- </fn>
521
- </title>
522
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
523
- <term id='term-Term1'>
524
- <preferred><expression><name>Term1</name></expression></preferred>
525
- </term>
526
- </terms>
527
- <clause id='_' inline-header='false' obligation='normative'>
528
- <title>
529
- Terms, Definitions, Symbols and Abbreviated Terms.
530
- <fn reference='1'>
531
- <p id='_'>A</p>
532
- </fn>
533
- </title>
534
- <clause id='_' inline-header='false' obligation='normative'>
535
- <title>Introduction</title>
536
- <clause id='_' inline-header='false' obligation='normative'>
537
- <title>Intro 1</title>
538
- </clause>
539
- </clause>
540
- <clause id='_' inline-header='false' obligation='normative'>
541
- <title>Intro 2</title>
542
- <clause id='_' inline-header='false' obligation='normative'>
543
- <title>Intro 3</title>
544
- </clause>
545
- </clause>
546
- <clause id='_' inline-header='false' obligation='normative'>
547
- <title>Intro 4</title>
548
- <clause id='_' inline-header='false' obligation='normative'>
549
- <title>Intro 5</title>
550
- <clause id='_' inline-header='false' obligation='normative'>
551
- <title>Term1</title>
552
- </clause>
553
- </clause>
554
- </clause>
555
- <clause id='_' inline-header='false' obligation='normative'>
556
- <title>Normal Terms</title>
557
- <clause id='_' inline-header='false' obligation='normative'>
558
- <title>Term2</title>
559
- </clause>
560
- </clause>
561
- <definitions id='_' obligation='normative'>
562
- <title>
563
- Symbols and abbreviated terms
564
- <fn reference='1'>
565
- <p id='_'>A</p>
566
- </fn>
567
- </title>
568
- <clause id='_' inline-header='false' obligation='normative'>
569
- <title>General</title>
570
- </clause>
571
- <definitions id='_' type='symbols' obligation='normative'>
572
- <title>
573
- Symbols
574
- <fn reference='1'>
575
- <p id='_'>A</p>
576
- </fn>
577
- </title>
578
- </definitions>
579
- </definitions>
580
- </clause>
581
- <definitions id='_' type='abbreviated_terms' obligation='normative'>
582
- <title>
583
- Abbreviated terms
584
- <fn reference='1'>
585
- <p id='_'>A</p>
586
- </fn>
587
- </title>
588
- </definitions>
589
- <clause id='_' inline-header='false' obligation='normative'>
590
- <title>Clause 4</title>
591
- <clause id='_' inline-header='false' obligation='normative'>
592
- <title>Introduction</title>
593
- </clause>
594
- <clause id='_' inline-header='false' obligation='normative'>
595
- <title>Clause 4.2</title>
596
- </clause>
597
- </clause>
598
- <clause id='_' inline-header='false' obligation='normative'>
599
- <title>Terms and Definitions</title>
600
- </clause>
601
- </sections>
602
- <annex id='_' inline-header='false' obligation='normative'>
603
- <title>
604
- Annex.
605
- <fn reference='1'>
606
- <p id='_'>A</p>
607
- </fn>
608
- </title>
609
- <clause id='_' inline-header='false' obligation='normative'>
610
- <title>Annex A.1</title>
611
- </clause>
612
- </annex>
613
- <bibliography>
614
- <references id='_' normative='true' obligation='informative'>
615
- <title>Normative references
616
- <fn reference='1'>
617
- <p id='_'>A</p>
618
- </fn>
619
- </title>
620
- <p id='_'>There are no normative references in this document.</p>
621
- </references>
622
- <references id='_' normative='true' obligation='informative'>
623
- <title>Normative References 2.
624
- <fn reference='1'>
625
- <p id='_'>A</p>
626
- </fn>
627
- </title>
628
- </references>
629
- <references id='_' normative='false' obligation='informative'>
630
- <title>Bibliography
631
- <fn reference='1'>
632
- <p id='_'>A</p>
633
- </fn>
634
- </title>
635
- </references>
636
- <clause id='_' obligation='informative'>
637
- <title>Bibliography 2.
638
- <fn reference='1'>
639
- <p id='_'>A</p>
640
- </fn>
641
- </title>
642
- <references id='_' normative='false' obligation='informative'>
643
- <title>Bibliography Subsection</title>
644
- </references>
645
- </clause>
646
- </bibliography>
647
- </standard-document>
648
- OUTPUT
649
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
650
- .to be_equivalent_to xmlpp(output)
651
- end
652
-
653
- it "processes section names, default to English" do
654
- input = <<~INPUT
655
- #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
656
- .Foreword
657
-
658
- Text
659
-
660
- [abstract]
661
- == Abstract
662
-
663
- Text
664
-
665
- [heading=introduction]
666
- == Introduction
667
-
668
- === Introduction Subsection
669
-
670
- [heading=acknowledgements]
671
- == Acknowledgements
672
-
673
- [.preface]
674
- == Dedication
675
-
676
- [heading=scope]
677
- == Scope
678
-
679
- Text
680
-
681
- [bibliography,heading=normative references]
682
- == Normative References
683
-
684
- [bibliography,normative=true]
685
- == Normative References 2
686
-
687
- [heading=terms and definitions]
688
- == Terms and Definitions
689
-
690
- === Term1
691
-
692
- [heading="terms and definitions"]
693
- == Terms, Definitions, Symbols and Abbreviated Terms
694
-
695
- [.nonterm]
696
- === Introduction
697
-
698
- ==== Intro 1
699
-
700
- === Intro 2
701
-
702
- [.nonterm]
703
- ==== Intro 3
704
-
705
- === Intro 4
706
-
707
- ==== Intro 5
708
-
709
- ===== Term1
710
-
711
- === Normal Terms
712
-
713
- ==== Term2
714
-
715
- [heading=symbols and abbreviated terms]
716
- === Symbols and Abbreviated Terms
717
-
718
- [.nonterm]
719
- ==== General
720
-
721
- [heading=symbols]
722
- ==== Symbols 1
723
-
724
- [heading=abbreviated terms]
725
- == Abbreviated Terms
726
-
727
- == Clause 4
728
-
729
- === Introduction
730
-
731
- === Clause 4.2
732
-
733
- == Terms and Definitions
734
-
735
- [appendix]
736
- == Annex
737
-
738
- === Annex A.1
739
-
740
- [bibliography,heading=bibliography]
741
- == Bibliography
742
-
743
- [bibliography,normative=false]
744
- == Bibliography 2
745
-
746
- === Bibliography Subsection
747
-
748
- INPUT
749
- output = <<~OUTPUT
750
- <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
751
- <bibdata type='standard'>
752
- <title language='en' format='text/plain'>Document title</title>
753
- <language>tlh</language>
754
- <script>Latn</script>
755
- <abstract>
756
- <p>Text</p>
757
- </abstract>
758
- <status>
759
- <stage>published</stage>
760
- </status>
761
- <copyright>
762
- <from>#{Time.now.year}</from>
763
- </copyright>
764
- <ext>
765
- <doctype>standard</doctype>
766
- </ext>
767
- </bibdata>
768
- <preface>
769
- <abstract id='_'>
770
- <title>Abstract</title>
771
- <p id='_'>Text</p>
772
- </abstract>
773
- <foreword id='_' obligation='informative'>
774
- <title>Foreword</title>
775
- <p id='_'>Text</p>
776
- </foreword>
777
- <introduction id='_' obligation='informative'>
778
- <title>Introduction</title>
779
- <clause id='_' inline-header='false' obligation='informative'>
780
- <title>Introduction Subsection</title>
781
- </clause>
782
- </introduction>
783
- <clause id='_' inline-header='false' obligation='informative'>
784
- <title>Dedication</title>
785
- </clause>
786
- <acknowledgements id='_' obligation='informative'>
787
- <title>Acknowledgements</title>
788
- </acknowledgements>
789
- </preface>
790
- <sections>
791
- <clause id='_' type='scope' inline-header='false' obligation='normative'>
792
- <title>Scope</title>
793
- <p id='_'>Text</p>
794
- </clause>
795
- <terms id='_' obligation='normative'>
796
- <title>Terms and definitions</title>
797
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
798
- <term id='term-Term1'>
799
- <preferred><expression><name>Term1</name></expression></preferred>
800
- </term>
801
- </terms>
802
- <clause id='_' inline-header='false' obligation='normative'>
803
- <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
804
- <clause id='_' inline-header='false' obligation='normative'>
805
- <title>Introduction</title>
806
- <clause id='_' inline-header='false' obligation='normative'>
807
- <title>Intro 1</title>
808
- </clause>
809
- </clause>
810
- <clause id='_' inline-header='false' obligation='normative'>
811
- <title>Intro 2</title>
812
- <clause id='_' inline-header='false' obligation='normative'>
813
- <title>Intro 3</title>
814
- </clause>
815
- </clause>
816
- <clause id='_' inline-header='false' obligation='normative'>
817
- <title>Intro 4</title>
818
- <clause id='_' inline-header='false' obligation='normative'>
819
- <title>Intro 5</title>
820
- <clause id='_' inline-header='false' obligation='normative'>
821
- <title>Term1</title>
822
- </clause>
823
- </clause>
824
- </clause>
825
- <clause id='_' inline-header='false' obligation='normative'>
826
- <title>Normal Terms</title>
827
- <clause id='_' inline-header='false' obligation='normative'>
828
- <title>Term2</title>
829
- </clause>
830
- </clause>
831
- <definitions id='_' obligation='normative'>
832
- <title>Symbols and abbreviated terms</title>
833
- <clause id='_' inline-header='false' obligation='normative'>
834
- <title>General</title>
835
- </clause>
836
- <definitions id='_' type='symbols' obligation='normative'>
837
- <title>Symbols</title>
838
- </definitions>
839
- </definitions>
840
- </clause>
841
- <definitions id='_' type='abbreviated_terms' obligation='normative'>
842
- <title>Abbreviated terms</title>
843
- </definitions>
844
- <clause id='_' inline-header='false' obligation='normative'>
845
- <title>Clause 4</title>
846
- <clause id='_' inline-header='false' obligation='normative'>
847
- <title>Introduction</title>
848
- </clause>
849
- <clause id='_' inline-header='false' obligation='normative'>
850
- <title>Clause 4.2</title>
851
- </clause>
852
- </clause>
853
- <clause id='_' inline-header='false' obligation='normative'>
854
- <title>Terms and Definitions</title>
855
- </clause>
856
- </sections>
857
- <annex id='_' inline-header='false' obligation='normative'>
858
- <title>Annex</title>
859
- <clause id='_' inline-header='false' obligation='normative'>
860
- <title>Annex A.1</title>
861
- </clause>
862
- </annex>
863
- <bibliography>
864
- <references id='_' normative='true' obligation='informative'>
865
- <title>Normative references</title>
866
- <p id='_'>There are no normative references in this document.</p>
867
- </references>
868
- <references id='_' normative='true' obligation='informative'>
869
- <title>Normative References 2</title>
870
- </references>
871
- <references id='_' normative='false' obligation='informative'>
872
- <title>Bibliography</title>
873
- </references>
874
- <clause id='_' obligation='informative'>
875
- <title>Bibliography 2</title>
876
- <references id='_' normative='false' obligation='informative'>
877
- <title>Bibliography Subsection</title>
878
- </references>
879
- </clause>
880
- </bibliography>
881
- </standard-document>
882
- OUTPUT
883
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
884
- .to be_equivalent_to xmlpp(output)
885
- end
886
-
887
- it "processes section names, French" do
888
- input = <<~INPUT
889
- #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
890
- .Foreword
891
-
892
- Text
893
-
894
- [abstract]
895
- == Abstract
896
-
897
- Text
898
-
899
- [heading=introduction]
900
- == Introduction
901
-
902
- === Introduction Subsection
903
-
904
- [heading=acknowledgements]
905
- == Acknowledgements
906
-
907
- [.preface]
908
- == Dedication
909
-
910
- [heading=scope]
911
- == Scope
912
-
913
- Text
914
-
915
- [bibliography,heading=normative references]
916
- == Normative References
917
-
918
- [bibliography,normative=true]
919
- == Normative References 2
920
-
921
- [heading=terms and definitions]
922
- == Terms and Definitions
923
-
924
- === Term1
925
-
926
- [heading="terms and definitions"]
927
- == Terms, Definitions, Symbols and Abbreviated Terms
928
-
929
- [.nonterm]
930
- === Introduction
931
-
932
- ==== Intro 1
933
-
934
- === Intro 2
935
-
936
- [.nonterm]
937
- ==== Intro 3
938
-
939
- === Intro 4
940
-
941
- ==== Intro 5
942
-
943
- ===== Term1
944
-
945
- === Normal Terms
946
-
947
- ==== Term2
948
-
949
- [heading=symbols and abbreviated terms]
950
- === Symbols and Abbreviated Terms
951
-
952
- [.nonterm]
953
- ==== General
954
-
955
- [heading=symbols]
956
- ==== Symbols 1
957
-
958
- [heading=abbreviated terms]
959
- == Abbreviated Terms
960
-
961
- == Clause 4
962
-
963
- === Introduction
964
-
965
- === Clause 4.2
966
-
967
- == Terms and Definitions
968
-
969
- [appendix]
970
- == Annex
971
-
972
- === Annex A.1
973
-
974
- [bibliography,heading=bibliography]
975
- == Bibliography
976
-
977
- [bibliography,normative=false]
978
- == Bibliography 2
979
-
980
- === Bibliography Subsection
981
-
982
- INPUT
983
- output = <<~OUTPUT
984
- <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
985
- <bibdata type='standard'>
986
- <title language='en' format='text/plain'>Document title</title>
987
- <language>fr</language>
988
- <script>Latn</script>
989
- <abstract>
990
- <p>Text</p>
991
- </abstract>
992
- <status>
993
- <stage>published</stage>
994
- </status>
995
- <copyright>
996
- <from>#{Time.now.year}</from>
997
- </copyright>
998
- <ext>
999
- <doctype>standard</doctype>
1000
- </ext>
1001
- </bibdata>
1002
- <preface>
1003
- <abstract id='_'>
1004
- <title>Résumé</title>
1005
- <p id='_'>Text</p>
1006
- </abstract>
1007
- <foreword id='_' obligation='informative'>
1008
- <title>Avant-propos</title>
1009
- <p id='_'>Text</p>
1010
- </foreword>
1011
- <introduction id='_' obligation='informative'>
1012
- <title>Introduction</title>
1013
- <clause id='_' inline-header='false' obligation='informative'>
1014
- <title>Introduction Subsection</title>
1015
- </clause>
1016
- </introduction>
1017
- <clause id='_' inline-header='false' obligation='informative'>
1018
- <title>Dedication</title>
1019
- </clause>
1020
- <acknowledgements id='_' obligation='informative'>
1021
- <title>Remerciements</title>
1022
- </acknowledgements>
1023
- </preface>
1024
- <sections>
1025
- <clause id='_' type='scope' inline-header='false' obligation='normative'>
1026
- <title>Domaine d’application</title>
1027
- <p id='_'>Text</p>
1028
- </clause>
1029
- <terms id='_' obligation='normative'>
1030
- <title>Terms et définitions</title>
1031
- <p id='_'>
1032
- Pour les besoins du présent document, les termes et définitions suivants
1033
- s’appliquent.
1034
- </p>
1035
- <term id='term-Term1'>
1036
- <preferred><expression><name>Term1</name></expression></preferred>
1037
- </term>
1038
- </terms>
1039
- <clause id='_' inline-header='false' obligation='normative'>
1040
- <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1041
- <clause id='_' inline-header='false' obligation='normative'>
1042
- <title>Introduction</title>
1043
- <clause id='_' inline-header='false' obligation='normative'>
1044
- <title>Intro 1</title>
1045
- </clause>
1046
- </clause>
1047
- <clause id='_' inline-header='false' obligation='normative'>
1048
- <title>Intro 2</title>
1049
- <clause id='_' inline-header='false' obligation='normative'>
1050
- <title>Intro 3</title>
1051
- </clause>
1052
- </clause>
1053
- <clause id='_' inline-header='false' obligation='normative'>
1054
- <title>Intro 4</title>
1055
- <clause id='_' inline-header='false' obligation='normative'>
1056
- <title>Intro 5</title>
1057
- <clause id='_' inline-header='false' obligation='normative'>
1058
- <title>Term1</title>
1059
- </clause>
1060
- </clause>
1061
- </clause>
1062
- <clause id='_' inline-header='false' obligation='normative'>
1063
- <title>Normal Terms</title>
1064
- <clause id='_' inline-header='false' obligation='normative'>
1065
- <title>Term2</title>
1066
- </clause>
1067
- </clause>
1068
- <definitions id='_' obligation='normative'>
1069
- <title>Symboles et termes abrégés</title>
1070
- <clause id='_' inline-header='false' obligation='normative'>
1071
- <title>General</title>
1072
- </clause>
1073
- <definitions id='_' type='symbols' obligation='normative'>
1074
- <title>Symboles</title>
1075
- </definitions>
1076
- </definitions>
1077
- </clause>
1078
- <definitions id='_' type='abbreviated_terms' obligation='normative'>
1079
- <title>Termes abrégés</title>
1080
- </definitions>
1081
- <clause id='_' inline-header='false' obligation='normative'>
1082
- <title>Clause 4</title>
1083
- <clause id='_' inline-header='false' obligation='normative'>
1084
- <title>Introduction</title>
1085
- </clause>
1086
- <clause id='_' inline-header='false' obligation='normative'>
1087
- <title>Clause 4.2</title>
1088
- </clause>
1089
- </clause>
1090
- <clause id='_' inline-header='false' obligation='normative'>
1091
- <title>Terms and Definitions</title>
1092
- </clause>
1093
- </sections>
1094
- <annex id='_' inline-header='false' obligation='normative'>
1095
- <title>Annex</title>
1096
- <clause id='_' inline-header='false' obligation='normative'>
1097
- <title>Annex A.1</title>
1098
- </clause>
1099
- </annex>
1100
- <bibliography>
1101
- <references id='_' normative='true' obligation='informative'>
1102
- <title>Références normatives</title>
1103
- <p id='_'>Le présent document ne contient aucune référence normative.</p>
1104
- </references>
1105
- <references id='_' normative='true' obligation='informative'>
1106
- <title>Normative References 2</title>
1107
- </references>
1108
- <references id='_' normative='false' obligation='informative'>
1109
- <title>Bibliographie</title>
1110
- </references>
1111
- <clause id='_' obligation='informative'>
1112
- <title>Bibliography 2</title>
1113
- <references id='_' normative='false' obligation='informative'>
1114
- <title>Bibliography Subsection</title>
1115
- </references>
1116
- </clause>
1117
- </bibliography>
1118
- </standard-document>
1119
- OUTPUT
1120
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1121
- .to be_equivalent_to xmlpp(output)
1122
- end
1123
-
1124
- it "processes section names, Simplified Chinese" do
1125
- input = <<~INPUT
1126
- #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
1127
- .Foreword
1128
-
1129
- Text
1130
-
1131
- [abstract]
1132
- == Abstract
1133
-
1134
- Text
1135
-
1136
- [heading=introduction]
1137
- == Introduction
1138
-
1139
- === Introduction Subsection
1140
-
1141
- [heading=acknowledgements]
1142
- == Acknowledgements
1143
-
1144
- [.preface]
1145
- == Dedication
1146
-
1147
- [heading=scope]
1148
- == Scope
1149
-
1150
- Text
1151
-
1152
- [bibliography,heading=normative references]
1153
- == Normative References
1154
-
1155
- [bibliography,normative=true]
1156
- == Normative References 2
1157
-
1158
- [heading=terms and definitions]
1159
- == Terms and Definitions
1160
-
1161
- === Term1
1162
-
1163
- [heading="terms and definitions"]
1164
- == Terms, Definitions, Symbols and Abbreviated Terms
1165
-
1166
- [.nonterm]
1167
- === Introduction
1168
-
1169
- ==== Intro 1
1170
-
1171
- === Intro 2
1172
-
1173
- [.nonterm]
1174
- ==== Intro 3
1175
-
1176
- === Intro 4
1177
-
1178
- ==== Intro 5
1179
-
1180
- ===== Term1
1181
-
1182
- === Normal Terms
1183
-
1184
- ==== Term2
1185
-
1186
- [heading=symbols and abbreviated terms]
1187
- === Symbols and Abbreviated Terms
1188
-
1189
- [.nonterm]
1190
- ==== General
1191
-
1192
- [heading=symbols]
1193
- ==== Symbols 1
1194
-
1195
- [heading=abbreviated terms]
1196
- == Abbreviated Terms
1197
-
1198
- == Clause 4
1199
-
1200
- === Introduction
1201
-
1202
- === Clause 4.2
1203
-
1204
- == Terms and Definitions
1205
-
1206
- [appendix]
1207
- == Annex
1208
-
1209
- === Annex A.1
1210
-
1211
- [bibliography,heading=bibliography]
1212
- == Bibliography
1213
-
1214
- [bibliography,normative=false]
1215
- == Bibliography 2
1216
-
1217
- === Bibliography Subsection
1218
-
1219
- INPUT
1220
- output = <<~OUTPUT
1221
- <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
1222
- <bibdata type='standard'>
1223
- <title language='en' format='text/plain'>Document title</title>
1224
- <language>zh</language>
1225
- <script>Hans</script>
1226
- <abstract>
1227
- <p>Text</p>
1228
- </abstract>
1229
- <status>
1230
- <stage>published</stage>
1231
- </status>
1232
- <copyright>
1233
- <from>#{Time.now.year}</from>
1234
- </copyright>
1235
- <ext>
1236
- <doctype>standard</doctype>
1237
- </ext>
1238
- </bibdata>
1239
- <preface>
1240
- <abstract id='_'>
1241
- <title>摘要</title>
1242
- <p id='_'>Text</p>
1243
- </abstract>
1244
- <foreword id='_' obligation='informative'>
1245
- <title>前言</title>
1246
- <p id='_'>Text</p>
1247
- </foreword>
1248
- <introduction id='_' obligation='informative'>
1249
- <title>引言</title>
1250
- <clause id='_' inline-header='false' obligation='informative'>
1251
- <title>Introduction Subsection</title>
1252
- </clause>
1253
- </introduction>
1254
- <clause id='_' inline-header='false' obligation='informative'>
1255
- <title>Dedication</title>
1256
- </clause>
1257
- <acknowledgements id='_' obligation='informative'>
1258
- <title>致謝</title>
1259
- </acknowledgements>
1260
- </preface>
1261
- <sections>
1262
- <clause id='_' type='scope' inline-header='false' obligation='normative'>
1263
- <title>范围</title>
1264
- <p id='_'>Text</p>
1265
- </clause>
1266
- <terms id='_' obligation='normative'>
1267
- <title>术语和定义</title>
1268
- <p id='_'>下列术语和定义适用于本文件。</p>
1269
- <term id='term-Term1'>
1270
- <preferred><expression><name>Term1</name></expression></preferred>
1271
- </term>
1272
- </terms>
1273
- <clause id='_' inline-header='false' obligation='normative'>
1274
- <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1275
- <clause id='_' inline-header='false' obligation='normative'>
1276
- <title>Introduction</title>
1277
- <clause id='_' inline-header='false' obligation='normative'>
1278
- <title>Intro 1</title>
1279
- </clause>
1280
- </clause>
1281
- <clause id='_' inline-header='false' obligation='normative'>
1282
- <title>Intro 2</title>
1283
- <clause id='_' inline-header='false' obligation='normative'>
1284
- <title>Intro 3</title>
1285
- </clause>
1286
- </clause>
1287
- <clause id='_' inline-header='false' obligation='normative'>
1288
- <title>Intro 4</title>
1289
- <clause id='_' inline-header='false' obligation='normative'>
1290
- <title>Intro 5</title>
1291
- <clause id='_' inline-header='false' obligation='normative'>
1292
- <title>Term1</title>
1293
- </clause>
1294
- </clause>
1295
- </clause>
1296
- <clause id='_' inline-header='false' obligation='normative'>
1297
- <title>Normal Terms</title>
1298
- <clause id='_' inline-header='false' obligation='normative'>
1299
- <title>Term2</title>
1300
- </clause>
1301
- </clause>
1302
- <definitions id='_' obligation='normative'>
1303
- <title>符号、代号和缩略语</title>
1304
- <clause id='_' inline-header='false' obligation='normative'>
1305
- <title>General</title>
1306
- </clause>
1307
- <definitions id='_' type='symbols' obligation='normative'>
1308
- <title>符号</title>
1309
- </definitions>
1310
- </definitions>
1311
- </clause>
1312
- <definitions id='_' type='abbreviated_terms' obligation='normative'>
1313
- <title>代号和缩略语</title>
1314
- </definitions>
1315
- <clause id='_' inline-header='false' obligation='normative'>
1316
- <title>Clause 4</title>
1317
- <clause id='_' inline-header='false' obligation='normative'>
1318
- <title>Introduction</title>
1319
- </clause>
1320
- <clause id='_' inline-header='false' obligation='normative'>
1321
- <title>Clause 4.2</title>
1322
- </clause>
1323
- </clause>
1324
- <clause id='_' inline-header='false' obligation='normative'>
1325
- <title>Terms and Definitions</title>
1326
- </clause>
1327
- </sections>
1328
- <annex id='_' inline-header='false' obligation='normative'>
1329
- <title>Annex</title>
1330
- <clause id='_' inline-header='false' obligation='normative'>
1331
- <title>Annex A.1</title>
1332
- </clause>
1333
- </annex>
1334
- <bibliography>
1335
- <references id='_' normative='true' obligation='informative'>
1336
- <title>规范性引用文件</title>
1337
- <p id='_'>本文件并没有规范性引用文件。</p>
1338
- </references>
1339
- <references id='_' normative='true' obligation='informative'>
1340
- <title>Normative References 2</title>
1341
- </references>
1342
- <references id='_' normative='false' obligation='informative'>
1343
- <title>参考文献</title>
1344
- </references>
1345
- <clause id='_' obligation='informative'>
1346
- <title>Bibliography 2</title>
1347
- <references id='_' normative='false' obligation='informative'>
1348
- <title>Bibliography Subsection</title>
1349
- </references>
1350
- </clause>
1351
- </bibliography>
1352
- </standard-document>
1353
- OUTPUT
1354
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1355
- .to be_equivalent_to xmlpp(output)
1356
- end
1357
-
1358
- it "processes section names, internationalisation file" do
1359
- input = <<~INPUT
1360
- #{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":no-pdf:\n:i18nyaml: spec/assets/i18n.yaml")}
1361
- .Foreword
1362
-
1363
- Text
1364
-
1365
- [abstract]
1366
- == Abstract
1367
-
1368
- Text
1369
-
1370
- [heading=introduction]
1371
- == Introduction
1372
-
1373
- === Introduction Subsection
1374
-
1375
- [heading=acknowledgements]
1376
- == Acknowledgements
1377
-
1378
- [.preface]
1379
- == Dedication
1380
-
1381
- [heading=scope]
1382
- == Scope
1383
-
1384
- Text
1385
-
1386
- [bibliography,heading=normative references]
1387
- == Normative References
1388
-
1389
- [bibliography,normative=true]
1390
- == Normative References 2
1391
-
1392
- [heading=terms and definitions]
1393
- == Terms and Definitions
1394
-
1395
- === Term1
1396
-
1397
- [heading="terms and definitions"]
1398
- == Terms, Definitions, Symbols and Abbreviated Terms
1399
-
1400
- [.nonterm]
1401
- === Introduction
1402
-
1403
- ==== Intro 1
1404
-
1405
- === Intro 2
1406
-
1407
- [.nonterm]
1408
- ==== Intro 3
1409
-
1410
- === Intro 4
1411
-
1412
- ==== Intro 5
1413
-
1414
- ===== Term1
1415
-
1416
- === Normal Terms
1417
-
1418
- ==== Term2
1419
-
1420
- [heading=symbols and abbreviated terms]
1421
- === Symbols and Abbreviated Terms
1422
-
1423
- [.nonterm]
1424
- ==== General
1425
-
1426
- [heading=symbols]
1427
- ==== Symbols 1
1428
-
1429
- [heading=abbreviated terms]
1430
- == Abbreviated Terms
1431
-
1432
- == Clause 4
1433
-
1434
- === Introduction
1435
-
1436
- === Clause 4.2
1437
-
1438
- == Terms and Definitions
1439
-
1440
- [appendix]
1441
- == Annex
1442
-
1443
- === Annex A.1
1444
-
1445
- [bibliography,heading=bibliography]
1446
- == Bibliography
1447
-
1448
- [bibliography,normative=false]
1449
- == Bibliography 2
1450
-
1451
- === Bibliography Subsection
1452
-
1453
- INPUT
1454
- output = <<~OUTPUT
1455
- <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
1456
- <bibdata type='standard'>
1457
- <title language='en' format='text/plain'>Document title</title>
1458
- <language>en</language>
1459
- <script>Latn</script>
1460
- <abstract>
1461
- <p>Text</p>
1462
- </abstract>
1463
- <status>
1464
- <stage>published</stage>
1465
- </status>
1466
- <copyright>
1467
- <from>#{Time.now.year}</from>
1468
- </copyright>
1469
- <ext>
1470
- <doctype>standard</doctype>
1471
- </ext>
1472
- </bibdata>
1473
- <preface>
1474
- <abstract id='_'>
1475
- <title>Abstract</title>
1476
- <p id='_'>Text</p>
1477
- </abstract>
1478
- <foreword id='_' obligation='informative'>
1479
- <title>Antaŭparolo</title>
1480
- <p id='_'>Text</p>
1481
- </foreword>
1482
- <introduction id='_' obligation='informative'>
1483
- <title>Enkonduko</title>
1484
- <clause id='_' inline-header='false' obligation='informative'>
1485
- <title>Introduction Subsection</title>
1486
- </clause>
1487
- </introduction>
1488
- <clause id='_' inline-header='false' obligation='informative'>
1489
- <title>Dedication</title>
1490
- </clause>
1491
- <acknowledgements id='_' obligation='informative'>
1492
- <title>Acknowledgements</title>
1493
- </acknowledgements>
1494
- </preface>
1495
- <sections>
1496
- <clause id='_' type='scope' inline-header='false' obligation='normative'>
1497
- <title>Amplekso</title>
1498
- <p id='_'>Text</p>
1499
- </clause>
1500
- <terms id='_' obligation='normative'>
1501
- <title>Terms and definitions</title>
1502
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1503
- <term id='term-Term1'>
1504
- <preferred><expression><name>Term1</name></expression></preferred>
1505
- </term>
1506
- </terms>
1507
- <clause id='_' inline-header='false' obligation='normative'>
1508
- <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1509
- <clause id='_' inline-header='false' obligation='normative'>
1510
- <title>Introduction</title>
1511
- <clause id='_' inline-header='false' obligation='normative'>
1512
- <title>Intro 1</title>
1513
- </clause>
1514
- </clause>
1515
- <clause id='_' inline-header='false' obligation='normative'>
1516
- <title>Intro 2</title>
1517
- <clause id='_' inline-header='false' obligation='normative'>
1518
- <title>Intro 3</title>
1519
- </clause>
1520
- </clause>
1521
- <clause id='_' inline-header='false' obligation='normative'>
1522
- <title>Intro 4</title>
1523
- <clause id='_' inline-header='false' obligation='normative'>
1524
- <title>Intro 5</title>
1525
- <clause id='_' inline-header='false' obligation='normative'>
1526
- <title>Term1</title>
1527
- </clause>
1528
- </clause>
1529
- </clause>
1530
- <clause id='_' inline-header='false' obligation='normative'>
1531
- <title>Normal Terms</title>
1532
- <clause id='_' inline-header='false' obligation='normative'>
1533
- <title>Term2</title>
1534
- </clause>
1535
- </clause>
1536
- <definitions id='_' obligation='normative'>
1537
- <title>Symbols and abbreviated terms</title>
1538
- <clause id='_' inline-header='false' obligation='normative'>
1539
- <title>General</title>
1540
- </clause>
1541
- <definitions id='_' type='symbols' obligation='normative'>
1542
- <title>Simboloj kai mallongigitaj terminoj</title>
1543
- </definitions>
1544
- </definitions>
1545
- </clause>
1546
- <definitions id='_' type='abbreviated_terms' obligation='normative'>
1547
- <title>Abbreviated terms</title>
1548
- </definitions>
1549
- <clause id='_' inline-header='false' obligation='normative'>
1550
- <title>Clause 4</title>
1551
- <clause id='_' inline-header='false' obligation='normative'>
1552
- <title>Introduction</title>
1553
- </clause>
1554
- <clause id='_' inline-header='false' obligation='normative'>
1555
- <title>Clause 4.2</title>
1556
- </clause>
1557
- </clause>
1558
- <clause id='_' inline-header='false' obligation='normative'>
1559
- <title>Terms and Definitions</title>
1560
- </clause>
1561
- </sections>
1562
- <annex id='_' inline-header='false' obligation='normative'>
1563
- <title>Annex</title>
1564
- <clause id='_' inline-header='false' obligation='normative'>
1565
- <title>Annex A.1</title>
1566
- </clause>
1567
- </annex>
1568
- <bibliography>
1569
- <references id='_' normative='true' obligation='informative'>
1570
- <title>Normaj citaĵoj</title>
1571
- <p id='_'>There are no normative references in this document.</p>
1572
- </references>
1573
- <references id='_' normative='true' obligation='informative'>
1574
- <title>Normative References 2</title>
1575
- </references>
1576
- <references id='_' normative='false' obligation='informative'>
1577
- <title>Bibliografio</title>
1578
- </references>
1579
- <clause id='_' obligation='informative'>
1580
- <title>Bibliography 2</title>
1581
- <references id='_' normative='false' obligation='informative'>
1582
- <title>Bibliography Subsection</title>
1583
- </references>
1584
- </clause>
1585
- </bibliography>
1586
- </standard-document>
1587
- OUTPUT
1588
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1589
- .to be_equivalent_to xmlpp(output)
1590
- end
1591
-
1592
- it "adds variant titles" do
1593
- input = <<~INPUT
1594
- #{ASCIIDOC_BLANK_HDR}
1595
-
1596
- == Clause
1597
- Text
1598
-
1599
- === Subclause
1600
-
1601
- [.variant-title,type=toc]
1602
- Clause _A_ stem:[x]
1603
-
1604
- [.variant-title,type=sub]
1605
- "A" 'B'
1606
-
1607
- Text
1608
-
1609
- [appendix]
1610
- == Clause
1611
-
1612
- [.variant-title,type=toc]
1613
- Clause _A_ stem:[y]
1614
-
1615
- Text
1616
- INPUT
1617
- output = <<~OUTPUT
1618
- #{BLANK_HDR}
1619
- <sections>
1620
- <clause id='_' inline-header='false' obligation='normative'>
1621
- <title>Clause</title>
1622
- <p id='_'>Text</p>
1623
- <clause id='_' inline-header='false' obligation='normative'>
1624
- <title>Subclause</title>
1625
- <variant-title type='sub'>&#8220;A&#8221; &#8216;B&#8217;</variant-title>
1626
- <variant-title type='toc'>
1627
- Clause
1628
- <em>A</em>
1629
- <stem type='MathML'>
1630
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1631
- <mi>x</mi>
1632
- </math>
1633
- </stem>
1634
- </variant-title>
1635
- <p id='_'>Text</p>
1636
- </clause>
1637
- </clause>
1638
- </sections>
1639
- <annex id='_' inline-header='false' obligation='normative'>
1640
- <title>Clause</title>
1641
- <variant-title type='toc'>
1642
- Clause
1643
- <em>A</em>
1644
- <stem type='MathML'>
1645
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1646
- <mi>y</mi>
1647
- </math>
1648
- </stem>
1649
- </variant-title>
1650
- <p id='_'>Text</p>
1651
- </annex>
1652
- </standard-document>
1653
- OUTPUT
1654
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1655
- .to be_equivalent_to xmlpp(output)
1656
- end
1657
-
1658
- it "processes TOC clause" do
1659
- input = <<~INPUT
1660
- #{ASCIIDOC_BLANK_HDR}
1661
-
1662
- == Clause
1663
- Text
1664
-
1665
- [type=toc]
1666
- === Table of contents
1667
-
1668
- Text at the start
1669
-
1670
- ==== Toc 1
1671
-
1672
- * <<cl2>>
1673
- ** <<a1>>
1674
-
1675
- ==== Toc 2
1676
-
1677
- * <<cl2,some text>>
1678
- ** <<a1,some more text>>
1679
-
1680
- [[cl2]]
1681
- == Clause2
1682
-
1683
- [.variant-title,type=toc]
1684
- Clause _A_ stem:[x]
1685
-
1686
- [.variant-title,type=sub]
1687
- "A" 'B'
1688
-
1689
- Text
1690
-
1691
- [[a1]]
1692
- [appendix]
1693
- == Clause
1694
-
1695
- [.variant-title,type=toc]
1696
- Clause _A_ stem:[y]
1697
-
1698
- Text
1699
- INPUT
1700
- output = <<~OUTPUT
1701
- #{BLANK_HDR}
1702
- <sections>
1703
- <clause id='_' inline-header='false' obligation='normative'>
1704
- <title>Clause</title>
1705
- <p id='_'>Text</p>
1706
- <clause id='_' type='toc' inline-header='false' obligation='normative'>
1707
- <title>Table of contents</title>
1708
- <p id='_'>Text at the start</p>
1709
- <clause id='_' inline-header='false' obligation='normative'>
1710
- <title>Toc 1</title>
1711
- <toc>
1712
- <ul id='_'>
1713
- <li>
1714
- <p id='_'>
1715
- <xref target='cl2'>
1716
- Clause#{' '}
1717
- <em>A</em>
1718
- <stem type='MathML'>
1719
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1720
- <mi>x</mi>
1721
- </math>
1722
- </stem>
1723
- </xref>
1724
- </p>
1725
- <ul id='_'>
1726
- <li>
1727
- <p id='_'>
1728
- <xref target='a1'>
1729
- Clause#{' '}
1730
- <em>A</em>
1731
- <stem type='MathML'>
1732
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1733
- <mi>y</mi>
1734
- </math>
1735
- </stem>
1736
- </xref>
1737
- </p>
1738
- </li>
1739
- </ul>
1740
- </li>
1741
- </ul>
1742
- </toc>
1743
- </clause>
1744
- <clause id='_' inline-header='false' obligation='normative'>
1745
- <title>Toc 2</title>
1746
- <toc>
1747
- <ul id='_'>
1748
- <li>
1749
- <p id='_'>
1750
- <xref target='cl2'>some text</xref>
1751
- </p>
1752
- <ul id='_'>
1753
- <li>
1754
- <p id='_'>
1755
- <xref target='a1'>some more text</xref>
1756
- </p>
1757
- </li>
1758
- </ul>
1759
- </li>
1760
- </ul>
1761
- </toc>
1762
- </clause>
1763
- </clause>
1764
- </clause>
1765
- <clause id='cl2' inline-header='false' obligation='normative'>
1766
- <title>Clause2</title>
1767
- <variant-title type='sub'>&#8220;A&#8221; &#8216;B&#8217;</variant-title>
1768
- <variant-title type='toc'>
1769
- Clause#{' '}
1770
- <em>A</em>
1771
- <stem type='MathML'>
1772
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1773
- <mi>x</mi>
1774
- </math>
1775
- </stem>
1776
- </variant-title>
1777
- <p id='_'>Text</p>
1778
- </clause>
1779
- </sections>
1780
- <annex id='a1' inline-header='false' obligation='normative'>
1781
- <title>Clause</title>
1782
- <variant-title type='toc'>
1783
- Clause#{' '}
1784
- <em>A</em>
1785
- <stem type='MathML'>
1786
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
1787
- <mi>y</mi>
1788
- </math>
1789
- </stem>
1790
- </variant-title>
1791
- <p id='_'>Text</p>
1792
- </annex>
1793
- </standard-document>
1794
- OUTPUT
1795
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1796
- .to be_equivalent_to xmlpp(output)
1797
- end
1798
-
1799
- it "processes bibliography annex" do
1800
- input = <<~INPUT
1801
- #{ASCIIDOC_BLANK_HDR}
1802
-
1803
- [appendix]
1804
- == Bibliography
1805
-
1806
- [bibliography]
1807
- === Bibliography
1808
- INPUT
1809
- output = <<~OUTPUT
1810
- <annex id='_' obligation='' language='' script=''>
1811
- <title>Bibliography</title>
1812
- <references id='_' normative='false' obligation='informative'>
1813
- <title>Bibliography</title>
1814
- </references>
1815
- </annex>
1816
- OUTPUT
1817
- ret = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
1818
- expect(xmlpp(strip_guid(ret.at("//xmlns:annex").to_xml)))
1819
- .to be_equivalent_to(output)
1820
- end
1821
-
1822
- it "processes terms annex" do
1823
- input = <<~INPUT
1824
- #{ASCIIDOC_BLANK_HDR}
1825
-
1826
- [appendix]
1827
- == Terms and definitions
1828
-
1829
- === Terms and definitions
1830
- INPUT
1831
- output = <<~OUTPUT
1832
- <annex id='_' obligation='' language='' script=''>
1833
- <terms id='_' obligation='normative'>
1834
- <title>Terms and definitions</title>
1835
- <term id='term-Terms-and-definitions'>
1836
- <preferred>
1837
- <expression>
1838
- <name>Terms and definitions</name>
1839
- </expression>
1840
- </preferred>
1841
- </term>
1842
- </terms>
1843
- </annex>
1844
- OUTPUT
1845
- ret = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
1846
- expect(xmlpp(strip_guid(ret.at("//xmlns:annex").to_xml)))
1847
- .to be_equivalent_to(output)
1848
- end
1849
- end