metanorma-iec 1.3.0 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/iec/biblio.rng +1 -0
- data/lib/asciidoctor/iec/front.rb +11 -5
- data/lib/asciidoctor/iec/iec.rng +4 -0
- data/lib/asciidoctor/iec/iec_intro_en.xml +1 -1
- data/lib/asciidoctor/iec/isodoc.rng +191 -3
- data/lib/asciidoctor/iec/isostandard.rng +12 -0
- data/lib/isodoc/iec/base_convert.rb +20 -14
- data/lib/isodoc/iec/html_convert.rb +6 -6
- data/lib/isodoc/iec/iec.international-standard.xsl +533 -67
- data/lib/isodoc/iec/metadata.rb +1 -1
- data/lib/isodoc/iec/pdf_convert.rb +1 -1
- data/lib/isodoc/iec/presentation_xml_convert.rb +17 -17
- data/lib/isodoc/iec/word_convert.rb +69 -19
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- data/spec/asciidoctor/base_spec.rb +818 -801
- data/spec/asciidoctor/blocks_spec.rb +212 -154
- data/spec/asciidoctor/section_spec.rb +0 -38
- data/spec/isodoc/blocks_spec.rb +2 -2
- data/spec/isodoc/i18n_spec.rb +346 -432
- data/spec/isodoc/iev_spec.rb +508 -519
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/ref_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +334 -339
- data/spec/isodoc/terms_spec.rb +1 -1
- metadata +3 -3
@@ -2,11 +2,11 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Iec do
|
4
4
|
before(:all) do
|
5
|
-
|
6
|
-
end
|
5
|
+
@blank_hdr = blank_hdr_gen
|
6
|
+
end
|
7
7
|
|
8
8
|
it "processes open blocks" do
|
9
|
-
|
9
|
+
input = <<~INPUT
|
10
10
|
#{ASCIIDOC_BLANK_HDR}
|
11
11
|
--
|
12
12
|
x
|
@@ -16,21 +16,24 @@ end
|
|
16
16
|
z
|
17
17
|
--
|
18
18
|
INPUT
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
output = <<~OUTPUT
|
20
|
+
#{@blank_hdr}
|
21
|
+
<sections><p id="_">x</p>
|
22
|
+
<p id="_">y</p>
|
23
|
+
<p id="_">z</p></sections>
|
24
|
+
</iec-standard>
|
24
25
|
OUTPUT
|
26
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
27
|
+
.to be_equivalent_to xmlpp(output)
|
25
28
|
end
|
26
29
|
|
27
30
|
it "processes stem blocks" do
|
28
|
-
|
31
|
+
input = <<~INPUT
|
29
32
|
#{ASCIIDOC_BLANK_HDR}
|
30
33
|
[stem]
|
31
34
|
++++
|
32
|
-
r = 1
|
33
|
-
r = 1
|
35
|
+
r = 1 %#{' '}
|
36
|
+
r = 1 %#{' '}
|
34
37
|
++++
|
35
38
|
|
36
39
|
[stem]
|
@@ -38,22 +41,25 @@ end
|
|
38
41
|
<mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">Α</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>
|
39
42
|
++++
|
40
43
|
INPUT
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
44
|
+
output = <<~OUTPUT
|
45
|
+
#{@blank_hdr}
|
46
|
+
<sections>
|
47
|
+
<formula id="_">
|
48
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
|
49
|
+
</formula>
|
50
|
+
|
51
|
+
<formula id="_">
|
52
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
|
53
|
+
</formula>
|
54
|
+
</sections>
|
55
|
+
</iec-standard>
|
52
56
|
OUTPUT
|
57
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
58
|
+
.to be_equivalent_to xmlpp(output)
|
53
59
|
end
|
54
60
|
|
55
|
-
|
56
|
-
|
61
|
+
it "ignores review blocks unless document is in draft mode" do
|
62
|
+
input = <<~INPUT
|
57
63
|
#{ASCIIDOC_BLANK_HDR}
|
58
64
|
[[foreword]]
|
59
65
|
.Foreword
|
@@ -65,16 +71,19 @@ end
|
|
65
71
|
|
66
72
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
67
73
|
****
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
74
|
+
INPUT
|
75
|
+
output = <<~OUTPUT
|
76
|
+
#{@blank_hdr}
|
77
|
+
<sections><p id="foreword">Foreword</p>
|
78
|
+
</sections>
|
79
|
+
</iec-standard>
|
80
|
+
OUTPUT
|
81
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
82
|
+
.to be_equivalent_to xmlpp(output)
|
83
|
+
end
|
75
84
|
|
76
85
|
it "processes review blocks if document is in draft mode" do
|
77
|
-
|
86
|
+
input = <<~INPUT
|
78
87
|
= Document title
|
79
88
|
Author
|
80
89
|
:docfile: test.adoc
|
@@ -93,80 +102,94 @@ end
|
|
93
102
|
|
94
103
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
95
104
|
****
|
96
|
-
|
105
|
+
INPUT
|
106
|
+
output = <<~OUTPUT
|
97
107
|
<sections>
|
98
108
|
<p id="foreword">Foreword</p>
|
99
109
|
<review reviewer="ISO" id="_" date="20170101T00:00:00Z" from="foreword" to="foreword"><p id="_">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
100
110
|
<p id="_">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review></sections>
|
101
111
|
|
102
|
-
|
112
|
+
OUTPUT
|
113
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
114
|
+
.sub(/^.+<sections>/m, "<sections>")
|
115
|
+
.sub(%r{</sections>.*$}m, "</sections>")))
|
116
|
+
.to be_equivalent_to xmlpp(output)
|
103
117
|
end
|
104
118
|
|
105
119
|
it "processes term notes" do
|
106
|
-
|
120
|
+
input = <<~INPUT
|
107
121
|
#{ASCIIDOC_BLANK_HDR}
|
108
122
|
== Terms and Definitions
|
109
123
|
|
110
124
|
=== Term1
|
111
125
|
|
112
126
|
NOTE: This is a note
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
127
|
+
INPUT
|
128
|
+
output = <<~OUTPUT
|
129
|
+
#{@blank_hdr}
|
130
|
+
<sections>
|
131
|
+
<terms id="_" obligation="normative">
|
132
|
+
<title>Terms and definitions</title>
|
133
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
134
|
+
#{TERMS_BOILERPLATE}
|
135
|
+
<term id="term-term1">
|
136
|
+
<preferred>Term1</preferred>
|
137
|
+
<termnote id="_">
|
138
|
+
<p id="_">This is a note</p>
|
139
|
+
</termnote>
|
140
|
+
</term>
|
141
|
+
</terms>
|
142
|
+
</sections>
|
143
|
+
</iec-standard>
|
144
|
+
OUTPUT
|
145
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
146
|
+
.to be_equivalent_to xmlpp(output)
|
130
147
|
end
|
131
148
|
|
132
|
-
|
133
|
-
|
149
|
+
it "processes notes" do
|
150
|
+
input = <<~INPUT
|
134
151
|
#{ASCIIDOC_BLANK_HDR}
|
135
152
|
NOTE: This is a note
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
153
|
+
INPUT
|
154
|
+
output = <<~OUTPUT
|
155
|
+
#{@blank_hdr}
|
156
|
+
<sections>
|
157
|
+
<note id="_">
|
158
|
+
<p id="_">This is a note</p>
|
159
|
+
</note>
|
160
|
+
</sections>
|
161
|
+
</iec-standard>
|
162
|
+
OUTPUT
|
163
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
164
|
+
.to be_equivalent_to xmlpp(output)
|
165
|
+
end
|
147
166
|
|
148
|
-
|
149
|
-
|
167
|
+
it "processes literals" do
|
168
|
+
input = <<~INPUT
|
150
169
|
#{ASCIIDOC_BLANK_HDR}
|
151
170
|
....
|
152
171
|
LITERAL
|
153
172
|
....
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
</
|
160
|
-
</
|
161
|
-
</
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
173
|
+
INPUT
|
174
|
+
output = <<~OUTPUT
|
175
|
+
#{@blank_hdr}
|
176
|
+
<sections>
|
177
|
+
<figure id="_">
|
178
|
+
<pre id="_">LITERAL</pre>
|
179
|
+
</figure>
|
180
|
+
</sections>
|
181
|
+
</iec-standard>
|
182
|
+
OUTPUT
|
183
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
184
|
+
.to be_equivalent_to xmlpp(output)
|
185
|
+
end
|
186
|
+
|
187
|
+
it "processes simple admonitions with Asciidoc names" do
|
188
|
+
input = <<~INPUT
|
167
189
|
#{ASCIIDOC_BLANK_HDR}
|
168
190
|
CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
|
169
|
-
|
191
|
+
INPUT
|
192
|
+
output = <<~OUTPUT
|
170
193
|
#{@blank_hdr}
|
171
194
|
<sections>
|
172
195
|
<admonition id="_" type="caution">
|
@@ -174,13 +197,13 @@ end
|
|
174
197
|
</admonition>
|
175
198
|
</sections>
|
176
199
|
</iec-standard>
|
200
|
+
OUTPUT
|
201
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
202
|
+
.to be_equivalent_to xmlpp(output)
|
203
|
+
end
|
177
204
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
it "processes complex admonitions with non-Asciidoc names" do
|
183
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
205
|
+
it "processes complex admonitions with non-Asciidoc names" do
|
206
|
+
input = <<~INPUT
|
184
207
|
#{ASCIIDOC_BLANK_HDR}
|
185
208
|
[CAUTION,type=Safety Precautions]
|
186
209
|
.Safety Precautions
|
@@ -191,7 +214,8 @@ end
|
|
191
214
|
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
|
192
215
|
. Celery makes them sad.
|
193
216
|
====
|
194
|
-
|
217
|
+
INPUT
|
218
|
+
output = <<~OUTPUT
|
195
219
|
#{@blank_hdr}
|
196
220
|
<sections>
|
197
221
|
<admonition id="_" type="safety precautions"><name>Safety Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
|
@@ -208,12 +232,13 @@ end
|
|
208
232
|
</ol></admonition>
|
209
233
|
</sections>
|
210
234
|
</iec-standard>
|
235
|
+
OUTPUT
|
236
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
237
|
+
.to be_equivalent_to xmlpp(output)
|
238
|
+
end
|
211
239
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
it "processes term examples" do
|
216
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
240
|
+
it "processes term examples" do
|
241
|
+
input = <<~INPUT
|
217
242
|
#{ASCIIDOC_BLANK_HDR}
|
218
243
|
== Terms and Definitions
|
219
244
|
|
@@ -221,7 +246,8 @@ end
|
|
221
246
|
|
222
247
|
[example]
|
223
248
|
This is an example
|
224
|
-
|
249
|
+
INPUT
|
250
|
+
output = <<~OUTPUT
|
225
251
|
#{@blank_hdr}
|
226
252
|
<sections>
|
227
253
|
<terms id="_" obligation="normative">
|
@@ -237,12 +263,13 @@ end
|
|
237
263
|
</terms>
|
238
264
|
</sections>
|
239
265
|
</iec-standard>
|
266
|
+
OUTPUT
|
267
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
268
|
+
.to be_equivalent_to xmlpp(output)
|
269
|
+
end
|
240
270
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
it "processes examples" do
|
245
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
271
|
+
it "processes examples" do
|
272
|
+
input = <<~INPUT
|
246
273
|
#{ASCIIDOC_BLANK_HDR}
|
247
274
|
[example]
|
248
275
|
====
|
@@ -250,23 +277,27 @@ end
|
|
250
277
|
|
251
278
|
Amen
|
252
279
|
====
|
253
|
-
|
280
|
+
INPUT
|
281
|
+
output = <<~OUTPUT
|
254
282
|
#{@blank_hdr}
|
255
283
|
<sections>
|
256
284
|
<example id="_"><p id="_">This is an example</p>
|
257
285
|
<p id="_">Amen</p></example>
|
258
286
|
</sections>
|
259
287
|
</iec-standard>
|
260
|
-
|
261
|
-
|
288
|
+
OUTPUT
|
289
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
290
|
+
.to be_equivalent_to xmlpp(output)
|
291
|
+
end
|
262
292
|
|
263
|
-
|
264
|
-
|
293
|
+
it "processes preambles" do
|
294
|
+
input = <<~INPUT
|
265
295
|
#{ASCIIDOC_BLANK_HDR}
|
266
296
|
This is a preamble
|
267
297
|
|
268
298
|
== Section 1
|
269
|
-
|
299
|
+
INPUT
|
300
|
+
output = <<~OUTPUT
|
270
301
|
#{@blank_hdr}
|
271
302
|
<preface><foreword id="_" obligation="informative">
|
272
303
|
<title>FOREWORD</title>
|
@@ -276,16 +307,19 @@ end
|
|
276
307
|
<title>Section 1</title>
|
277
308
|
</clause></sections>
|
278
309
|
</iec-standard>
|
279
|
-
|
280
|
-
|
310
|
+
OUTPUT
|
311
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
312
|
+
.to be_equivalent_to xmlpp(output)
|
313
|
+
end
|
281
314
|
|
282
|
-
|
283
|
-
|
315
|
+
it "processes images" do
|
316
|
+
input = <<~INPUT
|
284
317
|
#{ASCIIDOC_BLANK_HDR}
|
285
318
|
.Split-it-right sample divider
|
286
319
|
image::spec/examples/rice_images/rice_image1.png[]
|
287
320
|
|
288
|
-
|
321
|
+
INPUT
|
322
|
+
output = <<~OUTPUT
|
289
323
|
#{@blank_hdr}
|
290
324
|
<sections>
|
291
325
|
<figure id="_">
|
@@ -294,16 +328,19 @@ end
|
|
294
328
|
</figure>
|
295
329
|
</sections>
|
296
330
|
</iec-standard>
|
297
|
-
|
298
|
-
|
331
|
+
OUTPUT
|
332
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
333
|
+
.to be_equivalent_to xmlpp(output)
|
334
|
+
end
|
299
335
|
|
300
|
-
|
301
|
-
|
336
|
+
it "accepts width and height attributes on images" do
|
337
|
+
input = <<~INPUT
|
302
338
|
#{ASCIIDOC_BLANK_HDR}
|
303
339
|
[height=4,width=3]
|
304
340
|
image::spec/examples/rice_images/rice_image1.png[]
|
305
341
|
|
306
|
-
|
342
|
+
INPUT
|
343
|
+
output = <<~OUTPUT
|
307
344
|
#{@blank_hdr}
|
308
345
|
<sections>
|
309
346
|
<figure id="_">
|
@@ -311,16 +348,19 @@ end
|
|
311
348
|
</figure>
|
312
349
|
</sections>
|
313
350
|
</iec-standard>
|
314
|
-
|
315
|
-
|
351
|
+
OUTPUT
|
352
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
353
|
+
.to be_equivalent_to xmlpp(output)
|
354
|
+
end
|
316
355
|
|
317
|
-
|
318
|
-
|
356
|
+
it "accepts auto for width and height attributes on images" do
|
357
|
+
input = <<~INPUT
|
319
358
|
#{ASCIIDOC_BLANK_HDR}
|
320
359
|
[height=4,width=auto]
|
321
360
|
image::spec/examples/rice_images/rice_image1.png[]
|
322
361
|
|
323
|
-
|
362
|
+
INPUT
|
363
|
+
output = <<~OUTPUT
|
324
364
|
#{@blank_hdr}
|
325
365
|
<sections>
|
326
366
|
<figure id="_">
|
@@ -328,31 +368,37 @@ end
|
|
328
368
|
</figure>
|
329
369
|
</sections>
|
330
370
|
</iec-standard>
|
331
|
-
|
332
|
-
|
371
|
+
OUTPUT
|
372
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
373
|
+
.to be_equivalent_to xmlpp(output)
|
374
|
+
end
|
333
375
|
|
334
|
-
|
335
|
-
|
376
|
+
it "accepts alignment attribute on paragraphs" do
|
377
|
+
input = <<~INPUT
|
336
378
|
#{ASCIIDOC_BLANK_HDR}
|
337
379
|
[align=right]
|
338
380
|
This para is right-aligned.
|
339
|
-
|
381
|
+
INPUT
|
382
|
+
output = <<~OUTPUT
|
340
383
|
#{@blank_hdr}
|
341
384
|
<sections>
|
342
385
|
<p align="right" id="_">This para is right-aligned.</p>
|
343
386
|
</sections>
|
344
387
|
</iec-standard>
|
345
|
-
|
346
|
-
|
388
|
+
OUTPUT
|
389
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
390
|
+
.to be_equivalent_to xmlpp(output)
|
391
|
+
end
|
347
392
|
|
348
|
-
|
349
|
-
|
393
|
+
it "processes blockquotes" do
|
394
|
+
input = <<~INPUT
|
350
395
|
#{ASCIIDOC_BLANK_HDR}
|
351
396
|
[quote, ISO, "ISO7301,section 1"]
|
352
397
|
____
|
353
398
|
Block quotation
|
354
399
|
____
|
355
|
-
|
400
|
+
INPUT
|
401
|
+
output = <<~OUTPUT
|
356
402
|
#{@blank_hdr}
|
357
403
|
<sections>
|
358
404
|
<quote id="_">
|
@@ -362,11 +408,13 @@ end
|
|
362
408
|
</quote>
|
363
409
|
</sections>
|
364
410
|
</iec-standard>
|
365
|
-
|
366
|
-
|
411
|
+
OUTPUT
|
412
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
413
|
+
.to be_equivalent_to xmlpp(output)
|
414
|
+
end
|
367
415
|
|
368
|
-
|
369
|
-
|
416
|
+
it "processes source code" do
|
417
|
+
input = <<~INPUT
|
370
418
|
#{ASCIIDOC_BLANK_HDR}
|
371
419
|
[source,ruby]
|
372
420
|
--
|
@@ -375,7 +423,8 @@ end
|
|
375
423
|
puts x
|
376
424
|
end
|
377
425
|
--
|
378
|
-
|
426
|
+
INPUT
|
427
|
+
output = <<~OUTPUT
|
379
428
|
#{@blank_hdr}
|
380
429
|
<sections>
|
381
430
|
<sourcecode lang="ruby" id="_">puts "Hello, world."
|
@@ -384,11 +433,13 @@ end
|
|
384
433
|
end</sourcecode>
|
385
434
|
</sections>
|
386
435
|
</iec-standard>
|
387
|
-
|
388
|
-
|
436
|
+
OUTPUT
|
437
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
438
|
+
.to be_equivalent_to xmlpp(output)
|
439
|
+
end
|
389
440
|
|
390
|
-
|
391
|
-
|
441
|
+
it "processes callouts" do
|
442
|
+
input = <<~INPUT
|
392
443
|
#{ASCIIDOC_BLANK_HDR}
|
393
444
|
[source,ruby]
|
394
445
|
--
|
@@ -399,7 +450,8 @@ end
|
|
399
450
|
--
|
400
451
|
<1> This is one callout
|
401
452
|
<2> This is another callout
|
402
|
-
|
453
|
+
INPUT
|
454
|
+
output = <<~OUTPUT
|
403
455
|
#{@blank_hdr}
|
404
456
|
<sections><sourcecode lang="ruby" id="_">puts "Hello, world." <callout target="_">1</callout>
|
405
457
|
%w{a b c}.each do |x|
|
@@ -411,11 +463,13 @@ end
|
|
411
463
|
</annotation></sourcecode>
|
412
464
|
</sections>
|
413
465
|
</iec-standard>
|
414
|
-
|
415
|
-
|
466
|
+
OUTPUT
|
467
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
468
|
+
.to be_equivalent_to xmlpp(output)
|
469
|
+
end
|
416
470
|
|
417
|
-
|
418
|
-
|
471
|
+
it "processes unmodified term sources" do
|
472
|
+
input = <<~INPUT
|
419
473
|
#{ASCIIDOC_BLANK_HDR}
|
420
474
|
== Terms and Definitions
|
421
475
|
|
@@ -423,7 +477,8 @@ end
|
|
423
477
|
|
424
478
|
[.source]
|
425
479
|
<<ISO2191,section=1>>
|
426
|
-
|
480
|
+
INPUT
|
481
|
+
output = <<~OUTPUT
|
427
482
|
#{@blank_hdr}
|
428
483
|
<sections>
|
429
484
|
<terms id="_" obligation="normative">
|
@@ -443,11 +498,13 @@ end
|
|
443
498
|
</terms>
|
444
499
|
</sections>
|
445
500
|
</iec-standard>
|
446
|
-
|
447
|
-
|
501
|
+
OUTPUT
|
502
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
503
|
+
.to be_equivalent_to xmlpp(output)
|
504
|
+
end
|
448
505
|
|
449
|
-
|
450
|
-
|
506
|
+
it "processes modified term sources" do
|
507
|
+
input = <<~INPUT
|
451
508
|
#{ASCIIDOC_BLANK_HDR}
|
452
509
|
== Terms and Definitions
|
453
510
|
|
@@ -455,7 +512,8 @@ end
|
|
455
512
|
|
456
513
|
[.source]
|
457
514
|
<<ISO2191,section=1>>, with adjustments
|
458
|
-
|
515
|
+
INPUT
|
516
|
+
output = <<~OUTPUT
|
459
517
|
#{@blank_hdr}
|
460
518
|
<sections>
|
461
519
|
<terms id="_" obligation="normative">
|
@@ -478,8 +536,8 @@ end
|
|
478
536
|
</terms>
|
479
537
|
</sections>
|
480
538
|
</iec-standard>
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
539
|
+
OUTPUT
|
540
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
541
|
+
.to be_equivalent_to xmlpp(output)
|
542
|
+
end
|
485
543
|
end
|