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.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/base.rb +3 -5
- data/lib/metanorma/standoc/biblio.rng +5 -0
- data/lib/metanorma/standoc/cleanup.rb +17 -17
- data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
- data/lib/metanorma/standoc/cleanup_biblio.rb +2 -1
- data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
- data/lib/metanorma/standoc/cleanup_section.rb +19 -9
- data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
- data/lib/metanorma/standoc/cleanup_text.rb +10 -4
- data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
- data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
- data/lib/metanorma/standoc/inline.rb +27 -12
- data/lib/metanorma/standoc/isodoc.rng +46 -12
- data/lib/metanorma/standoc/ref_utility.rb +1 -0
- data/lib/metanorma/standoc/render.rb +10 -1
- data/lib/metanorma/standoc/section.rb +10 -3
- data/lib/metanorma/standoc/utils.rb +6 -1
- data/lib/metanorma/standoc/validate.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +5 -2
- metadata +4 -128
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/rspec +0 -18
- data/spec/assets/a1.adoc +0 -8
- data/spec/assets/a2.adoc +0 -10
- data/spec/assets/a3.adoc +0 -9
- data/spec/assets/a3a.adoc +0 -7
- data/spec/assets/a4.adoc +0 -4
- data/spec/assets/boilerplate.xml +0 -4
- data/spec/assets/codes.yml +0 -695
- data/spec/assets/correct.png +0 -0
- data/spec/assets/corrupt.png +0 -0
- data/spec/assets/header.html +0 -7
- data/spec/assets/html-override.css +0 -1
- data/spec/assets/html.scss +0 -13
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -17
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -8
- data/spec/assets/iso123.rxl +0 -107
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word-override.css +0 -1
- data/spec/assets/word.scss +0 -13
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/assets/xref_error.adoc +0 -8
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/codes_table.html +0 -3174
- data/spec/examples/datamodel/address_class_profile.adoc +0 -5
- data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
- data/spec/examples/datamodel/address_component_profile.adoc +0 -5
- data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
- data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
- data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
- data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
- data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
- data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
- data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
- data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
- data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
- data/spec/examples/datamodel/models/models/Localization.yml +0 -23
- data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
- data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
- data/spec/examples/datamodel/models/models/Signature.yml +0 -20
- data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
- data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
- data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
- data/spec/examples/datamodel/models/models/Validity.yml +0 -14
- data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
- data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
- data/spec/examples/datamodel/models/style.uml.inc +0 -37
- data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
- data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
- data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -46
- data/spec/examples/iso_123_all_parts.xml +0 -46
- data/spec/examples/iso_123_no_year_note.xml +0 -47
- data/spec/examples/iso_124_.xml +0 -42
- data/spec/examples/iso_216_.xml +0 -48
- data/spec/examples/iso_iec_12382_.xml +0 -49
- data/spec/examples/rice.adoc +0 -715
- data/spec/examples/rice.preview.html +0 -1877
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_images/rice_image1.png +0 -0
- data/spec/examples/rice_images/rice_image2.png +0 -0
- data/spec/examples/rice_images/rice_image3_1.png +0 -0
- data/spec/examples/rice_images/rice_image3_2.png +0 -0
- data/spec/examples/rice_images/rice_image3_3.png +0 -0
- data/spec/fixtures/action_schemaexpg1.svg +0 -122
- data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
- data/spec/fixtures/diagram_definitions.lutaml +0 -22
- data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
- data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
- data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
- data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
- data/spec/fixtures/test.exp +0 -121
- data/spec/fixtures/test.xmi +0 -9250
- data/spec/metanorma/base_spec.rb +0 -1125
- data/spec/metanorma/biblio_spec.rb +0 -1012
- data/spec/metanorma/blank_spec.rb +0 -37
- data/spec/metanorma/blocks_spec.rb +0 -1784
- data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
- data/spec/metanorma/cleanup_sections_spec.rb +0 -1849
- data/spec/metanorma/cleanup_spec.rb +0 -1931
- data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
- data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
- data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
- data/spec/metanorma/inline_spec.rb +0 -785
- data/spec/metanorma/isobib_cache_spec.rb +0 -742
- data/spec/metanorma/lists_spec.rb +0 -232
- data/spec/metanorma/macros_concept_spec.rb +0 -1052
- data/spec/metanorma/macros_json2text_spec.rb +0 -10
- data/spec/metanorma/macros_plantuml_spec.rb +0 -402
- data/spec/metanorma/macros_spec.rb +0 -1183
- data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
- data/spec/metanorma/processor_spec.rb +0 -96
- data/spec/metanorma/refs_spec.rb +0 -2807
- data/spec/metanorma/reqt_spec.rb +0 -130
- data/spec/metanorma/section_spec.rb +0 -1325
- data/spec/metanorma/table_spec.rb +0 -474
- data/spec/metanorma/validate_spec.rb +0 -886
- data/spec/spec_helper.rb +0 -290
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
- data/spec/vcr_cassettes/bsi16341.yml +0 -486
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
- data/spec/vcr_cassettes/hide_refs.yml +0 -587
- data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
- data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -367
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
- data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -1,1325 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Metanorma::Standoc do
|
4
|
-
it "processes sections" do
|
5
|
-
input = <<~INPUT
|
6
|
-
#{ASCIIDOC_BLANK_HDR}
|
7
|
-
.Foreword
|
8
|
-
|
9
|
-
Text
|
10
|
-
|
11
|
-
[abstract]
|
12
|
-
== Abstract
|
13
|
-
|
14
|
-
Text
|
15
|
-
|
16
|
-
== Introduction
|
17
|
-
|
18
|
-
=== Introduction Subsection
|
19
|
-
|
20
|
-
== Acknowledgements
|
21
|
-
|
22
|
-
[.preface]
|
23
|
-
== Dedication
|
24
|
-
|
25
|
-
== Scope
|
26
|
-
|
27
|
-
Text
|
28
|
-
|
29
|
-
[bibliography]
|
30
|
-
== Normative References
|
31
|
-
|
32
|
-
== Terms and Definitions
|
33
|
-
|
34
|
-
=== Term1
|
35
|
-
|
36
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
37
|
-
|
38
|
-
[.boilerplate]
|
39
|
-
=== Boilerplate
|
40
|
-
|
41
|
-
Boilerplate text
|
42
|
-
|
43
|
-
[.nonterm]
|
44
|
-
=== Introduction
|
45
|
-
|
46
|
-
==== Intro 1
|
47
|
-
|
48
|
-
=== Intro 2
|
49
|
-
|
50
|
-
[.nonterm]
|
51
|
-
==== Intro 3
|
52
|
-
|
53
|
-
=== Intro 4
|
54
|
-
|
55
|
-
==== Intro 5
|
56
|
-
|
57
|
-
===== Term1
|
58
|
-
|
59
|
-
=== Normal Terms
|
60
|
-
|
61
|
-
==== Term2
|
62
|
-
|
63
|
-
=== Symbols and Abbreviated Terms
|
64
|
-
|
65
|
-
[.nonterm]
|
66
|
-
==== General
|
67
|
-
|
68
|
-
==== Symbols
|
69
|
-
|
70
|
-
== Abbreviated Terms
|
71
|
-
|
72
|
-
== Clause 4
|
73
|
-
|
74
|
-
=== Introduction
|
75
|
-
|
76
|
-
=== Clause 4.2
|
77
|
-
|
78
|
-
== Terms and Definitions
|
79
|
-
|
80
|
-
== Acknowledgements
|
81
|
-
|
82
|
-
[appendix]
|
83
|
-
== Annex
|
84
|
-
|
85
|
-
=== Annex A.1
|
86
|
-
|
87
|
-
[bibliography]
|
88
|
-
== Bibliography
|
89
|
-
|
90
|
-
=== Bibliography Subsection
|
91
|
-
|
92
|
-
[index]
|
93
|
-
== Index
|
94
|
-
|
95
|
-
This is an index
|
96
|
-
|
97
|
-
[index,type=thematic]
|
98
|
-
== Thematic Index
|
99
|
-
INPUT
|
100
|
-
output = <<~OUTPUT
|
101
|
-
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
102
|
-
<preface><abstract id="_">
|
103
|
-
<title>Abstract</title>
|
104
|
-
<p id="_">Text</p>
|
105
|
-
</abstract><foreword id='_' obligation="informative">
|
106
|
-
<title>Foreword</title>
|
107
|
-
<p id="_">Text</p>
|
108
|
-
</foreword><introduction id="_" obligation="informative">
|
109
|
-
<title>Introduction</title>
|
110
|
-
<clause id="_" inline-header="false" obligation="informative">
|
111
|
-
<title>Introduction Subsection</title>
|
112
|
-
</clause>
|
113
|
-
</introduction>
|
114
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
115
|
-
<title>Dedication</title>
|
116
|
-
</clause>
|
117
|
-
<acknowledgements id='_' obligation='informative'>
|
118
|
-
<title>Acknowledgements</title>
|
119
|
-
</acknowledgements>
|
120
|
-
</preface><sections>
|
121
|
-
<clause id="_" inline-header="false" obligation="normative" type="scope">
|
122
|
-
<title>Scope</title>
|
123
|
-
<p id="_">Text</p>
|
124
|
-
</clause>
|
125
|
-
<terms id="_" obligation="normative">
|
126
|
-
<title>Terms and definitions</title>
|
127
|
-
<p id="_">For the purposes of this document,
|
128
|
-
the following terms and definitions apply.</p>
|
129
|
-
<term id="term-Term1">
|
130
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
131
|
-
</term>
|
132
|
-
</terms>
|
133
|
-
<clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
134
|
-
<p id='_'>Boilerplate text</p>
|
135
|
-
<clause id="_" inline-header="false" obligation="normative">
|
136
|
-
<title>Introduction</title>
|
137
|
-
<clause id="_" inline-header="false" obligation="normative">
|
138
|
-
<title>Intro 1</title>
|
139
|
-
</clause>
|
140
|
-
</clause>
|
141
|
-
<terms id="_" obligation="normative">
|
142
|
-
<title>Intro 2</title>
|
143
|
-
<clause id="_" inline-header="false" obligation="normative">
|
144
|
-
<title>Intro 3</title>
|
145
|
-
</clause>
|
146
|
-
</terms>
|
147
|
-
<clause id="_" obligation="normative">
|
148
|
-
<title>Intro 4</title>
|
149
|
-
<terms id="_" obligation="normative">
|
150
|
-
<title>Intro 5</title>
|
151
|
-
<term id="term-Term1-1">
|
152
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
153
|
-
</term>
|
154
|
-
</terms>
|
155
|
-
</clause>
|
156
|
-
<terms id="_" obligation="normative">
|
157
|
-
<title>Normal Terms</title>
|
158
|
-
<term id="term-Term2">
|
159
|
-
<preferred><expression><name>Term2</name></expression></preferred>
|
160
|
-
</term>
|
161
|
-
</terms>
|
162
|
-
<definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" inline-header="false" obligation="normative">
|
163
|
-
<title>General</title>
|
164
|
-
</clause>
|
165
|
-
<definitions id="_" obligation="normative" type="symbols">
|
166
|
-
<title>Symbols</title>
|
167
|
-
</definitions></definitions></clause>
|
168
|
-
<definitions id="_" obligation="normative" type="abbreviated_terms">
|
169
|
-
<title>Abbreviated terms</title>
|
170
|
-
</definitions>
|
171
|
-
<clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
|
172
|
-
<title>Introduction</title>
|
173
|
-
</clause>
|
174
|
-
<clause id="_" inline-header="false" obligation="normative">
|
175
|
-
<title>Clause 4.2</title>
|
176
|
-
</clause></clause>
|
177
|
-
<clause id="_" inline-header="false" obligation="normative">
|
178
|
-
<title>Terms and Definitions</title>
|
179
|
-
</clause>
|
180
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
181
|
-
<title>Acknowledgements</title>
|
182
|
-
</clause>
|
183
|
-
</sections><annex id="_" inline-header="false" obligation="normative">
|
184
|
-
<title>Annex</title>
|
185
|
-
<clause id="_" inline-header="false" obligation="normative">
|
186
|
-
<title>Annex A.1</title>
|
187
|
-
</clause>
|
188
|
-
</annex><bibliography><references id="_" obligation="informative" normative="true">
|
189
|
-
<title>Normative references</title>
|
190
|
-
<p id="_">There are no normative references in this document.</p>
|
191
|
-
</references><clause id="_" obligation="informative">
|
192
|
-
<title>Bibliography</title>
|
193
|
-
<references id="_" obligation="informative" normative="false">
|
194
|
-
<title>Bibliography Subsection</title>
|
195
|
-
</references>
|
196
|
-
</clause></bibliography>
|
197
|
-
<indexsect id='_'>
|
198
|
-
<title>Index</title>
|
199
|
-
<p id='_'>This is an index</p>
|
200
|
-
</indexsect>
|
201
|
-
<indexsect id='_' type='thematic'>
|
202
|
-
<title>Thematic Index</title>
|
203
|
-
</indexsect>
|
204
|
-
</standard-document>
|
205
|
-
OUTPUT
|
206
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
207
|
-
.to be_equivalent_to xmlpp(output)
|
208
|
-
end
|
209
|
-
|
210
|
-
it "processes sections with number attributes" do
|
211
|
-
input = <<~INPUT
|
212
|
-
#{ASCIIDOC_BLANK_HDR}
|
213
|
-
[number=1bis]
|
214
|
-
== Scope
|
215
|
-
|
216
|
-
Text
|
217
|
-
|
218
|
-
[number=2bis]
|
219
|
-
== Normative References
|
220
|
-
|
221
|
-
[number=3bis]
|
222
|
-
== Terms and Definitions
|
223
|
-
|
224
|
-
[number=4bis]
|
225
|
-
=== Term1
|
226
|
-
|
227
|
-
[number=5bis]
|
228
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
229
|
-
|
230
|
-
[.nonterm,number=6bis]
|
231
|
-
=== Introduction
|
232
|
-
|
233
|
-
[number=7bis]
|
234
|
-
==== Intro 1
|
235
|
-
|
236
|
-
[number=8bis]
|
237
|
-
=== Intro 2
|
238
|
-
|
239
|
-
[number=9bis]
|
240
|
-
=== Symbols and Abbreviated Terms
|
241
|
-
|
242
|
-
[.nonterm,number=10bis]
|
243
|
-
==== General
|
244
|
-
|
245
|
-
[number=11bis]
|
246
|
-
==== Symbols
|
247
|
-
|
248
|
-
[number=12bis]
|
249
|
-
== Abbreviated Terms
|
250
|
-
|
251
|
-
[number=13bis]
|
252
|
-
== Clause 4
|
253
|
-
|
254
|
-
[number=14bis]
|
255
|
-
=== Introduction
|
256
|
-
|
257
|
-
[number=15bis]
|
258
|
-
=== Clause 4.2
|
259
|
-
|
260
|
-
[number=16bis]
|
261
|
-
== Terms and Definitions
|
262
|
-
|
263
|
-
[appendix,number=17bis]
|
264
|
-
== Annex
|
265
|
-
|
266
|
-
[number=18bis]
|
267
|
-
=== Annex A.1
|
268
|
-
|
269
|
-
[bibliography,number=19bis]
|
270
|
-
== Bibliography
|
271
|
-
|
272
|
-
[number=20bis]
|
273
|
-
=== Bibliography Subsection
|
274
|
-
INPUT
|
275
|
-
output = <<~OUTPUT
|
276
|
-
#{BLANK_HDR}
|
277
|
-
<sections>
|
278
|
-
<clause id='_' number='1bis' type='scope' inline-header='false' obligation='normative'>
|
279
|
-
<title>Scope</title>
|
280
|
-
<p id='_'>Text</p>
|
281
|
-
</clause>
|
282
|
-
<terms id='_' number='3bis' obligation='normative'>
|
283
|
-
<title>Terms and definitions</title>
|
284
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
285
|
-
<term id='term-Term1' number='4bis'>
|
286
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
287
|
-
</term>
|
288
|
-
</terms>
|
289
|
-
<terms id='_' number='5bis' obligation='normative'>
|
290
|
-
<title>Terms, definitions, symbols and abbreviated terms</title>
|
291
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
292
|
-
<clause id='_' number='6bis' inline-header='false' obligation='normative'>
|
293
|
-
<title>Introduction</title>
|
294
|
-
<clause id='_' number='7bis' inline-header='false' obligation='normative'>
|
295
|
-
<title>Intro 1</title>
|
296
|
-
</clause>
|
297
|
-
</clause>
|
298
|
-
<term id='term-Intro-2' number='8bis'>
|
299
|
-
<preferred><expression><name>Intro 2</name></expression></preferred>
|
300
|
-
</term>
|
301
|
-
<definitions id='_' number='9bis' obligation='normative'>
|
302
|
-
<title>Symbols and abbreviated terms</title>
|
303
|
-
<clause id='_' number='10bis' inline-header='false' obligation='normative'>
|
304
|
-
<title>General</title>
|
305
|
-
</clause>
|
306
|
-
<definitions id='_' number='11bis' type='symbols' obligation='normative'>
|
307
|
-
<title>Symbols</title>
|
308
|
-
</definitions>
|
309
|
-
</definitions>
|
310
|
-
</terms>
|
311
|
-
<definitions id='_' number='12bis' type='abbreviated_terms' obligation='normative'>
|
312
|
-
<title>Abbreviated terms</title>
|
313
|
-
</definitions>
|
314
|
-
<clause id='_' number='13bis' inline-header='false' obligation='normative'>
|
315
|
-
<title>Clause 4</title>
|
316
|
-
<clause id='_' number='14bis' inline-header='false' obligation='normative'>
|
317
|
-
<title>Introduction</title>
|
318
|
-
</clause>
|
319
|
-
<clause id='_' number='15bis' inline-header='false' obligation='normative'>
|
320
|
-
<title>Clause 4.2</title>
|
321
|
-
</clause>
|
322
|
-
</clause>
|
323
|
-
<clause id='_' number='16bis' inline-header='false' obligation='normative'>
|
324
|
-
<title>Terms and Definitions</title>
|
325
|
-
</clause>
|
326
|
-
</sections>
|
327
|
-
<annex id='_' number='17bis' inline-header='false' obligation='normative'>
|
328
|
-
<title>Annex</title>
|
329
|
-
<clause id='_' number='18bis' inline-header='false' obligation='normative'>
|
330
|
-
<title>Annex A.1</title>
|
331
|
-
</clause>
|
332
|
-
</annex>
|
333
|
-
<bibliography>
|
334
|
-
<references id='_' number='2bis' normative='true' obligation='informative'>
|
335
|
-
<title>Normative references</title>
|
336
|
-
<p id='_'>There are no normative references in this document.</p>
|
337
|
-
</references>
|
338
|
-
<clause id='_' number='19bis' obligation='informative'>
|
339
|
-
<title>Bibliography</title>
|
340
|
-
<references id='_' number='20bis' normative='false' obligation='informative'>
|
341
|
-
<title>Bibliography Subsection</title>
|
342
|
-
</references>
|
343
|
-
</clause>
|
344
|
-
</bibliography>
|
345
|
-
</standard-document>
|
346
|
-
OUTPUT
|
347
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
348
|
-
.to be_equivalent_to xmlpp(output)
|
349
|
-
end
|
350
|
-
|
351
|
-
it "processes sections with language and script attributes" do
|
352
|
-
input = <<~INPUT
|
353
|
-
#{ASCIIDOC_BLANK_HDR}
|
354
|
-
[language=en,script=Latn]
|
355
|
-
== Foreword
|
356
|
-
|
357
|
-
Text
|
358
|
-
|
359
|
-
[abstract,language=en,script=Latn]
|
360
|
-
== Abstract
|
361
|
-
|
362
|
-
Text
|
363
|
-
|
364
|
-
[language=en,script=Latn]
|
365
|
-
== Introduction
|
366
|
-
|
367
|
-
[language=en,script=Latn]
|
368
|
-
=== Introduction Subsection
|
369
|
-
|
370
|
-
[language=en,script=Latn]
|
371
|
-
== Acknowledgements
|
372
|
-
|
373
|
-
[.preface]
|
374
|
-
[language=en,script=Latn]
|
375
|
-
== Dedication
|
376
|
-
|
377
|
-
[language=en,script=Latn]
|
378
|
-
== Scope
|
379
|
-
|
380
|
-
Text
|
381
|
-
|
382
|
-
[language=en,script=Latn]
|
383
|
-
== Normative References
|
384
|
-
|
385
|
-
[language=en,script=Latn]
|
386
|
-
== Terms and Definitions
|
387
|
-
|
388
|
-
[language=en,script=Latn]
|
389
|
-
=== Term1
|
390
|
-
|
391
|
-
[language=en,script=Latn]
|
392
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
393
|
-
|
394
|
-
[.nonterm]
|
395
|
-
[language=en,script=Latn]
|
396
|
-
=== Introduction
|
397
|
-
|
398
|
-
==== Intro 1
|
399
|
-
|
400
|
-
[language=en,script=Latn]
|
401
|
-
=== Intro 2
|
402
|
-
|
403
|
-
[.nonterm]
|
404
|
-
[language=en,script=Latn]
|
405
|
-
==== Intro 3
|
406
|
-
|
407
|
-
[language=en,script=Latn]
|
408
|
-
=== Intro 4
|
409
|
-
|
410
|
-
[language=en,script=Latn]
|
411
|
-
==== Intro 5
|
412
|
-
|
413
|
-
===== Term1
|
414
|
-
|
415
|
-
[language=en,script=Latn]
|
416
|
-
=== Normal Terms
|
417
|
-
|
418
|
-
==== Term2
|
419
|
-
|
420
|
-
[language=en,script=Latn]
|
421
|
-
=== Symbols and Abbreviated Terms
|
422
|
-
|
423
|
-
[.nonterm]
|
424
|
-
[language=en,script=Latn]
|
425
|
-
==== General
|
426
|
-
|
427
|
-
==== Symbols
|
428
|
-
|
429
|
-
[language=en,script=Latn]
|
430
|
-
== Abbreviated Terms
|
431
|
-
|
432
|
-
[language=en,script=Latn]
|
433
|
-
== Clause 4
|
434
|
-
|
435
|
-
[language=en,script=Latn]
|
436
|
-
=== Introduction
|
437
|
-
|
438
|
-
[language=en,script=Latn]
|
439
|
-
=== Clause 4.2
|
440
|
-
|
441
|
-
[language=en,script=Latn]
|
442
|
-
== Terms and Definitions
|
443
|
-
|
444
|
-
[appendix,language=en,script=Latn]
|
445
|
-
== Annex
|
446
|
-
|
447
|
-
[language=en,script=Latn]
|
448
|
-
=== Annex A.1
|
449
|
-
|
450
|
-
[language=en,script=Latn]
|
451
|
-
== Bibliography
|
452
|
-
|
453
|
-
[language=en,script=Latn]
|
454
|
-
=== Bibliography Subsection
|
455
|
-
INPUT
|
456
|
-
output = <<~OUTPUT
|
457
|
-
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
458
|
-
<preface><abstract id="_" language="en" script="Latn">
|
459
|
-
<title>Abstract</title>
|
460
|
-
<p id="_">Text</p>
|
461
|
-
</abstract><foreword id='_' language='en' script='Latn' obligation='informative'>
|
462
|
-
<title>Foreword</title>
|
463
|
-
<p id="_">Text</p>
|
464
|
-
</foreword><introduction id="_" language="en" script="Latn" obligation="informative">
|
465
|
-
<title>Introduction</title>
|
466
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="informative">
|
467
|
-
<title>Introduction Subsection</title>
|
468
|
-
</clause>
|
469
|
-
</introduction>
|
470
|
-
<clause id='_' language='en' script='Latn' inline-header='false' obligation='informative'>
|
471
|
-
<title>Dedication</title>
|
472
|
-
</clause>
|
473
|
-
<acknowledgements id='_' language='en' script='Latn' obligation='informative'>
|
474
|
-
<title>Acknowledgements</title>
|
475
|
-
</acknowledgements>
|
476
|
-
</preface><sections>
|
477
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative" type="scope">
|
478
|
-
<title>Scope</title>
|
479
|
-
<p id="_">Text</p>
|
480
|
-
</clause>
|
481
|
-
<terms id="_" language="en" script="Latn" obligation="normative">
|
482
|
-
<title>Terms and definitions</title>
|
483
|
-
<p id="_">For the purposes of this document,
|
484
|
-
the following terms and definitions apply.</p>
|
485
|
-
<term id="term-Term1" language="en" script="Latn">
|
486
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
487
|
-
</term>
|
488
|
-
</terms>
|
489
|
-
<clause id="_" language="en" script="Latn" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
490
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
491
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
492
|
-
<title>Introduction</title>
|
493
|
-
<clause id="_" inline-header="false" obligation="normative">
|
494
|
-
<title>Intro 1</title>
|
495
|
-
</clause>
|
496
|
-
</clause>
|
497
|
-
<terms id="_" language="en" script="Latn" obligation="normative">
|
498
|
-
<title>Intro 2</title>
|
499
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
500
|
-
<title>Intro 3</title>
|
501
|
-
</clause>
|
502
|
-
</terms>
|
503
|
-
<clause id="_" language="en" script="Latn" obligation="normative">
|
504
|
-
<title>Intro 4</title>
|
505
|
-
<terms id="_" language="en" script="Latn" obligation="normative">
|
506
|
-
<title>Intro 5</title>
|
507
|
-
<term id="term-Term1-1">
|
508
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
509
|
-
</term>
|
510
|
-
</terms>
|
511
|
-
</clause>
|
512
|
-
<terms id="_" language="en" script="Latn" obligation="normative">
|
513
|
-
<title>Normal Terms</title>
|
514
|
-
<term id="term-Term2">
|
515
|
-
<preferred><expression><name>Term2</name></expression></preferred>
|
516
|
-
</term>
|
517
|
-
</terms>
|
518
|
-
<definitions id="_" language="en" script="Latn" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
519
|
-
<title>General</title>
|
520
|
-
</clause>
|
521
|
-
<definitions id="_" obligation="normative" type="symbols">
|
522
|
-
<title>Symbols</title>
|
523
|
-
</definitions></definitions></clause>
|
524
|
-
<definitions id="_" language="en" script="Latn" obligation="normative" type="abbreviated_terms">
|
525
|
-
<title>Abbreviated terms</title>
|
526
|
-
</definitions>
|
527
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
528
|
-
<title>Introduction</title>
|
529
|
-
</clause>
|
530
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
531
|
-
<title>Clause 4.2</title>
|
532
|
-
</clause></clause>
|
533
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
534
|
-
<title>Terms and Definitions</title>
|
535
|
-
</clause>
|
536
|
-
</sections><annex id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
537
|
-
<title>Annex</title>
|
538
|
-
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
539
|
-
<title>Annex A.1</title>
|
540
|
-
</clause>
|
541
|
-
</annex><bibliography><references id="_" language="en" script="Latn" obligation="informative" normative="true">
|
542
|
-
<title>Normative references</title>
|
543
|
-
<p id="_">There are no normative references in this document.</p>
|
544
|
-
</references><clause id="_" language="en" script="Latn" obligation="informative">
|
545
|
-
<title>Bibliography</title>
|
546
|
-
<references id="_" language="en" script="Latn" obligation="informative" normative="false">
|
547
|
-
<title>Bibliography Subsection</title>
|
548
|
-
</references>
|
549
|
-
</clause></bibliography>
|
550
|
-
</standard-document>
|
551
|
-
OUTPUT
|
552
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
553
|
-
.to be_equivalent_to xmlpp(output)
|
554
|
-
end
|
555
|
-
|
556
|
-
it "processes sections with title and type attributes" do
|
557
|
-
input = <<~INPUT
|
558
|
-
#{ASCIIDOC_BLANK_HDR}
|
559
|
-
.Foreword
|
560
|
-
|
561
|
-
Text
|
562
|
-
|
563
|
-
[abstract]
|
564
|
-
== Περίληψη
|
565
|
-
|
566
|
-
Text
|
567
|
-
|
568
|
-
[heading=introduction]
|
569
|
-
== Εισαγωγή
|
570
|
-
|
571
|
-
=== Introduction Subsection
|
572
|
-
|
573
|
-
[heading=acknowledgements]
|
574
|
-
== Ευχαριστίες
|
575
|
-
|
576
|
-
[heading=normative references]
|
577
|
-
== Κανονιστικές Παραπομπές
|
578
|
-
|
579
|
-
[heading=terms and definitions]
|
580
|
-
== Όροι και Ορισμοί
|
581
|
-
|
582
|
-
=== Term1
|
583
|
-
|
584
|
-
[heading="terms, definitions, symbols and abbreviated terms"]
|
585
|
-
== Όροι, Ορισμοί, Σύμβολα και Συντομογραφίες
|
586
|
-
|
587
|
-
=== Normal Terms
|
588
|
-
|
589
|
-
==== Term2
|
590
|
-
|
591
|
-
[heading=symbols]
|
592
|
-
=== Σύμβολα και Συντομογραφίες
|
593
|
-
|
594
|
-
[heading=abbreviated terms]
|
595
|
-
== Σύμβολα και Συντομογραφίες
|
596
|
-
|
597
|
-
[type=ABC]
|
598
|
-
== Clause 4
|
599
|
-
|
600
|
-
[type=DEF]
|
601
|
-
=== Introduction
|
602
|
-
|
603
|
-
=== Clause 4.2
|
604
|
-
|
605
|
-
[appendix]
|
606
|
-
== Annex
|
607
|
-
|
608
|
-
=== Annex A.1
|
609
|
-
|
610
|
-
[heading=bibliography]
|
611
|
-
== Βιβλιογραφία
|
612
|
-
|
613
|
-
=== Bibliography Subsection
|
614
|
-
INPUT
|
615
|
-
output = <<~OUTPUT
|
616
|
-
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
617
|
-
<preface>
|
618
|
-
<abstract id='_'>
|
619
|
-
<title>Abstract</title>
|
620
|
-
<p id='_'>Text</p>
|
621
|
-
</abstract>
|
622
|
-
<foreword id='_' obligation='informative'>
|
623
|
-
<title>Foreword</title>
|
624
|
-
<p id='_'>Text</p>
|
625
|
-
</foreword>
|
626
|
-
<introduction id='_' obligation='informative'>
|
627
|
-
<title>Introduction</title>
|
628
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
629
|
-
<title>Introduction Subsection</title>
|
630
|
-
</clause>
|
631
|
-
</introduction>
|
632
|
-
<acknowledgements id='_' obligation='informative'>
|
633
|
-
<title>Acknowledgements</title>
|
634
|
-
</acknowledgements>
|
635
|
-
</preface>
|
636
|
-
<sections>
|
637
|
-
<terms id='_' obligation='normative'>
|
638
|
-
<title>Terms and definitions</title>
|
639
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
640
|
-
<term id='term-Term1'>
|
641
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
642
|
-
</term>
|
643
|
-
</terms>
|
644
|
-
<clause id='_' obligation='normative'>
|
645
|
-
<title>Terms, definitions and symbols</title>
|
646
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
647
|
-
<terms id='_' obligation='normative'>
|
648
|
-
<title>Normal Terms</title>
|
649
|
-
<term id='term-Term2'>
|
650
|
-
<preferred><expression><name>Term2</name></expression></preferred>
|
651
|
-
</term>
|
652
|
-
</terms>
|
653
|
-
<definitions id='_' obligation="normative" type="symbols">
|
654
|
-
<title>Symbols</title>
|
655
|
-
</definitions>
|
656
|
-
</clause>
|
657
|
-
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
658
|
-
<title>Abbreviated terms</title>
|
659
|
-
</definitions>
|
660
|
-
<clause id='_' inline-header='false' obligation='normative' type="ABC">
|
661
|
-
<title>Clause 4</title>
|
662
|
-
<clause id='_' inline-header='false' obligation='normative' type="DEF">
|
663
|
-
<title>Introduction</title>
|
664
|
-
</clause>
|
665
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
666
|
-
<title>Clause 4.2</title>
|
667
|
-
</clause>
|
668
|
-
</clause>
|
669
|
-
</sections>
|
670
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
671
|
-
<title>Annex</title>
|
672
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
673
|
-
<title>Annex A.1</title>
|
674
|
-
</clause>
|
675
|
-
</annex>
|
676
|
-
<bibliography>
|
677
|
-
<references id='_' obligation='informative' normative="true">
|
678
|
-
<title>Normative references</title>
|
679
|
-
<p id="_">There are no normative references in this document.</p>
|
680
|
-
</references>
|
681
|
-
<clause id='_' obligation='informative'>
|
682
|
-
<title>Bibliography</title>
|
683
|
-
<references id='_' obligation='informative' normative="false">
|
684
|
-
<title>Bibliography Subsection</title>
|
685
|
-
</references>
|
686
|
-
</clause>
|
687
|
-
</bibliography>
|
688
|
-
</standard-document>
|
689
|
-
OUTPUT
|
690
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
691
|
-
.to be_equivalent_to xmlpp(output)
|
692
|
-
end
|
693
|
-
|
694
|
-
it "tag and multilingual processing attributes on term" do
|
695
|
-
input = <<~INPUT
|
696
|
-
#{ASCIIDOC_BLANK_HDR}
|
697
|
-
[heading="terms, definitions, symbols and abbreviated terms"]
|
698
|
-
== Terms, Definitions, Symbols Section
|
699
|
-
|
700
|
-
[language=en,tag=x123,multilingual-rendering=all-columns]
|
701
|
-
=== Term
|
702
|
-
INPUT
|
703
|
-
output = <<~OUTPUT
|
704
|
-
#{BLANK_HDR}
|
705
|
-
<sections>
|
706
|
-
<terms id='_' obligation='normative'>
|
707
|
-
<title>Terms and definitions</title>
|
708
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
709
|
-
<term id='term-Term' language='en' tag='x123' multilingual-rendering='all-columns'>
|
710
|
-
<preferred>
|
711
|
-
<expression>
|
712
|
-
<name>Term</name>
|
713
|
-
</expression>
|
714
|
-
</preferred>
|
715
|
-
</term>
|
716
|
-
</terms>
|
717
|
-
</sections>
|
718
|
-
</standard-document>
|
719
|
-
OUTPUT
|
720
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
721
|
-
.to be_equivalent_to xmlpp(output)
|
722
|
-
end
|
723
|
-
|
724
|
-
it "varies terms & symbols title" do
|
725
|
-
input = <<~INPUT
|
726
|
-
#{ASCIIDOC_BLANK_HDR}
|
727
|
-
[heading="terms, definitions, symbols and abbreviated terms"]
|
728
|
-
== Terms, Definitions, Symbols Section
|
729
|
-
|
730
|
-
=== Term
|
731
|
-
|
732
|
-
=== Symbols
|
733
|
-
|
734
|
-
INPUT
|
735
|
-
output = <<~OUTPUT
|
736
|
-
#{BLANK_HDR}
|
737
|
-
<sections>
|
738
|
-
<terms id='_' obligation='normative'>
|
739
|
-
<title>Terms, definitions and symbols</title>
|
740
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
741
|
-
<term id='term-Term'>
|
742
|
-
<preferred><expression><name>Term</name></expression></preferred>
|
743
|
-
</term>
|
744
|
-
<definitions id='_' obligation="normative" type="symbols">
|
745
|
-
<title>Symbols</title>
|
746
|
-
</definitions>
|
747
|
-
</terms>
|
748
|
-
</sections>
|
749
|
-
</standard-document>
|
750
|
-
OUTPUT
|
751
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
752
|
-
.to be_equivalent_to xmlpp(output)
|
753
|
-
end
|
754
|
-
|
755
|
-
it "varies terms & abbreviated terms title" do
|
756
|
-
input = <<~INPUT
|
757
|
-
#{ASCIIDOC_BLANK_HDR}
|
758
|
-
[heading="terms, definitions, symbols and abbreviated terms"]
|
759
|
-
== Terms, Definitions, Abbreviated Terms Section
|
760
|
-
|
761
|
-
=== Term
|
762
|
-
|
763
|
-
[heading="abbreviated terms"]
|
764
|
-
=== Symbols
|
765
|
-
|
766
|
-
INPUT
|
767
|
-
output = <<~OUTPUT
|
768
|
-
#{BLANK_HDR}
|
769
|
-
<sections>
|
770
|
-
<terms id='_' obligation='normative'>
|
771
|
-
<title>Terms, definitions and abbreviated terms</title>
|
772
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
773
|
-
<term id='term-Term'>
|
774
|
-
<preferred><expression><name>Term</name></expression></preferred>
|
775
|
-
</term>
|
776
|
-
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
777
|
-
<title>Abbreviated terms</title>
|
778
|
-
</definitions>
|
779
|
-
</terms>
|
780
|
-
</sections>
|
781
|
-
</standard-document>
|
782
|
-
OUTPUT
|
783
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
784
|
-
.to be_equivalent_to xmlpp(output)
|
785
|
-
end
|
786
|
-
|
787
|
-
it "varies terms symbols & abbreviated terms title" do
|
788
|
-
input = <<~INPUT
|
789
|
-
#{ASCIIDOC_BLANK_HDR}
|
790
|
-
[heading="terms, definitions, symbols and abbreviated terms"]
|
791
|
-
== Terms, Definitions, Abbreviated Terms Section
|
792
|
-
|
793
|
-
=== Term
|
794
|
-
|
795
|
-
=== Abbreviated Terms
|
796
|
-
|
797
|
-
=== Symbols
|
798
|
-
|
799
|
-
INPUT
|
800
|
-
output = <<~OUTPUT
|
801
|
-
#{BLANK_HDR}
|
802
|
-
<sections>
|
803
|
-
<terms id='_' obligation='normative'>
|
804
|
-
<title>Terms, definitions, symbols and abbreviated terms</title>
|
805
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
806
|
-
<term id='term-Term'>
|
807
|
-
<preferred><expression><name>Term</name></expression></preferred>
|
808
|
-
</term>
|
809
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
810
|
-
<title>Abbreviated terms</title>
|
811
|
-
</definitions>
|
812
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
813
|
-
<title>Symbols</title>
|
814
|
-
</definitions>
|
815
|
-
</terms>
|
816
|
-
</sections>
|
817
|
-
</standard-document>
|
818
|
-
OUTPUT
|
819
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
820
|
-
.to be_equivalent_to xmlpp(output)
|
821
|
-
end
|
822
|
-
|
823
|
-
it "processes section obligations" do
|
824
|
-
input = <<~INPUT
|
825
|
-
#{ASCIIDOC_BLANK_HDR}
|
826
|
-
[obligation=informative]
|
827
|
-
== Clause 1
|
828
|
-
|
829
|
-
=== Clause 1a
|
830
|
-
|
831
|
-
[obligation=normative]
|
832
|
-
== Clause 2
|
833
|
-
|
834
|
-
[appendix,obligation=informative]
|
835
|
-
== Annex
|
836
|
-
INPUT
|
837
|
-
output = <<~OUTPUT
|
838
|
-
#{BLANK_HDR}
|
839
|
-
<sections><clause id="_" inline-header="false" obligation="informative">
|
840
|
-
<title>Clause 1</title>
|
841
|
-
<clause id="_" inline-header="false" obligation="informative">
|
842
|
-
<title>Clause 1a</title>
|
843
|
-
</clause>
|
844
|
-
</clause>
|
845
|
-
<clause id="_" inline-header="false" obligation="normative">
|
846
|
-
<title>Clause 2</title>
|
847
|
-
</clause>
|
848
|
-
</sections><annex id="_" inline-header="false" obligation="informative">
|
849
|
-
<title>Annex</title>
|
850
|
-
</annex>
|
851
|
-
</standard-document>
|
852
|
-
OUTPUT
|
853
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
854
|
-
.to be_equivalent_to xmlpp(output)
|
855
|
-
end
|
856
|
-
|
857
|
-
it "processes inline headers" do
|
858
|
-
input = <<~INPUT
|
859
|
-
#{ASCIIDOC_BLANK_HDR}
|
860
|
-
== Clause 1
|
861
|
-
|
862
|
-
[%inline-header]
|
863
|
-
=== Clause 1a
|
864
|
-
|
865
|
-
[appendix]
|
866
|
-
== Annex A
|
867
|
-
|
868
|
-
[%inline-header]
|
869
|
-
=== Clause Aa
|
870
|
-
INPUT
|
871
|
-
output = <<~OUTPUT
|
872
|
-
#{BLANK_HDR}
|
873
|
-
<sections><clause id="_" inline-header="false" obligation="normative">
|
874
|
-
<title>Clause 1</title>
|
875
|
-
<clause id="_" inline-header="true" obligation="normative">
|
876
|
-
<title>Clause 1a</title>
|
877
|
-
</clause>
|
878
|
-
</clause>
|
879
|
-
</sections><annex id="_" inline-header="false" obligation="normative">
|
880
|
-
<title>Annex A</title>
|
881
|
-
<clause id="_" inline-header="true" obligation="normative">
|
882
|
-
<title>Clause Aa</title>
|
883
|
-
</clause>
|
884
|
-
</annex>
|
885
|
-
</standard-document>
|
886
|
-
OUTPUT
|
887
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
888
|
-
.to be_equivalent_to xmlpp(output)
|
889
|
-
end
|
890
|
-
|
891
|
-
it "processes blank headers" do
|
892
|
-
input = <<~INPUT
|
893
|
-
#{ASCIIDOC_BLANK_HDR}
|
894
|
-
== Clause 1
|
895
|
-
|
896
|
-
=== {blank}
|
897
|
-
|
898
|
-
INPUT
|
899
|
-
output = <<~OUTPUT
|
900
|
-
#{BLANK_HDR}
|
901
|
-
<sections>
|
902
|
-
<clause id="_" inline-header="false" obligation="normative">
|
903
|
-
<title>Clause 1</title>
|
904
|
-
<clause id="_" inline-header="false" obligation="normative">
|
905
|
-
</clause>
|
906
|
-
</clause>
|
907
|
-
</sections>
|
908
|
-
</standard-document>
|
909
|
-
OUTPUT
|
910
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
911
|
-
.to be_equivalent_to xmlpp(output)
|
912
|
-
end
|
913
|
-
|
914
|
-
it "processes terminal nodes in terms with term subsection names" do
|
915
|
-
input = <<~INPUT
|
916
|
-
#{ASCIIDOC_BLANK_HDR}
|
917
|
-
|
918
|
-
== Terms, definitions, symbols and abbreviated terms
|
919
|
-
|
920
|
-
=== Terms and definitions
|
921
|
-
|
922
|
-
=== Symbols
|
923
|
-
|
924
|
-
INPUT
|
925
|
-
output = <<~OUTPUT
|
926
|
-
#{BLANK_HDR}
|
927
|
-
<sections>
|
928
|
-
<terms id='_' obligation='normative'>
|
929
|
-
<title>Terms, definitions and symbols</title>
|
930
|
-
<p id='_'>No terms and definitions are listed in this document.</p>
|
931
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
932
|
-
<title>Terms and definitions</title>
|
933
|
-
</clause>
|
934
|
-
<definitions id='_' obligation="normative" type="symbols">
|
935
|
-
<title>Symbols</title>
|
936
|
-
</definitions>
|
937
|
-
</terms>
|
938
|
-
</sections>
|
939
|
-
</standard-document>
|
940
|
-
OUTPUT
|
941
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
942
|
-
.to be_equivalent_to xmlpp(output)
|
943
|
-
end
|
944
|
-
|
945
|
-
it "processes terms & definitions with external source" do
|
946
|
-
input = <<~INPUT
|
947
|
-
#{ASCIIDOC_BLANK_HDR}
|
948
|
-
|
949
|
-
Foreword
|
950
|
-
|
951
|
-
[source="iso1234,iso5678"]
|
952
|
-
== Terms and Definitions
|
953
|
-
|
954
|
-
=== Term1
|
955
|
-
|
956
|
-
INPUT
|
957
|
-
output = <<~OUTPUT
|
958
|
-
#{BLANK_HDR}
|
959
|
-
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
960
|
-
<preface><foreword id='_' obligation="informative">
|
961
|
-
<title>Foreword</title>
|
962
|
-
<p id="_">Foreword</p>
|
963
|
-
</foreword></preface><sections>
|
964
|
-
<terms id="_" obligation="normative">
|
965
|
-
<title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
|
966
|
-
given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
|
967
|
-
<term id="term-Term1">
|
968
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
969
|
-
</term>
|
970
|
-
</terms></sections>
|
971
|
-
</standard-document>
|
972
|
-
OUTPUT
|
973
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
974
|
-
.to be_equivalent_to xmlpp(output)
|
975
|
-
end
|
976
|
-
|
977
|
-
it "processes empty terms & definitions" do
|
978
|
-
input = <<~INPUT
|
979
|
-
#{ASCIIDOC_BLANK_HDR}
|
980
|
-
|
981
|
-
Foreword
|
982
|
-
|
983
|
-
== Terms and Definitions
|
984
|
-
|
985
|
-
|
986
|
-
INPUT
|
987
|
-
output = <<~OUTPUT
|
988
|
-
#{BLANK_HDR}
|
989
|
-
<preface><foreword id='_' obligation="informative">
|
990
|
-
<title>Foreword</title>
|
991
|
-
<p id="_">Foreword</p>
|
992
|
-
</foreword></preface><sections>
|
993
|
-
<terms id="_" obligation="normative">
|
994
|
-
<title>Terms and definitions</title><p id="_">No terms and definitions are listed in this document.</p>
|
995
|
-
</terms></sections>
|
996
|
-
</standard-document>
|
997
|
-
|
998
|
-
OUTPUT
|
999
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1000
|
-
.to be_equivalent_to xmlpp(output)
|
1001
|
-
end
|
1002
|
-
|
1003
|
-
it "processes empty terms & definitions with external source" do
|
1004
|
-
input = <<~INPUT
|
1005
|
-
#{ASCIIDOC_BLANK_HDR}
|
1006
|
-
|
1007
|
-
Foreword
|
1008
|
-
|
1009
|
-
[source="iso1234,iso5678"]
|
1010
|
-
== Terms and Definitions
|
1011
|
-
|
1012
|
-
INPUT
|
1013
|
-
output = <<~OUTPUT
|
1014
|
-
#{BLANK_HDR}
|
1015
|
-
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
1016
|
-
<preface><foreword id='_' obligation="informative">
|
1017
|
-
<title>Foreword</title>
|
1018
|
-
<p id="_">Foreword</p>
|
1019
|
-
</foreword></preface><sections>
|
1020
|
-
<terms id="_" obligation="normative">
|
1021
|
-
<title>Terms and definitions</title>
|
1022
|
-
<p id="_">For the purposes of this document,
|
1023
|
-
the terms and definitions given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> apply.</p>
|
1024
|
-
</terms></sections>
|
1025
|
-
</standard-document>
|
1026
|
-
OUTPUT
|
1027
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1028
|
-
.to be_equivalent_to xmlpp(output)
|
1029
|
-
end
|
1030
|
-
|
1031
|
-
it "processes term document sources in French" do
|
1032
|
-
input = <<~INPUT
|
1033
|
-
= Document title
|
1034
|
-
Author
|
1035
|
-
:docfile: test.adoc
|
1036
|
-
:nodoc:
|
1037
|
-
:novalid:
|
1038
|
-
:no-isobib:
|
1039
|
-
:language: fr
|
1040
|
-
|
1041
|
-
Foreword
|
1042
|
-
|
1043
|
-
[source="iso1234,iso5678"]
|
1044
|
-
== Terms and Definitions
|
1045
|
-
|
1046
|
-
INPUT
|
1047
|
-
output = <<~OUTPUT
|
1048
|
-
#{BLANK_HDR.sub(%r{<language>en</language>}, '<language>fr</language>')}
|
1049
|
-
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
1050
|
-
<preface><foreword id='_' obligation="informative">
|
1051
|
-
<title>Avant-propos</title>
|
1052
|
-
<p id="_">Foreword</p>
|
1053
|
-
</foreword></preface><sections>
|
1054
|
-
<terms id="_" obligation="normative">
|
1055
|
-
<title>Terms et définitions</title>
|
1056
|
-
<p id="_">Pour les besoins du présent document, les termes et définitions de <eref bibitemid="iso1234"/> et <eref bibitemid="iso5678"/> s’appliquent.</p>
|
1057
|
-
</terms></sections>
|
1058
|
-
</standard-document>
|
1059
|
-
OUTPUT
|
1060
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1061
|
-
.to be_equivalent_to xmlpp(output)
|
1062
|
-
end
|
1063
|
-
|
1064
|
-
it "processes term document sources in Chinese" do
|
1065
|
-
input = <<~INPUT
|
1066
|
-
= Document title
|
1067
|
-
Author
|
1068
|
-
:docfile: test.adoc
|
1069
|
-
:nodoc:
|
1070
|
-
:novalid:
|
1071
|
-
:no-isobib:
|
1072
|
-
:language: zh
|
1073
|
-
:script: Hans
|
1074
|
-
|
1075
|
-
Foreword
|
1076
|
-
|
1077
|
-
[source="iso1234,iso5678"]
|
1078
|
-
== Terms and Definitions
|
1079
|
-
|
1080
|
-
INPUT
|
1081
|
-
output = <<~OUTPUT
|
1082
|
-
#{BLANK_HDR.sub(%r{<language>en</language>}, '<language>zh</language>').sub(%r{<script>Latn</script>}, '<script>Hans</script>')}
|
1083
|
-
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><preface><foreword id='_' obligation="informative">
|
1084
|
-
<title>前言</title>
|
1085
|
-
<p id="_">Foreword</p>
|
1086
|
-
</foreword></preface><sections>
|
1087
|
-
<terms id="_" obligation="normative">
|
1088
|
-
<title>术语和定义</title><p id="_"><eref bibitemid="iso1234"/>和<eref bibitemid="iso5678"/>界定的术语和定义适用于本文件。</p>
|
1089
|
-
</terms></sections>
|
1090
|
-
</standard-document>
|
1091
|
-
OUTPUT
|
1092
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1093
|
-
.to be_equivalent_to xmlpp(output)
|
1094
|
-
end
|
1095
|
-
|
1096
|
-
it "warn about external source for terms & definitions that does not point anywhere" do
|
1097
|
-
input = <<~INPUT
|
1098
|
-
#{ASCIIDOC_BLANK_HDR}
|
1099
|
-
|
1100
|
-
[source="iso712"]
|
1101
|
-
== Terms and Definitions
|
1102
|
-
=== Term2
|
1103
|
-
INPUT
|
1104
|
-
expect { Asciidoctor.convert(input, *OPTIONS) }
|
1105
|
-
.to output(/not referenced/).to_stderr
|
1106
|
-
end
|
1107
|
-
|
1108
|
-
it "treats terminal terms subclause named as terms clause as a normal clause" do
|
1109
|
-
input = <<~INPUT
|
1110
|
-
#{ASCIIDOC_BLANK_HDR}
|
1111
|
-
[[tda]]
|
1112
|
-
== Terms, definitions, symbols and abbreviations
|
1113
|
-
|
1114
|
-
[[terms]]
|
1115
|
-
=== Terms and definitions
|
1116
|
-
|
1117
|
-
=== Symbols
|
1118
|
-
|
1119
|
-
INPUT
|
1120
|
-
output = <<~OUTPUT
|
1121
|
-
#{BLANK_HDR}
|
1122
|
-
<sections>
|
1123
|
-
<terms id='tda' obligation='normative'>
|
1124
|
-
<title>Terms, definitions and symbols</title>
|
1125
|
-
<p id='_'>No terms and definitions are listed in this document.</p>
|
1126
|
-
<clause id='terms' inline-header='false' obligation='normative'>
|
1127
|
-
<title>Terms and definitions</title>
|
1128
|
-
</clause>
|
1129
|
-
<definitions id='_' obligation="normative" type="symbols">
|
1130
|
-
<title>Symbols</title>
|
1131
|
-
</definitions>
|
1132
|
-
</terms>
|
1133
|
-
</sections>
|
1134
|
-
</standard-document>
|
1135
|
-
OUTPUT
|
1136
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1137
|
-
.to be_equivalent_to xmlpp(output)
|
1138
|
-
end
|
1139
|
-
|
1140
|
-
it "treats non-terminal terms subclause named as terms clause as a terms clause" do
|
1141
|
-
input = <<~INPUT
|
1142
|
-
#{ASCIIDOC_BLANK_HDR}
|
1143
|
-
== Scope
|
1144
|
-
|
1145
|
-
[[tda]]
|
1146
|
-
== Terms, definitions, symbols and abbreviations
|
1147
|
-
|
1148
|
-
[[terms]]
|
1149
|
-
=== Terms and definitions
|
1150
|
-
|
1151
|
-
[[terms-concepts]]
|
1152
|
-
==== Basic concepts
|
1153
|
-
|
1154
|
-
[[term-date]]
|
1155
|
-
===== date
|
1156
|
-
|
1157
|
-
_time_ (<<term-time>>) on the _calendar_ (<<term-calendar>>) _time scale_ (<<term-time-scale>>)
|
1158
|
-
|
1159
|
-
INPUT
|
1160
|
-
output = <<~OUTPUT
|
1161
|
-
#{BLANK_HDR}
|
1162
|
-
<sections>
|
1163
|
-
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
1164
|
-
<title>Scope</title>
|
1165
|
-
</clause>
|
1166
|
-
<clause id='tda' obligation='normative'>
|
1167
|
-
<title>Terms and definitions</title>
|
1168
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1169
|
-
<clause id='terms' obligation='normative'>
|
1170
|
-
<title>Terms and definitions</title>
|
1171
|
-
<terms id='terms-concepts' obligation='normative'>
|
1172
|
-
<title>Basic concepts</title>
|
1173
|
-
<term id='term-date'>
|
1174
|
-
<preferred><expression><name>date</name></expression></preferred>
|
1175
|
-
<definition><verbal-definition>
|
1176
|
-
<p id='_'>
|
1177
|
-
<em>time</em>
|
1178
|
-
(
|
1179
|
-
<xref target='term-time'/>
|
1180
|
-
) on the
|
1181
|
-
<em>calendar</em>
|
1182
|
-
(
|
1183
|
-
<xref target='term-calendar'/>
|
1184
|
-
)
|
1185
|
-
<em>time scale</em>
|
1186
|
-
(
|
1187
|
-
<xref target='term-time-scale'/>
|
1188
|
-
)
|
1189
|
-
</p>
|
1190
|
-
</verbal-definition></definition>
|
1191
|
-
</term>
|
1192
|
-
</terms>
|
1193
|
-
</clause>
|
1194
|
-
</clause>
|
1195
|
-
</sections>
|
1196
|
-
</standard-document>
|
1197
|
-
OUTPUT
|
1198
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1199
|
-
.to be_equivalent_to xmlpp(output)
|
1200
|
-
end
|
1201
|
-
|
1202
|
-
it "leaves alone special titles in preface or appendix" do
|
1203
|
-
input = <<~INPUT
|
1204
|
-
#{ASCIIDOC_BLANK_HDR}
|
1205
|
-
|
1206
|
-
[.preface]
|
1207
|
-
[[t1]]
|
1208
|
-
== Terms and definitions
|
1209
|
-
|
1210
|
-
[[t2]]
|
1211
|
-
=== Term1
|
1212
|
-
|
1213
|
-
[appendix,language=fr]
|
1214
|
-
[[sym]]
|
1215
|
-
== Symbols and abbreviated terms
|
1216
|
-
|
1217
|
-
[.appendix]
|
1218
|
-
[[app]]
|
1219
|
-
[bibliography]
|
1220
|
-
== Normative Reference
|
1221
|
-
INPUT
|
1222
|
-
output = <<~OUTPUT
|
1223
|
-
#{BLANK_HDR}
|
1224
|
-
<preface>
|
1225
|
-
<terms id='t1' obligation='normative'>
|
1226
|
-
<title>Terms and definitions</title>
|
1227
|
-
<term id='t2'>
|
1228
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
1229
|
-
</term>
|
1230
|
-
</terms>
|
1231
|
-
</preface>
|
1232
|
-
<sections> </sections>
|
1233
|
-
<annex id='_' obligation='' language='fr' script=''>
|
1234
|
-
<definitions id='sym' language='fr' obligation="normative">
|
1235
|
-
<title>Symbols and abbreviated terms</title>
|
1236
|
-
</definitions>
|
1237
|
-
</annex>
|
1238
|
-
<annex id='_' obligation='' language='' script=''>
|
1239
|
-
<references id='app' obligation='informative' normative="false">
|
1240
|
-
<title>Normative Reference</title>
|
1241
|
-
</references>
|
1242
|
-
</annex>
|
1243
|
-
</standard-document>
|
1244
|
-
OUTPUT
|
1245
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1246
|
-
.to be_equivalent_to xmlpp(output)
|
1247
|
-
end
|
1248
|
-
|
1249
|
-
it "recognises special titles despite following indexterms" do
|
1250
|
-
input = <<~INPUT
|
1251
|
-
#{ASCIIDOC_BLANK_HDR}
|
1252
|
-
|
1253
|
-
== Scope (((indexterm)))
|
1254
|
-
INPUT
|
1255
|
-
output = <<~OUTPUT
|
1256
|
-
#{BLANK_HDR}
|
1257
|
-
<sections>
|
1258
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
1259
|
-
<title>Scope</title>
|
1260
|
-
</clause>
|
1261
|
-
</sections>
|
1262
|
-
</standard-document>
|
1263
|
-
OUTPUT
|
1264
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1265
|
-
.to be_equivalent_to xmlpp(output)
|
1266
|
-
end
|
1267
|
-
|
1268
|
-
it "handles floating titles" do
|
1269
|
-
input = <<~INPUT
|
1270
|
-
#{ASCIIDOC_BLANK_HDR}
|
1271
|
-
|
1272
|
-
ABC
|
1273
|
-
|
1274
|
-
[discrete]
|
1275
|
-
== I am a top-level _floating_ title
|
1276
|
-
|
1277
|
-
== Clause 1
|
1278
|
-
|
1279
|
-
[discrete]
|
1280
|
-
=== I am a _floating_ title
|
1281
|
-
|
1282
|
-
=== Clause 1.2
|
1283
|
-
|
1284
|
-
[discrete]
|
1285
|
-
== Another top-level floating title
|
1286
|
-
|
1287
|
-
== Clause 2
|
1288
|
-
|
1289
|
-
INPUT
|
1290
|
-
output = <<~OUTPUT
|
1291
|
-
#{BLANK_HDR}
|
1292
|
-
<preface>
|
1293
|
-
<foreword id='_' obligation='informative'>
|
1294
|
-
<title>Foreword</title>
|
1295
|
-
<p id='_'>ABC</p>
|
1296
|
-
</foreword>
|
1297
|
-
</preface>
|
1298
|
-
<sections>
|
1299
|
-
<floating-title id='_' depth='1' type='floating-title'>
|
1300
|
-
I am a top-level
|
1301
|
-
<em>floating</em>
|
1302
|
-
title
|
1303
|
-
</floating-title>
|
1304
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1305
|
-
<title>Clause 1</title>
|
1306
|
-
<floating-title id='_' depth='2' type='floating-title'>
|
1307
|
-
I am a
|
1308
|
-
<em>floating</em>
|
1309
|
-
title
|
1310
|
-
</floating-title>
|
1311
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1312
|
-
<title>Clause 1.2</title>
|
1313
|
-
</clause>
|
1314
|
-
</clause>
|
1315
|
-
<floating-title id='_' depth='1' type='floating-title'>Another top-level floating title</floating-title>
|
1316
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1317
|
-
<title>Clause 2</title>
|
1318
|
-
</clause>
|
1319
|
-
</sections>
|
1320
|
-
</standard-document>
|
1321
|
-
OUTPUT
|
1322
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1323
|
-
.to be_equivalent_to xmlpp(output)
|
1324
|
-
end
|
1325
|
-
end
|