metanorma-iso 1.7.1 → 1.7.2
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/.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
@@ -1,5 +1,4 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
require "fileutils"
|
3
2
|
|
4
3
|
RSpec.describe Asciidoctor::ISO do
|
5
4
|
it "has a version number" do
|
@@ -7,30 +6,26 @@ RSpec.describe Asciidoctor::ISO do
|
|
7
6
|
end
|
8
7
|
|
9
8
|
it "processes a blank document" do
|
10
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT",
|
11
|
-
|
9
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", *OPTIONS))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
10
|
+
#{ASCIIDOC_BLANK_HDR}
|
12
11
|
INPUT
|
13
|
-
|
14
|
-
<sections/>
|
15
|
-
</iso-standard>
|
12
|
+
#{BLANK_HDR}
|
13
|
+
<sections/>
|
14
|
+
</iso-standard>
|
16
15
|
OUTPUT
|
17
16
|
end
|
18
17
|
|
19
18
|
it "converts a blank document" do
|
20
|
-
|
21
|
-
FileUtils.rm_f "test.html"
|
22
|
-
FileUtils.rm_f "test.pdf"
|
23
|
-
FileUtils.rm_f "test_alt.html"
|
24
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
19
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", *OPTIONS))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
25
20
|
= Document title
|
26
21
|
Author
|
27
22
|
:docfile: test.adoc
|
28
23
|
:novalid:
|
29
24
|
:no-isobib:
|
30
25
|
INPUT
|
31
|
-
|
32
|
-
<sections/>
|
33
|
-
</iso-standard>
|
26
|
+
#{BLANK_HDR}
|
27
|
+
<sections/>
|
28
|
+
</iso-standard>
|
34
29
|
OUTPUT
|
35
30
|
expect(File.exist?("test_alt.html")).to be true
|
36
31
|
expect(File.exist?("test.html")).to be true
|
@@ -39,8 +34,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
39
34
|
expect(File.exist?("htmlstyle.css")).to be false
|
40
35
|
end
|
41
36
|
|
42
|
-
|
43
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT",
|
37
|
+
it "converts a blank document in French" do
|
38
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", *OPTIONS))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
44
39
|
= Document title
|
45
40
|
Author
|
46
41
|
:docfile: test.adoc
|
@@ -49,14 +44,14 @@ RSpec.describe Asciidoctor::ISO do
|
|
49
44
|
:no-pdf:
|
50
45
|
:language: fr
|
51
46
|
INPUT
|
52
|
-
|
53
|
-
<sections/>
|
54
|
-
</iso-standard>
|
47
|
+
#{BLANK_HDR_FR}
|
48
|
+
<sections/>
|
49
|
+
</iso-standard>
|
55
50
|
OUTPUT
|
56
51
|
end
|
57
52
|
|
58
53
|
it "processes default metadata" do
|
59
|
-
|
54
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
60
55
|
= Document title
|
61
56
|
Author
|
62
57
|
:docfile: test.adoc
|
@@ -101,91 +96,91 @@ RSpec.describe Asciidoctor::ISO do
|
|
101
96
|
:copyright-year: 2000
|
102
97
|
:horizontal: true
|
103
98
|
INPUT
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
</
|
169
|
-
|
170
|
-
|
171
|
-
</
|
172
|
-
|
173
|
-
|
174
|
-
</
|
175
|
-
|
176
|
-
|
177
|
-
</
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
99
|
+
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
100
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
101
|
+
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
102
|
+
<bibdata type="standard">
|
103
|
+
<title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part</title>
|
104
|
+
<title format="text/plain" language="en" type="title-intro">Introduction</title>
|
105
|
+
<title format="text/plain" language="en" type="title-main">Main Title — Title</title>
|
106
|
+
<title format="text/plain" language="en" type="title-part">Title Part</title>
|
107
|
+
<title format="text/plain" language="fr" type="main">Introduction Française — Titre Principal — Part du Titre</title>
|
108
|
+
<title format="text/plain" language="fr" type="title-intro">Introduction Française</title>
|
109
|
+
<title format="text/plain" language="fr" type="title-main">Titre Principal</title>
|
110
|
+
<title format="text/plain" language="fr" type="title-part">Part du Titre</title>
|
111
|
+
<docidentifier type="ISO">ISO/PreWD3 1000-1</docidentifier>
|
112
|
+
<docidentifier type="iso-with-lang">ISO/PreWD3 1000-1(E)</docidentifier>
|
113
|
+
<docidentifier type="iso-reference">ISO/PreWD3 1000-1:2000(E)</docidentifier>
|
114
|
+
<docnumber>1000</docnumber>
|
115
|
+
<contributor>
|
116
|
+
<role type="author"/>
|
117
|
+
<organization>
|
118
|
+
<name>International Organization for Standardization</name>
|
119
|
+
<abbreviation>ISO</abbreviation>
|
120
|
+
</organization>
|
121
|
+
</contributor>
|
122
|
+
<contributor>
|
123
|
+
<role type="publisher"/>
|
124
|
+
<organization>
|
125
|
+
<name>International Organization for Standardization</name>
|
126
|
+
<abbreviation>ISO</abbreviation>
|
127
|
+
</organization>
|
128
|
+
</contributor>
|
129
|
+
<edition>2</edition>
|
130
|
+
<version>
|
131
|
+
<revision-date>2000-01-01</revision-date>
|
132
|
+
<draft>0.3.4</draft>
|
133
|
+
</version>
|
134
|
+
<language>en</language>
|
135
|
+
<script>Latn</script>
|
136
|
+
<status>
|
137
|
+
<stage abbreviation="WD">20</stage>
|
138
|
+
<substage>20</substage>
|
139
|
+
<iteration>3</iteration>
|
140
|
+
</status>
|
141
|
+
<copyright>
|
142
|
+
<from>2000</from>
|
143
|
+
<owner>
|
144
|
+
<organization>
|
145
|
+
<name>International Organization for Standardization</name>
|
146
|
+
<abbreviation>ISO</abbreviation>
|
147
|
+
</organization>
|
148
|
+
</owner>
|
149
|
+
</copyright>
|
150
|
+
<ext>
|
151
|
+
<doctype>article</doctype>
|
152
|
+
<horizontal>true</horizontal>
|
153
|
+
<editorialgroup>
|
154
|
+
<technical-committee number="1" type="A">TC</technical-committee>
|
155
|
+
<technical-committee number="11" type="A1">TC1</technical-committee>
|
156
|
+
<subcommittee number="2" type="B">SC</subcommittee>
|
157
|
+
<subcommittee number="21" type="B1">SC1</subcommittee>
|
158
|
+
<workgroup number="3" type="C">WG</workgroup>
|
159
|
+
<workgroup number="31" type="C1">WG1</workgroup>
|
160
|
+
<secretariat>SECRETARIAT</secretariat>
|
161
|
+
</editorialgroup>
|
162
|
+
<ics>
|
163
|
+
<code>1</code>
|
164
|
+
</ics>
|
165
|
+
<ics>
|
166
|
+
<code>2</code>
|
167
|
+
</ics>
|
168
|
+
<ics>
|
169
|
+
<code>3</code>
|
170
|
+
</ics>
|
171
|
+
<structuredidentifier>
|
172
|
+
<project-number part="1">ISO 1000</project-number>
|
173
|
+
</structuredidentifier>
|
174
|
+
<stagename>Third working draft</stagename>
|
175
|
+
</ext>
|
176
|
+
</bibdata>
|
177
|
+
<sections/>
|
178
|
+
</iso-standard>
|
183
179
|
OUTPUT
|
184
180
|
end
|
185
181
|
|
186
|
-
|
187
182
|
it "processes complex metadata" do
|
188
|
-
|
183
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
189
184
|
= Document title
|
190
185
|
Author
|
191
186
|
:docfile: test.adoc
|
@@ -208,98 +203,99 @@ RSpec.describe Asciidoctor::ISO do
|
|
208
203
|
:pub-email: x@example.com
|
209
204
|
:pub-uri: http://www.example.com
|
210
205
|
INPUT
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
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
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
206
|
+
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
207
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
208
|
+
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
209
|
+
<bibdata type="standard">
|
210
|
+
<docidentifier type="ISO">ISO/IEC/IETF/TR 1000-1-1:2001</docidentifier>
|
211
|
+
<docidentifier type="iso-with-lang">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
|
212
|
+
<docidentifier type="iso-reference">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
|
213
|
+
<docidentifier type="iso-tc">2000</docidentifier>
|
214
|
+
<docidentifier type="iso-tc">2003</docidentifier>
|
215
|
+
<docnumber>1000</docnumber>
|
216
|
+
<contributor>
|
217
|
+
<role type="author"/>
|
218
|
+
<organization>
|
219
|
+
<name>International Electrotechnical Commission</name>
|
220
|
+
<abbreviation>IEC</abbreviation>
|
221
|
+
</organization>
|
222
|
+
</contributor>
|
223
|
+
<contributor>
|
224
|
+
<role type="author"/>
|
225
|
+
<organization>
|
226
|
+
<name>IETF</name>
|
227
|
+
</organization>
|
228
|
+
</contributor>
|
229
|
+
<contributor>
|
230
|
+
<role type="author"/>
|
231
|
+
<organization>
|
232
|
+
<name>International Organization for Standardization</name>
|
233
|
+
<abbreviation>ISO</abbreviation>
|
234
|
+
</organization>
|
235
|
+
</contributor>
|
236
|
+
<contributor>
|
237
|
+
<role type="publisher"/>
|
238
|
+
<organization>
|
239
|
+
<name>International Electrotechnical Commission</name>
|
240
|
+
<abbreviation>IEC</abbreviation>
|
241
|
+
</organization>
|
242
|
+
</contributor>
|
243
|
+
<contributor>
|
244
|
+
<role type="publisher"/>
|
245
|
+
<organization>
|
246
|
+
<name>IETF</name>
|
247
|
+
</organization>
|
248
|
+
</contributor>
|
249
|
+
<contributor>
|
250
|
+
<role type="publisher"/>
|
251
|
+
<organization>
|
252
|
+
<name>International Organization for Standardization</name>
|
253
|
+
<abbreviation>ISO</abbreviation>
|
254
|
+
</organization>
|
255
|
+
</contributor>
|
256
|
+
<language>el</language>
|
257
|
+
<script>Grek</script>
|
258
|
+
<status>
|
259
|
+
<stage abbreviation="IS">60</stage>
|
260
|
+
<substage>60</substage>
|
261
|
+
</status>
|
262
|
+
<copyright>
|
263
|
+
<from>2001</from>
|
264
|
+
<owner>
|
265
|
+
<organization>
|
266
|
+
<name>International Organization for Standardization</name>
|
267
|
+
<abbreviation>ISO</abbreviation>
|
268
|
+
</organization>
|
269
|
+
</owner>
|
270
|
+
</copyright>
|
271
|
+
<copyright>
|
272
|
+
<from>2001</from>
|
273
|
+
<owner>
|
274
|
+
<organization>
|
275
|
+
<name>IETF</name>
|
276
|
+
</organization>
|
277
|
+
</owner>
|
278
|
+
</copyright>
|
279
|
+
<ext>
|
280
|
+
<doctype>technical-report</doctype>
|
281
|
+
<editorialgroup>
|
282
|
+
<technical-committee/>
|
283
|
+
<subcommittee/>
|
284
|
+
<workgroup/>
|
285
|
+
</editorialgroup>
|
286
|
+
<structuredidentifier>
|
287
|
+
<project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
|
288
|
+
</structuredidentifier>
|
289
|
+
<stagename>International standard</stagename>
|
290
|
+
</ext>
|
291
|
+
</bibdata>
|
292
|
+
<sections/>
|
293
|
+
</iso-standard>
|
298
294
|
OUTPUT
|
299
295
|
end
|
300
296
|
|
301
|
-
|
302
|
-
|
297
|
+
it "processes subdivisions" do
|
298
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
303
299
|
= Document title
|
304
300
|
Author
|
305
301
|
:docfile: test.adoc
|
@@ -321,95 +317,97 @@ RSpec.describe Asciidoctor::ISO do
|
|
321
317
|
:pub-fax: 4444444
|
322
318
|
:pub-email: x@example.com
|
323
319
|
:pub-uri: http://www.example.com
|
324
|
-
|
325
320
|
INPUT
|
326
|
-
<
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
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
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
</
|
407
|
-
|
408
|
-
|
409
|
-
|
321
|
+
expect(xmlpp(strip_guid(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))))
|
322
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
323
|
+
<iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
|
324
|
+
<bibdata type='standard'>
|
325
|
+
<docidentifier type='ISO'>SD 1000-1-1</docidentifier>
|
326
|
+
<docidentifier type='iso-with-lang'>SD 1000-1-1(X)</docidentifier>
|
327
|
+
<docidentifier type='iso-reference'>SD 1000-1-1(X)</docidentifier>
|
328
|
+
<docidentifier type='iso-tc'>2000</docidentifier>
|
329
|
+
<docnumber>1000</docnumber>
|
330
|
+
<date type='published'>
|
331
|
+
<on>1000-01</on>
|
332
|
+
</date>
|
333
|
+
<contributor>
|
334
|
+
<role type='author'/>
|
335
|
+
<organization>
|
336
|
+
<name>International Organization for Standardization</name>
|
337
|
+
<subdivision>Subdivision</subdivision>
|
338
|
+
<abbreviation>SD</abbreviation>
|
339
|
+
<address>
|
340
|
+
<formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
|
341
|
+
</address>
|
342
|
+
<phone>3333333</phone>
|
343
|
+
<phone type='fax'>4444444</phone>
|
344
|
+
<email>x@example.com</email>
|
345
|
+
<uri>http://www.example.com</uri>
|
346
|
+
</organization>
|
347
|
+
</contributor>
|
348
|
+
<contributor>
|
349
|
+
<role type='publisher'/>
|
350
|
+
<organization>
|
351
|
+
<name>International Organization for Standardization</name>
|
352
|
+
<subdivision>Subdivision</subdivision>
|
353
|
+
<abbreviation>SD</abbreviation>
|
354
|
+
<address>
|
355
|
+
<formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
|
356
|
+
</address>
|
357
|
+
<phone>3333333</phone>
|
358
|
+
<phone type='fax'>4444444</phone>
|
359
|
+
<email>x@example.com</email>
|
360
|
+
<uri>http://www.example.com</uri>
|
361
|
+
</organization>
|
362
|
+
</contributor>
|
363
|
+
<version>
|
364
|
+
<revision-date>2000-01</revision-date>
|
365
|
+
</version>
|
366
|
+
<language>el</language>
|
367
|
+
<script>Grek</script>
|
368
|
+
<status>
|
369
|
+
<stage abbreviation='IS'>60</stage>
|
370
|
+
<substage>60</substage>
|
371
|
+
</status>
|
372
|
+
<copyright>
|
373
|
+
<from>#{Time.now.year}</from>
|
374
|
+
<owner>
|
375
|
+
<organization>
|
376
|
+
<name>International Organization for Standardization</name>
|
377
|
+
<subdivision>Subdivision</subdivision>
|
378
|
+
<abbreviation>SD</abbreviation>
|
379
|
+
<address>
|
380
|
+
<formattedAddress>1 Infinity Loop
|
381
|
+
<br/>
|
382
|
+
California</formattedAddress>
|
383
|
+
</address>
|
384
|
+
<phone>3333333</phone>
|
385
|
+
<phone type="fax">4444444</phone>
|
386
|
+
<email>x@example.com</email>
|
387
|
+
<uri>http://www.example.com</uri>
|
388
|
+
</organization>
|
389
|
+
</owner>
|
390
|
+
</copyright>
|
391
|
+
<ext>
|
392
|
+
<doctype>this-is-a-doctype</doctype>
|
393
|
+
<editorialgroup>
|
394
|
+
<technical-committee/>
|
395
|
+
<subcommittee/>
|
396
|
+
<workgroup/>
|
397
|
+
</editorialgroup>
|
398
|
+
<structuredidentifier>
|
399
|
+
<project-number part="1" subpart="1">SD 1000</project-number>
|
400
|
+
</structuredidentifier>
|
401
|
+
<stagename>International standard</stagename>
|
402
|
+
</ext>
|
403
|
+
</bibdata>
|
404
|
+
<sections> </sections>
|
405
|
+
</iso-standard>
|
406
|
+
OUTPUT
|
407
|
+
end
|
410
408
|
|
411
|
-
|
412
|
-
|
409
|
+
it "defaults substage, defines iteration on stage 50, gives stage 50 on technical specification" do
|
410
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
413
411
|
= Document title
|
414
412
|
Author
|
415
413
|
:docfile: test.adoc
|
@@ -422,63 +420,63 @@ OUTPUT
|
|
422
420
|
:doctype: technical-specification
|
423
421
|
:iteration: 2
|
424
422
|
INPUT
|
425
|
-
<
|
426
|
-
<
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
</bibdata>
|
475
|
-
<sections/>
|
476
|
-
</iso-standard>
|
477
|
-
OUTPUT
|
478
|
-
|
423
|
+
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
424
|
+
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
425
|
+
<bibdata type="standard">
|
426
|
+
<docidentifier type="ISO">ISO/DTS 1000.2</docidentifier>
|
427
|
+
<docidentifier type="iso-with-lang">ISO/DTS 1000.2(F)</docidentifier>
|
428
|
+
<docidentifier type="iso-reference">ISO/DTS 1000.2(F)</docidentifier>
|
429
|
+
<docnumber>1000</docnumber>
|
430
|
+
<contributor>
|
431
|
+
<role type="author"/>
|
432
|
+
<organization>
|
433
|
+
<name>International Organization for Standardization</name>
|
434
|
+
<abbreviation>ISO</abbreviation>
|
435
|
+
</organization>
|
436
|
+
</contributor>
|
437
|
+
<contributor>
|
438
|
+
<role type="publisher"/>
|
439
|
+
<organization>
|
440
|
+
<name>International Organization for Standardization</name>
|
441
|
+
<abbreviation>ISO</abbreviation>
|
442
|
+
</organization>
|
443
|
+
</contributor>
|
444
|
+
<language>fr</language>
|
445
|
+
<script>Latn</script>
|
446
|
+
<status>
|
447
|
+
<stage abbreviation="D">50</stage>
|
448
|
+
<substage>00</substage>
|
449
|
+
<iteration>2</iteration>
|
450
|
+
</status>
|
451
|
+
<copyright>
|
452
|
+
<from>#{Date.today.year}</from>
|
453
|
+
<owner>
|
454
|
+
<organization>
|
455
|
+
<name>International Organization for Standardization</name>
|
456
|
+
<abbreviation>ISO</abbreviation>
|
457
|
+
</organization>
|
458
|
+
</owner>
|
459
|
+
</copyright>
|
460
|
+
<ext>
|
461
|
+
<doctype>technical-specification</doctype>
|
462
|
+
<editorialgroup>
|
463
|
+
<technical-committee/>
|
464
|
+
<subcommittee/>
|
465
|
+
<workgroup/>
|
466
|
+
</editorialgroup>
|
467
|
+
<structuredidentifier>
|
468
|
+
<project-number>ISO 1000</project-number>
|
469
|
+
</structuredidentifier>
|
470
|
+
<stagename>Final draft</stagename>
|
471
|
+
</ext>
|
472
|
+
</bibdata>
|
473
|
+
<sections/>
|
474
|
+
</iso-standard>
|
475
|
+
OUTPUT
|
476
|
+
end
|
479
477
|
|
480
|
-
|
481
|
-
|
478
|
+
it "defaults substage for stage 60" do
|
479
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
482
480
|
= Document title
|
483
481
|
Author
|
484
482
|
:docfile: test.adoc
|
@@ -488,62 +486,64 @@ OUTPUT
|
|
488
486
|
:docnumber: 1000
|
489
487
|
:docstage: 60
|
490
488
|
INPUT
|
491
|
-
<iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
|
492
|
-
<bibdata type="standard">
|
493
|
-
<docidentifier type="ISO">ISO 1000</docidentifier>
|
494
|
-
<docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
|
495
|
-
<docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
|
496
|
-
<docnumber>1000</docnumber>
|
497
|
-
<contributor>
|
498
|
-
<role type="author"/>
|
499
|
-
<organization>
|
500
|
-
<name>International Organization for Standardization</name>
|
501
|
-
<abbreviation>ISO</abbreviation>
|
502
|
-
</organization>
|
503
|
-
</contributor>
|
504
|
-
<contributor>
|
505
|
-
<role type="publisher"/>
|
506
|
-
<organization>
|
507
|
-
<name>International Organization for Standardization</name>
|
508
|
-
<abbreviation>ISO</abbreviation>
|
509
|
-
</organization>
|
510
|
-
</contributor>
|
511
489
|
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
</
|
540
|
-
<
|
541
|
-
</
|
542
|
-
|
543
|
-
|
490
|
+
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
491
|
+
<iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
|
492
|
+
<bibdata type="standard">
|
493
|
+
<docidentifier type="ISO">ISO 1000</docidentifier>
|
494
|
+
<docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
|
495
|
+
<docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
|
496
|
+
<docnumber>1000</docnumber>
|
497
|
+
<contributor>
|
498
|
+
<role type="author"/>
|
499
|
+
<organization>
|
500
|
+
<name>International Organization for Standardization</name>
|
501
|
+
<abbreviation>ISO</abbreviation>
|
502
|
+
</organization>
|
503
|
+
</contributor>
|
504
|
+
<contributor>
|
505
|
+
<role type="publisher"/>
|
506
|
+
<organization>
|
507
|
+
<name>International Organization for Standardization</name>
|
508
|
+
<abbreviation>ISO</abbreviation>
|
509
|
+
</organization>
|
510
|
+
</contributor>
|
511
|
+
|
512
|
+
<language>en</language>
|
513
|
+
<script>Latn</script>
|
514
|
+
<status>
|
515
|
+
<stage abbreviation="IS">60</stage>
|
516
|
+
<substage>60</substage>
|
517
|
+
</status>
|
518
|
+
<copyright>
|
519
|
+
<from>#{Date.today.year}</from>
|
520
|
+
<owner>
|
521
|
+
<organization>
|
522
|
+
<name>International Organization for Standardization</name>
|
523
|
+
<abbreviation>ISO</abbreviation>
|
524
|
+
</organization>
|
525
|
+
</owner>
|
526
|
+
</copyright>
|
527
|
+
<ext>
|
528
|
+
<doctype>article</doctype>
|
529
|
+
<editorialgroup>
|
530
|
+
<technical-committee/>
|
531
|
+
<subcommittee/>
|
532
|
+
<workgroup/>
|
533
|
+
</editorialgroup>
|
534
|
+
<structuredidentifier>
|
535
|
+
<project-number>ISO 1000</project-number>
|
536
|
+
</structuredidentifier>
|
537
|
+
<stagename>International standard</stagename>
|
538
|
+
</ext>
|
539
|
+
</bibdata>
|
540
|
+
<sections/>
|
541
|
+
</iso-standard>
|
542
|
+
OUTPUT
|
543
|
+
end
|
544
544
|
|
545
545
|
it "populates metadata for PRF" do
|
546
|
-
|
546
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
547
547
|
= Document title
|
548
548
|
Author
|
549
549
|
:docfile: test.adoc
|
@@ -554,64 +554,63 @@ OUTPUT
|
|
554
554
|
:docstage: 60
|
555
555
|
:docsubstage: 00
|
556
556
|
INPUT
|
557
|
-
<
|
558
|
-
<
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
<language>en</language>
|
579
|
-
<script>Latn</script>
|
580
|
-
<status>
|
581
|
-
<stage abbreviation="PRF">60</stage>
|
582
|
-
<substage>00</substage>
|
583
|
-
</status>
|
584
|
-
<copyright>
|
585
|
-
<from>#{Date.today.year}</from>
|
586
|
-
<owner>
|
587
|
-
<organization>
|
588
|
-
<name>International Organization for Standardization</name>
|
589
|
-
<abbreviation>ISO</abbreviation>
|
590
|
-
</organization>
|
591
|
-
</owner>
|
592
|
-
</copyright>
|
593
|
-
<ext>
|
594
|
-
<doctype>article</doctype>
|
595
|
-
<editorialgroup>
|
596
|
-
<technical-committee/>
|
597
|
-
<subcommittee/>
|
598
|
-
<workgroup/>
|
599
|
-
</editorialgroup>
|
600
|
-
<structuredidentifier>
|
601
|
-
<project-number>ISO 1000</project-number>
|
602
|
-
</structuredidentifier>
|
603
|
-
<stagename>Proof</stagename>
|
604
|
-
</ext>
|
605
|
-
</bibdata>
|
606
|
-
<sections/>
|
607
|
-
</iso-standard>
|
608
|
-
OUTPUT
|
609
|
-
end
|
557
|
+
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
558
|
+
<iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
|
559
|
+
<bibdata type="standard">
|
560
|
+
<docidentifier type="ISO">ISO 1000</docidentifier>
|
561
|
+
<docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
|
562
|
+
<docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
|
563
|
+
<docnumber>1000</docnumber>
|
564
|
+
<contributor>
|
565
|
+
<role type="author"/>
|
566
|
+
<organization>
|
567
|
+
<name>International Organization for Standardization</name>
|
568
|
+
<abbreviation>ISO</abbreviation>
|
569
|
+
</organization>
|
570
|
+
</contributor>
|
571
|
+
<contributor>
|
572
|
+
<role type="publisher"/>
|
573
|
+
<organization>
|
574
|
+
<name>International Organization for Standardization</name>
|
575
|
+
<abbreviation>ISO</abbreviation>
|
576
|
+
</organization>
|
577
|
+
</contributor>
|
610
578
|
|
579
|
+
<language>en</language>
|
580
|
+
<script>Latn</script>
|
581
|
+
<status>
|
582
|
+
<stage abbreviation="PRF">60</stage>
|
583
|
+
<substage>00</substage>
|
584
|
+
</status>
|
585
|
+
<copyright>
|
586
|
+
<from>#{Date.today.year}</from>
|
587
|
+
<owner>
|
588
|
+
<organization>
|
589
|
+
<name>International Organization for Standardization</name>
|
590
|
+
<abbreviation>ISO</abbreviation>
|
591
|
+
</organization>
|
592
|
+
</owner>
|
593
|
+
</copyright>
|
594
|
+
<ext>
|
595
|
+
<doctype>article</doctype>
|
596
|
+
<editorialgroup>
|
597
|
+
<technical-committee/>
|
598
|
+
<subcommittee/>
|
599
|
+
<workgroup/>
|
600
|
+
</editorialgroup>
|
601
|
+
<structuredidentifier>
|
602
|
+
<project-number>ISO 1000</project-number>
|
603
|
+
</structuredidentifier>
|
604
|
+
<stagename>Proof</stagename>
|
605
|
+
</ext>
|
606
|
+
</bibdata>
|
607
|
+
<sections/>
|
608
|
+
</iso-standard>
|
609
|
+
OUTPUT
|
610
|
+
end
|
611
611
|
|
612
612
|
it "reads scripts into blank HTML document" do
|
613
|
-
|
614
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
613
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
615
614
|
= Document title
|
616
615
|
Author
|
617
616
|
:docfile: test.adoc
|
@@ -624,8 +623,7 @@ OUTPUT
|
|
624
623
|
end
|
625
624
|
|
626
625
|
it "uses default fonts" do
|
627
|
-
|
628
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
626
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
629
627
|
= Document title
|
630
628
|
Author
|
631
629
|
:docfile: test.adoc
|
@@ -640,8 +638,7 @@ OUTPUT
|
|
640
638
|
end
|
641
639
|
|
642
640
|
it "uses default fonts for alt doc" do
|
643
|
-
|
644
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
641
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
645
642
|
= Document title
|
646
643
|
Author
|
647
644
|
:docfile: test.adoc
|
@@ -656,8 +653,7 @@ OUTPUT
|
|
656
653
|
end
|
657
654
|
|
658
655
|
it "uses Chinese fonts" do
|
659
|
-
|
660
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
656
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
661
657
|
= Document title
|
662
658
|
Author
|
663
659
|
:docfile: test.adoc
|
@@ -673,8 +669,7 @@ OUTPUT
|
|
673
669
|
end
|
674
670
|
|
675
671
|
it "uses specified fonts" do
|
676
|
-
|
677
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
672
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
678
673
|
= Document title
|
679
674
|
Author
|
680
675
|
:docfile: test.adoc
|
@@ -693,9 +688,7 @@ OUTPUT
|
|
693
688
|
end
|
694
689
|
|
695
690
|
it "strips MS-specific CSS" do
|
696
|
-
|
697
|
-
FileUtils.rm_f "test.doc"
|
698
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
691
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
699
692
|
= Document title
|
700
693
|
Author
|
701
694
|
:docfile: test.adoc
|
@@ -708,6 +701,4 @@ OUTPUT
|
|
708
701
|
expect(word).to match(%r[mso-style-name: "Intro Title";]m)
|
709
702
|
expect(html).not_to match(%r[mso-style-name: "Intro Title";]m)
|
710
703
|
end
|
711
|
-
|
712
|
-
|
713
704
|
end
|