metanorma-iso 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +12 -12
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/isodoc.rng +19 -1
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +6 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +445 -454
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +813 -704
- data/spec/asciidoctor-iso/inline_spec.rb +116 -91
- data/spec/asciidoctor-iso/lists_spec.rb +128 -121
- data/spec/asciidoctor-iso/refs_spec.rb +308 -250
- data/spec/asciidoctor-iso/section_spec.rb +273 -242
- data/spec/asciidoctor-iso/table_spec.rb +258 -242
- data/spec/asciidoctor-iso/validate_spec.rb +1099 -1165
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +833 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +608 -525
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +176 -193
- metadata +2 -4
- data/.rubocop.ribose.yml +0 -66
- data/spec/assets/xref_error.adoc +0 -7
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::ISO do
|
4
4
|
it "processes sections" do
|
5
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
== Foreword
|
8
8
|
|
@@ -56,107 +56,119 @@ RSpec.describe Asciidoctor::ISO do
|
|
56
56
|
|
57
57
|
=== Bibliography Subsection
|
58
58
|
INPUT
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
</
|
70
|
-
</
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
<
|
83
|
-
<
|
84
|
-
|
85
|
-
<li>
|
86
|
-
<
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
<
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
<
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
</
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
59
|
+
#{BLANK_HDR}
|
60
|
+
<preface>
|
61
|
+
<foreword id="_" obligation="informative">
|
62
|
+
<title>Foreword</title>
|
63
|
+
<p id="_">Text</p>
|
64
|
+
</foreword>
|
65
|
+
<introduction id="_" obligation="informative">
|
66
|
+
<title>Introduction</title>
|
67
|
+
<clause id="_" inline-header="false" obligation="informative">
|
68
|
+
<title>Introduction Subsection</title>
|
69
|
+
</clause>
|
70
|
+
</introduction>
|
71
|
+
<acknowledgements id="_" obligation="informative">
|
72
|
+
<title>Acknowledgements</title>
|
73
|
+
</acknowledgements>
|
74
|
+
</preface>
|
75
|
+
<sections>
|
76
|
+
<clause id="_" inline-header="false" obligation="normative" type="scope">
|
77
|
+
<title>Scope</title>
|
78
|
+
<p id="_">Text</p>
|
79
|
+
</clause>
|
80
|
+
<terms id="_" obligation="normative">
|
81
|
+
<title>Terms and definitions</title>
|
82
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
83
|
+
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
84
|
+
<ul id="_">
|
85
|
+
<li>
|
86
|
+
<p id="_">ISO Online browsing platform: available at
|
87
|
+
|
88
|
+
<link target="http://www.iso.org/obp"/></p>
|
89
|
+
</li>
|
90
|
+
<li>
|
91
|
+
<p id="_">IEC Electropedia: available at
|
92
|
+
|
93
|
+
<link target="http://www.electropedia.org"/></p>
|
94
|
+
</li>
|
95
|
+
</ul>
|
96
|
+
<term id="term-term1">
|
97
|
+
<preferred>Term1</preferred>
|
98
|
+
</term>
|
99
|
+
</terms>
|
100
|
+
<clause id="_" obligation="normative">
|
101
|
+
<title>Terms, definitions, symbols and abbreviated terms</title>
|
102
|
+
<terms id="_" obligation="normative">
|
103
|
+
<title>Normal Terms</title>
|
104
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
105
|
+
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
106
|
+
<ul id="_">
|
107
|
+
<li>
|
108
|
+
<p id="_">ISO Online browsing platform: available at
|
109
|
+
|
110
|
+
<link target="http://www.iso.org/obp"/></p>
|
111
|
+
</li>
|
112
|
+
<li>
|
113
|
+
<p id="_">IEC Electropedia: available at
|
114
|
+
|
115
|
+
<link target="http://www.electropedia.org"/></p>
|
116
|
+
</li>
|
117
|
+
</ul>
|
118
|
+
<term id="term-term2">
|
119
|
+
<preferred>Term2</preferred>
|
120
|
+
</term>
|
121
|
+
</terms>
|
122
|
+
<definitions id="_" obligation="normative">
|
123
|
+
<title>Symbols and abbreviated terms</title>
|
124
|
+
</definitions>
|
125
|
+
</clause>
|
126
|
+
<definitions id="_" obligation="normative">
|
127
|
+
<title>Symbols and abbreviated terms</title>
|
128
|
+
</definitions>
|
129
|
+
<clause id="_" inline-header="false" obligation="normative">
|
130
|
+
<title>Clause 4</title>
|
131
|
+
<clause id="_" inline-header="false" obligation="normative">
|
132
|
+
<title>Introduction</title>
|
133
|
+
</clause>
|
134
|
+
<clause id="_" inline-header="false" obligation="normative">
|
135
|
+
<title>Clause 4.2</title>
|
136
|
+
</clause>
|
137
|
+
</clause>
|
138
|
+
<clause id="_" inline-header="false" obligation="normative">
|
139
|
+
<title>Terms and Definitions</title>
|
140
|
+
</clause>
|
141
|
+
</sections>
|
142
|
+
<annex id="_" inline-header="false" obligation="normative">
|
143
|
+
<title>Annex</title>
|
144
|
+
<clause id="_" inline-header="false" obligation="normative">
|
145
|
+
<title>Annex A.1</title>
|
146
|
+
</clause>
|
147
|
+
<appendix id="_" inline-header="false" obligation="normative">
|
148
|
+
<title>Appendix 1</title>
|
149
|
+
<clause id="_" inline-header="false" obligation="normative">
|
150
|
+
<title>Appendix subclause</title>
|
151
|
+
</clause>
|
152
|
+
</appendix>
|
153
|
+
</annex>
|
154
|
+
<bibliography>
|
155
|
+
<references id="_" normative="true" obligation="informative">
|
156
|
+
<title>Normative references</title>
|
157
|
+
<p id="_">There are no normative references in this document.</p>
|
158
|
+
</references>
|
159
|
+
<clause id="_" obligation="informative">
|
160
|
+
<title>Bibliography</title>
|
161
|
+
<references id="_" normative="false" obligation="informative">
|
162
|
+
<title>Bibliography Subsection</title>
|
163
|
+
</references>
|
164
|
+
</clause>
|
165
|
+
</bibliography>
|
166
|
+
</iso-standard>
|
155
167
|
OUTPUT
|
156
168
|
end
|
157
169
|
|
158
170
|
it "processes section obligations" do
|
159
|
-
|
171
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
160
172
|
#{ASCIIDOC_BLANK_HDR}
|
161
173
|
[obligation=informative]
|
162
174
|
== Clause 1
|
@@ -168,26 +180,28 @@ standardization at the following addresses:</p>
|
|
168
180
|
|
169
181
|
[appendix,obligation=informative]
|
170
182
|
== Annex
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
183
|
+
INPUT
|
184
|
+
#{BLANK_HDR}
|
185
|
+
<sections>
|
186
|
+
<clause id="_" inline-header="false" obligation="informative">
|
187
|
+
<title>Clause 1</title>
|
188
|
+
<clause id="_" inline-header="false" obligation="informative">
|
189
|
+
<title>Clause 1a</title>
|
190
|
+
</clause>
|
191
|
+
</clause>
|
192
|
+
<clause id="_" inline-header="false" obligation="normative">
|
193
|
+
<title>Clause 2</title>
|
194
|
+
</clause>
|
195
|
+
</sections>
|
196
|
+
<annex id="_" inline-header="false" obligation="informative">
|
197
|
+
<title>Annex</title>
|
198
|
+
</annex>
|
199
|
+
</iso-standard>
|
200
|
+
OUTPUT
|
187
201
|
end
|
188
202
|
|
189
|
-
|
190
|
-
|
203
|
+
it "processes inline headers" do
|
204
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
191
205
|
#{ASCIIDOC_BLANK_HDR}
|
192
206
|
== Clause 1
|
193
207
|
|
@@ -199,46 +213,47 @@ standardization at the following addresses:</p>
|
|
199
213
|
|
200
214
|
[%inline-header]
|
201
215
|
=== Clause Aa
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
216
|
+
INPUT
|
217
|
+
#{BLANK_HDR}
|
218
|
+
<sections>
|
219
|
+
<clause id="_" inline-header="false" obligation="normative">
|
220
|
+
<title>Clause 1</title>
|
221
|
+
<clause id="_" inline-header="true" obligation="normative">
|
222
|
+
<title>Clause 1a</title>
|
223
|
+
</clause>
|
224
|
+
</clause>
|
225
|
+
</sections>
|
226
|
+
<annex id="_" inline-header="false" obligation="normative">
|
227
|
+
<title>Annex A</title>
|
228
|
+
<clause id="_" inline-header="true" obligation="normative">
|
229
|
+
<title>Clause Aa</title>
|
230
|
+
</clause>
|
231
|
+
</annex>
|
232
|
+
</iso-standard>
|
233
|
+
OUTPUT
|
234
|
+
end
|
219
235
|
|
220
236
|
it "processes blank headers" do
|
221
|
-
|
237
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
222
238
|
#{ASCIIDOC_BLANK_HDR}
|
223
239
|
== Clause 1
|
224
240
|
|
225
241
|
=== {blank}
|
226
242
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
OUTPUT
|
243
|
+
INPUT
|
244
|
+
#{BLANK_HDR}
|
245
|
+
<sections>
|
246
|
+
<clause id="_" inline-header="false" obligation="normative">
|
247
|
+
<title>Clause 1</title>
|
248
|
+
<clause id="_" inline-header="false" obligation="normative"/>
|
249
|
+
</clause>
|
250
|
+
</sections>
|
251
|
+
</iso-standard>
|
252
|
+
OUTPUT
|
238
253
|
end
|
239
254
|
|
240
|
-
|
241
|
-
|
255
|
+
it "processes terms & definitions with external source" do
|
256
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
242
257
|
#{ASCIIDOC_BLANK_HDR}
|
243
258
|
|
244
259
|
Foreword
|
@@ -248,36 +263,46 @@ standardization at the following addresses:</p>
|
|
248
263
|
|
249
264
|
=== Term1
|
250
265
|
|
251
|
-
|
252
|
-
|
253
|
-
<preface
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
<
|
264
|
-
|
265
|
-
|
266
|
-
<
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
266
|
+
INPUT
|
267
|
+
#{BLANK_HDR.sub(/<boilerplate>/, '<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><boilerplate>')}
|
268
|
+
<preface>
|
269
|
+
<foreword id="_" obligation="informative">
|
270
|
+
<title>Foreword</title>
|
271
|
+
<p id="_">Foreword</p>
|
272
|
+
</foreword>
|
273
|
+
</preface>
|
274
|
+
<sections>
|
275
|
+
<terms id="_" obligation="normative">
|
276
|
+
<title>Terms and definitions</title>
|
277
|
+
<p id="_">For the purposes of this document, the terms and definitions
|
278
|
+
given in <eref bibitemid="iso1234"/>
|
279
|
+
and <eref bibitemid="iso5678"/>
|
280
|
+
and the following apply.</p>
|
281
|
+
<p id="_">ISO and IEC maintain terminological databases for use in
|
282
|
+
standardization at the following addresses:</p>
|
283
|
+
<ul id="_">
|
284
|
+
<li>
|
285
|
+
<p id="_">ISO Online browsing platform: available at
|
286
|
+
|
287
|
+
<link target="http://www.iso.org/obp"/></p>
|
288
|
+
</li>
|
289
|
+
<li>
|
290
|
+
<p id="_">IEC Electropedia: available at
|
291
|
+
|
292
|
+
<link target="http://www.electropedia.org"/></p>
|
293
|
+
</li>
|
294
|
+
</ul>
|
295
|
+
<term id="term-term1">
|
296
|
+
<preferred>Term1</preferred>
|
297
|
+
</term>
|
298
|
+
</terms>
|
299
|
+
</sections>
|
300
|
+
</iso-standard>
|
301
|
+
OUTPUT
|
302
|
+
end
|
303
|
+
|
304
|
+
it "processes empty terms & definitions" do
|
305
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
281
306
|
#{ASCIIDOC_BLANK_HDR}
|
282
307
|
|
283
308
|
Foreword
|
@@ -285,45 +310,45 @@ standardization at the following addresses:</p>
|
|
285
310
|
== Terms and Definitions
|
286
311
|
|
287
312
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
313
|
+
INPUT
|
314
|
+
#{BLANK_HDR}
|
315
|
+
<preface>
|
316
|
+
<foreword id="_" obligation="informative">
|
317
|
+
<title>Foreword</title>
|
318
|
+
<p id="_">Foreword</p>
|
319
|
+
</foreword>
|
320
|
+
</preface>
|
321
|
+
<sections>
|
322
|
+
<terms id='_' obligation='normative'>
|
323
|
+
<title>Terms and definitions</title>
|
324
|
+
<p id='_'>No terms and definitions are listed in this document.</p>
|
325
|
+
<p id='_'>
|
326
|
+
ISO and IEC maintain terminological databases for use in standardization
|
327
|
+
at the following addresses:
|
328
|
+
</p>
|
329
|
+
<ul id='_'>
|
330
|
+
<li>
|
331
|
+
<p id='_'>
|
332
|
+
ISO Online browsing platform: available at
|
333
|
+
<link target='http://www.iso.org/obp'/>
|
334
|
+
</p>
|
335
|
+
</li>
|
336
|
+
<li>
|
337
|
+
<p id='_'>
|
338
|
+
IEC Electropedia: available at
|
339
|
+
<link target='http://www.electropedia.org'/>
|
340
|
+
</p>
|
341
|
+
</li>
|
342
|
+
</ul>
|
343
|
+
</terms>
|
344
|
+
</sections>
|
345
|
+
</iso-standard>
|
321
346
|
|
322
|
-
|
323
|
-
|
347
|
+
OUTPUT
|
348
|
+
end
|
324
349
|
|
325
|
-
|
326
|
-
|
350
|
+
it "processes empty terms & definitions with external source" do
|
351
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
327
352
|
#{ASCIIDOC_BLANK_HDR}
|
328
353
|
|
329
354
|
Foreword
|
@@ -331,32 +356,38 @@ standardization at the following addresses:</p>
|
|
331
356
|
[source="iso1234,iso5678"]
|
332
357
|
== Terms and Definitions
|
333
358
|
|
334
|
-
|
335
|
-
|
336
|
-
<preface
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
<
|
348
|
-
|
349
|
-
|
350
|
-
<
|
351
|
-
<
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
359
|
+
INPUT
|
360
|
+
#{BLANK_HDR.sub(/<boilerplate>/, '<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><boilerplate>')}
|
361
|
+
<preface>
|
362
|
+
<foreword id="_" obligation="informative">
|
363
|
+
<title>Foreword</title>
|
364
|
+
<p id="_">Foreword</p>
|
365
|
+
</foreword>
|
366
|
+
</preface>
|
367
|
+
<sections>
|
368
|
+
<terms id="_" obligation="normative">
|
369
|
+
<title>Terms and definitions</title>
|
370
|
+
<p id="_">For the purposes of this document,
|
371
|
+
the terms and definitions given in <eref bibitemid="iso1234"/>
|
372
|
+
and <eref bibitemid="iso5678"/>
|
373
|
+
apply.
|
374
|
+
</p>
|
375
|
+
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
376
|
+
<ul id="_">
|
377
|
+
<li>
|
378
|
+
<p id="_">ISO Online browsing platform: available at
|
379
|
+
|
380
|
+
<link target="http://www.iso.org/obp"/></p>
|
381
|
+
</li>
|
382
|
+
<li>
|
383
|
+
<p id="_">IEC Electropedia: available at
|
384
|
+
|
385
|
+
<link target="http://www.electropedia.org"/></p>
|
386
|
+
</li>
|
387
|
+
</ul>
|
388
|
+
</terms>
|
389
|
+
</sections>
|
390
|
+
</iso-standard>
|
391
|
+
OUTPUT
|
392
|
+
end
|
362
393
|
end
|