metanorma-iso 1.5.14 → 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/.github/workflows/rake.yml +17 -0
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +13 -13
- data/lib/asciidoctor/iso/basicdoc.rng +20 -3
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +5 -5
- data/lib/asciidoctor/iso/isodoc.rng +118 -4
- data/lib/asciidoctor/iso/isostandard-amd.rng +11 -4
- data/lib/asciidoctor/iso/isostandard.rng +22 -10
- data/lib/asciidoctor/iso/validate.rb +78 -0
- data/lib/asciidoctor/iso/validate_section.rb +12 -9
- data/lib/isodoc/iso/html/header.html +12 -12
- data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html_convert.rb +2 -2
- data/lib/isodoc/iso/i18n-en.yaml +2 -0
- data/lib/isodoc/iso/i18n-fr.yaml +1 -1
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +451 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +451 -208
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_convert.rb +2 -2
- data/lib/isodoc/iso/xref.rb +28 -12
- data/lib/metanorma/iso/processor.rb +11 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +449 -458
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +814 -699
- 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 +1223 -919
- 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 +340 -316
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +834 -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 +184 -189
- metadata +7 -10
- data/.rubocop.ribose.yml +0 -66
- data/lib/metanorma/iso/fonts_manifest.yaml +0 -6
- data/spec/assets/xref_error.adoc +0 -7
@@ -2,22 +2,20 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::ISO do
|
4
4
|
it "removes empty text elements" 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
|
== {blank}
|
8
8
|
INPUT
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
</sections>
|
15
|
-
</iso-standard>
|
9
|
+
#{BLANK_HDR}
|
10
|
+
<sections>
|
11
|
+
<clause id="_" inline-header="false" obligation="normative"/>
|
12
|
+
</sections>
|
13
|
+
</iso-standard>
|
16
14
|
OUTPUT
|
17
15
|
end
|
18
16
|
|
19
17
|
it "processes stem-only terms as admitted" do
|
20
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
18
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
21
19
|
#{ASCIIDOC_BLANK_HDR}
|
22
20
|
== Terms and Definitions
|
23
21
|
|
@@ -27,33 +25,51 @@ RSpec.describe Asciidoctor::ISO do
|
|
27
25
|
|
28
26
|
Time
|
29
27
|
INPUT
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<
|
39
|
-
|
40
|
-
|
41
|
-
</
|
42
|
-
|
43
|
-
</
|
44
|
-
|
45
|
-
|
46
|
-
</
|
47
|
-
</
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
28
|
+
#{BLANK_HDR}
|
29
|
+
<sections>
|
30
|
+
<terms id="_" obligation="normative">
|
31
|
+
<title>Terms and definitions</title>
|
32
|
+
#{TERM_BOILERPLATE}
|
33
|
+
<term id="term-t90">
|
34
|
+
<preferred>
|
35
|
+
<stem type="MathML">
|
36
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
37
|
+
<msub>
|
38
|
+
<mrow>
|
39
|
+
<mi>t</mi></mrow>
|
40
|
+
<mrow>
|
41
|
+
<mn>90</mn>
|
42
|
+
</mrow>
|
43
|
+
</msub>
|
44
|
+
</math>
|
45
|
+
</stem>
|
46
|
+
</preferred>
|
47
|
+
<admitted>
|
48
|
+
<stem type="MathML">
|
49
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
50
|
+
<msub>
|
51
|
+
<mrow>
|
52
|
+
<mi>t</mi>
|
53
|
+
</mrow>
|
54
|
+
<mrow>
|
55
|
+
<mn>91</mn>
|
56
|
+
</mrow>
|
57
|
+
</msub>
|
58
|
+
</math>
|
59
|
+
</stem>
|
60
|
+
</admitted>
|
61
|
+
<definition>
|
62
|
+
<p id="_">Time</p>
|
63
|
+
</definition>
|
64
|
+
</term>
|
65
|
+
</terms>
|
66
|
+
</sections>
|
67
|
+
</iso-standard>
|
52
68
|
OUTPUT
|
53
69
|
end
|
54
70
|
|
55
71
|
it "moves term domains out of the term definition paragraph" do
|
56
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
72
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
57
73
|
#{ASCIIDOC_BLANK_HDR}
|
58
74
|
== Terms and Definitions
|
59
75
|
|
@@ -61,23 +77,25 @@ RSpec.describe Asciidoctor::ISO do
|
|
61
77
|
|
62
78
|
domain:[relativity] Time
|
63
79
|
INPUT
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
80
|
+
#{BLANK_HDR}
|
81
|
+
<sections>
|
82
|
+
<terms id="_" obligation="normative">
|
83
|
+
<title>Terms and definitions</title>#{TERM_BOILERPLATE}
|
84
|
+
|
85
|
+
<term id="term-tempus">
|
86
|
+
<preferred>Tempus</preferred>
|
87
|
+
<domain>relativity</domain>
|
88
|
+
<definition>
|
89
|
+
<p id="_">Time</p></definition>
|
90
|
+
</term>
|
91
|
+
</terms>
|
92
|
+
</sections>
|
93
|
+
</iso-standard>
|
76
94
|
OUTPUT
|
77
95
|
end
|
78
96
|
|
79
97
|
it "permits multiple blocks in term definition paragraph" do
|
80
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
98
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
81
99
|
= Document title
|
82
100
|
Author
|
83
101
|
:docfile: test.adoc
|
@@ -97,35 +115,51 @@ RSpec.describe Asciidoctor::ISO do
|
|
97
115
|
|
98
116
|
This paragraph is extraneous
|
99
117
|
INPUT
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
<
|
109
|
-
|
110
|
-
|
111
|
-
</
|
112
|
-
|
113
|
-
|
114
|
-
</mrow>
|
115
|
-
|
116
|
-
|
117
|
-
</
|
118
|
-
</
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
118
|
+
#{BLANK_HDR}
|
119
|
+
<sections>
|
120
|
+
<terms id="_" obligation="normative">
|
121
|
+
<title>Terms and definitions</title>
|
122
|
+
#{TERM_BOILERPLATE}
|
123
|
+
<term id="term-t90">
|
124
|
+
<preferred>
|
125
|
+
<stem type="MathML">
|
126
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
127
|
+
<msub>
|
128
|
+
<mrow>
|
129
|
+
<mi>t</mi></mrow>
|
130
|
+
<mrow>
|
131
|
+
<mn>90</mn>
|
132
|
+
</mrow>
|
133
|
+
</msub>
|
134
|
+
</math>
|
135
|
+
</stem>
|
136
|
+
</preferred>
|
137
|
+
<definition>
|
138
|
+
<formula id="_">
|
139
|
+
<stem type="MathML">
|
140
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
141
|
+
<msub>
|
142
|
+
<mrow>
|
143
|
+
<mi>t</mi>
|
144
|
+
</mrow>
|
145
|
+
<mrow>
|
146
|
+
<mi>A</mi>
|
147
|
+
</mrow>
|
148
|
+
</msub>
|
149
|
+
</math>
|
150
|
+
</stem>
|
151
|
+
</formula>
|
152
|
+
<p id="_">This paragraph is extraneous</p>
|
153
|
+
</definition>
|
154
|
+
</term>
|
155
|
+
</terms>
|
156
|
+
</sections>
|
123
157
|
</iso-standard>
|
124
158
|
OUTPUT
|
125
159
|
end
|
126
160
|
|
127
|
-
it "
|
128
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
161
|
+
it "keeps any initial boilerplate from terms and definitions" do
|
162
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
129
163
|
#{ASCIIDOC_BLANK_HDR}
|
130
164
|
== Terms and Definitions
|
131
165
|
|
@@ -137,22 +171,30 @@ RSpec.describe Asciidoctor::ISO do
|
|
137
171
|
|
138
172
|
This paragraph is extraneous
|
139
173
|
INPUT
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
174
|
+
#{BLANK_HDR}
|
175
|
+
<sections>
|
176
|
+
<terms id="_" obligation="normative">
|
177
|
+
<title>Terms and definitions</title>#{TERM_BOILERPLATE}
|
178
|
+
|
179
|
+
<p id="_">I am boilerplate</p>
|
180
|
+
<ul id="_">
|
181
|
+
<li>
|
182
|
+
<p id="_">So am I</p></li>
|
183
|
+
</ul>
|
184
|
+
<term id="term-time">
|
185
|
+
<preferred>Time</preferred>
|
186
|
+
<definition>
|
187
|
+
<p id="_">This paragraph is extraneous</p>
|
188
|
+
</definition>
|
189
|
+
</term>
|
190
|
+
</terms>
|
191
|
+
</sections>
|
192
|
+
</iso-standard>
|
151
193
|
OUTPUT
|
152
194
|
end
|
153
195
|
|
154
196
|
it "moves notes inside preceding blocks, if they are not at clause end, and the blocks are not delimited" do
|
155
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
197
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
156
198
|
#{ASCIIDOC_BLANK_HDR}
|
157
199
|
[stem]
|
158
200
|
++++
|
@@ -164,20 +206,33 @@ RSpec.describe Asciidoctor::ISO do
|
|
164
206
|
|
165
207
|
Indeed.
|
166
208
|
INPUT
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
<
|
171
|
-
|
172
|
-
</
|
173
|
-
|
174
|
-
|
175
|
-
|
209
|
+
#{BLANK_HDR}
|
210
|
+
<sections>
|
211
|
+
<formula id="_">
|
212
|
+
<stem type="MathML">
|
213
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
214
|
+
<mi>r</mi>
|
215
|
+
<mo>=</mo>
|
216
|
+
<mn>1</mn>
|
217
|
+
<mi>%</mi>
|
218
|
+
<mi>r</mi>
|
219
|
+
<mo>=</mo>
|
220
|
+
<mn>1</mn>
|
221
|
+
<mi>%</mi>
|
222
|
+
</math>
|
223
|
+
</stem>
|
224
|
+
<note id="_">
|
225
|
+
<p id="_">That formula does not do much</p>
|
226
|
+
</note>
|
227
|
+
</formula>
|
228
|
+
<p id="_">Indeed.</p>
|
229
|
+
</sections>
|
230
|
+
</iso-standard>
|
176
231
|
OUTPUT
|
177
232
|
end
|
178
233
|
|
179
234
|
it "does not move notes inside preceding blocks, if they are at clause end" do
|
180
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
235
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
181
236
|
#{ASCIIDOC_BLANK_HDR}
|
182
237
|
[source,ruby]
|
183
238
|
[1...x].each do |y|
|
@@ -186,19 +241,21 @@ RSpec.describe Asciidoctor::ISO do
|
|
186
241
|
|
187
242
|
NOTE: That loop does not do much
|
188
243
|
INPUT
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
244
|
+
#{BLANK_HDR}
|
245
|
+
<sections>
|
246
|
+
<sourcecode id="_" lang="ruby">[1...x].each do |y|
|
247
|
+
puts y
|
248
|
+
end</sourcecode>
|
249
|
+
<note id="_">
|
250
|
+
<p id="_">That loop does not do much</p>
|
251
|
+
</note>
|
252
|
+
</sections>
|
253
|
+
</iso-standard>
|
197
254
|
OUTPUT
|
198
255
|
end
|
199
256
|
|
200
257
|
it "converts xrefs to references into erefs" do
|
201
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
258
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
202
259
|
#{ASCIIDOC_BLANK_HDR}
|
203
260
|
<<iso216>>
|
204
261
|
|
@@ -207,38 +264,43 @@ RSpec.describe Asciidoctor::ISO do
|
|
207
264
|
* [[[iso216,ISO 216:2001]]], _Reference_
|
208
265
|
INPUT
|
209
266
|
#{BLANK_HDR}
|
210
|
-
<preface
|
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
|
-
|
267
|
+
<preface>
|
268
|
+
<foreword id="_" obligation="informative">
|
269
|
+
<title>Foreword</title>
|
270
|
+
<p id="_">
|
271
|
+
<eref bibitemid="iso216" citeas="ISO 216:2001" type="inline"/>
|
272
|
+
</p>
|
273
|
+
</foreword>
|
274
|
+
</preface>
|
275
|
+
<sections>
|
276
|
+
</sections>
|
277
|
+
<bibliography>
|
278
|
+
<references id="_" normative="true" obligation="informative">
|
279
|
+
<title>Normative references</title>
|
280
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
281
|
+
<bibitem id="iso216" type="standard">
|
282
|
+
<title format="text/plain">Reference</title>
|
283
|
+
<docidentifier>ISO 216:2001</docidentifier>
|
284
|
+
<docnumber>216</docnumber>
|
285
|
+
<date type="published">
|
286
|
+
<on>2001</on>
|
287
|
+
</date>
|
288
|
+
<contributor>
|
289
|
+
<role type="publisher"/>
|
290
|
+
<organization>
|
291
|
+
<name>International Organization for Standardization</name>
|
292
|
+
<abbreviation>ISO</abbreviation>
|
293
|
+
</organization>
|
294
|
+
</contributor>
|
295
|
+
</bibitem>
|
296
|
+
</references>
|
297
|
+
</bibliography>
|
236
298
|
</iso-standard>
|
237
299
|
OUTPUT
|
238
300
|
end
|
239
301
|
|
240
302
|
it "extracts localities from erefs" do
|
241
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
303
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
242
304
|
#{ASCIIDOC_BLANK_HDR}
|
243
305
|
<<iso216,whole,clause=3,example=9-11,locality:prelude=33,locality:entirety:the reference>>
|
244
306
|
|
@@ -247,39 +309,54 @@ RSpec.describe Asciidoctor::ISO do
|
|
247
309
|
* [[[iso216,ISO 216]]], _Reference_
|
248
310
|
INPUT
|
249
311
|
#{BLANK_HDR}
|
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
|
-
|
312
|
+
<preface>
|
313
|
+
<foreword id="_" obligation="informative">
|
314
|
+
<title>Foreword</title>
|
315
|
+
<p id="_">
|
316
|
+
<eref bibitemid="iso216" citeas="ISO 216" type="inline">
|
317
|
+
<localityStack>
|
318
|
+
<locality type="whole"/>
|
319
|
+
<locality type="clause">
|
320
|
+
<referenceFrom>3</referenceFrom>
|
321
|
+
</locality>
|
322
|
+
<locality type="example">
|
323
|
+
<referenceFrom>9</referenceFrom>
|
324
|
+
<referenceTo>11</referenceTo>
|
325
|
+
</locality>
|
326
|
+
<locality type="locality:prelude">
|
327
|
+
<referenceFrom>33</referenceFrom>
|
328
|
+
</locality>
|
329
|
+
<locality type="locality:entirety"/>
|
330
|
+
</localityStack>the reference</eref>
|
331
|
+
</p>
|
332
|
+
</foreword>
|
333
|
+
</preface>
|
334
|
+
<sections>
|
335
|
+
</sections>
|
336
|
+
<bibliography>
|
337
|
+
<references id="_" normative="true" obligation="informative">
|
338
|
+
<title>Normative references</title>
|
339
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
340
|
+
<bibitem id="iso216" type="standard">
|
341
|
+
<title format="text/plain">Reference</title>
|
342
|
+
<docidentifier>ISO 216</docidentifier>
|
343
|
+
<docnumber>216</docnumber>
|
344
|
+
<contributor>
|
345
|
+
<role type="publisher"/>
|
346
|
+
<organization>
|
347
|
+
<name>International Organization for Standardization</name>
|
348
|
+
<abbreviation>ISO</abbreviation>
|
349
|
+
</organization>
|
350
|
+
</contributor>
|
351
|
+
</bibitem>
|
352
|
+
</references>
|
353
|
+
</bibliography>
|
276
354
|
</iso-standard>
|
277
355
|
OUTPUT
|
278
356
|
end
|
279
357
|
|
280
|
-
|
281
358
|
it "strips type from xrefs" do
|
282
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
359
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
283
360
|
#{ASCIIDOC_BLANK_HDR}
|
284
361
|
<<iso216>>
|
285
362
|
|
@@ -287,35 +364,40 @@ RSpec.describe Asciidoctor::ISO do
|
|
287
364
|
== Clause
|
288
365
|
* [[[iso216,ISO 216]]], _Reference_
|
289
366
|
INPUT
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
</
|
312
|
-
</
|
313
|
-
|
367
|
+
#{BLANK_HDR}
|
368
|
+
<preface>
|
369
|
+
<foreword id="_" obligation="informative">
|
370
|
+
<title>Foreword</title>
|
371
|
+
<p id="_">
|
372
|
+
<eref bibitemid="iso216" citeas="ISO 216" type="inline"/>
|
373
|
+
</p>
|
374
|
+
</foreword>
|
375
|
+
</preface>
|
376
|
+
<sections>
|
377
|
+
</sections>
|
378
|
+
<bibliography>
|
379
|
+
<references id="_" normative="false" obligation="informative">
|
380
|
+
<title>Bibliography</title>
|
381
|
+
<bibitem id="iso216" type="standard">
|
382
|
+
<title format="text/plain">Reference</title>
|
383
|
+
<docidentifier>ISO 216</docidentifier>
|
384
|
+
<docnumber>216</docnumber>
|
385
|
+
<contributor>
|
386
|
+
<role type="publisher"/>
|
387
|
+
<organization>
|
388
|
+
<name>International Organization for Standardization</name>
|
389
|
+
<abbreviation>ISO</abbreviation>
|
390
|
+
</organization>
|
391
|
+
</contributor>
|
392
|
+
</bibitem>
|
393
|
+
</references>
|
394
|
+
</bibliography>
|
395
|
+
</iso-standard>
|
314
396
|
OUTPUT
|
315
397
|
end
|
316
398
|
|
317
399
|
it "processes localities in term sources" do
|
318
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
400
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
319
401
|
#{ASCIIDOC_BLANK_HDR}
|
320
402
|
== Terms and Definitions
|
321
403
|
|
@@ -323,30 +405,31 @@ RSpec.describe Asciidoctor::ISO do
|
|
323
405
|
|
324
406
|
[.source]
|
325
407
|
<<ISO2191,section=1>>
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
408
|
+
INPUT
|
409
|
+
#{BLANK_HDR}
|
410
|
+
<sections>
|
411
|
+
<terms id="_" obligation="normative">
|
412
|
+
<title>Terms and definitions</title>
|
413
|
+
#{TERM_BOILERPLATE}
|
414
|
+
<term id="term-term1">
|
415
|
+
<preferred>Term1</preferred>
|
416
|
+
<termsource status="identical">
|
417
|
+
<origin bibitemid="ISO2191" citeas="" type="inline">
|
418
|
+
<localityStack>
|
419
|
+
<locality type="section">
|
420
|
+
<referenceFrom>1</referenceFrom></locality>
|
421
|
+
</localityStack>
|
422
|
+
</origin>
|
423
|
+
</termsource>
|
424
|
+
</term>
|
425
|
+
</terms>
|
426
|
+
</sections>
|
427
|
+
</iso-standard>
|
428
|
+
OUTPUT
|
346
429
|
end
|
347
430
|
|
348
431
|
it "removes extraneous material from Normative References" do
|
349
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
432
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
350
433
|
#{ASCIIDOC_BLANK_HDR}
|
351
434
|
[bibliography]
|
352
435
|
== Normative References
|
@@ -356,62 +439,64 @@ RSpec.describe Asciidoctor::ISO do
|
|
356
439
|
* [[[iso216,ISO 216]]], _Reference_
|
357
440
|
INPUT
|
358
441
|
#{BLANK_HDR}
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
442
|
+
<sections></sections>
|
443
|
+
<bibliography>
|
444
|
+
<references id="_" normative="true" obligation="informative">
|
445
|
+
<title>Normative references</title>
|
446
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
447
|
+
<bibitem id="iso216" type="standard">
|
448
|
+
<title format="text/plain">Reference</title>
|
449
|
+
<docidentifier>ISO 216</docidentifier>
|
450
|
+
<docnumber>216</docnumber>
|
451
|
+
<contributor>
|
452
|
+
<role type="publisher"/>
|
453
|
+
<organization>
|
454
|
+
<name>International Organization for Standardization</name>
|
455
|
+
<abbreviation>ISO</abbreviation>
|
456
|
+
</organization>
|
457
|
+
</contributor>
|
458
|
+
</bibitem>
|
459
|
+
</references>
|
460
|
+
</bibliography>
|
376
461
|
</iso-standard>
|
377
462
|
OUTPUT
|
378
463
|
end
|
379
464
|
|
380
465
|
it "inserts IDs into paragraphs" do
|
381
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
466
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
382
467
|
#{ASCIIDOC_BLANK_HDR}
|
383
468
|
Paragraph
|
384
469
|
INPUT
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
470
|
+
#{BLANK_HDR}
|
471
|
+
<sections>
|
472
|
+
<p id="_">Paragraph</p>
|
473
|
+
</sections>
|
474
|
+
</iso-standard>
|
390
475
|
OUTPUT
|
391
476
|
end
|
392
477
|
|
393
478
|
it "inserts IDs into notes" do
|
394
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
479
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
395
480
|
#{ASCIIDOC_BLANK_HDR}
|
396
481
|
[example]
|
397
482
|
====
|
398
483
|
NOTE: This note has no ID
|
399
484
|
====
|
400
485
|
INPUT
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
486
|
+
#{BLANK_HDR}
|
487
|
+
<sections>
|
488
|
+
<example id="_">
|
489
|
+
<note id="_">
|
490
|
+
<p id="_">This note has no ID</p>
|
491
|
+
</note>
|
492
|
+
</example>
|
493
|
+
</sections>
|
494
|
+
</iso-standard>
|
410
495
|
OUTPUT
|
411
496
|
end
|
412
497
|
|
413
498
|
it "moves table key inside table" do
|
414
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
499
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
415
500
|
#{ASCIIDOC_BLANK_HDR}
|
416
501
|
|===
|
417
502
|
|a |b |c
|
@@ -421,29 +506,30 @@ RSpec.describe Asciidoctor::ISO do
|
|
421
506
|
|
422
507
|
a:: b
|
423
508
|
INPUT
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
509
|
+
#{BLANK_HDR}
|
510
|
+
<sections>
|
511
|
+
<table id="_">
|
512
|
+
<tbody>
|
513
|
+
<tr>
|
514
|
+
<td align="left" valign="top">a</td>
|
515
|
+
<td align="left" valign="top">b</td>
|
516
|
+
<td align="left" valign="top">c</td>
|
517
|
+
</tr>
|
518
|
+
</tbody>
|
519
|
+
<dl id="_" key="true">
|
520
|
+
<dt>a</dt>
|
521
|
+
<dd>
|
522
|
+
<p id="_">b</p>
|
523
|
+
</dd>
|
524
|
+
</dl>
|
525
|
+
</table>
|
526
|
+
</sections>
|
527
|
+
</iso-standard>
|
442
528
|
OUTPUT
|
443
529
|
end
|
444
530
|
|
445
531
|
it "processes headerrows attribute for table without header rows" do
|
446
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
532
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
447
533
|
#{ASCIIDOC_BLANK_HDR}
|
448
534
|
[headerrows=3]
|
449
535
|
|===
|
@@ -453,36 +539,41 @@ RSpec.describe Asciidoctor::ISO do
|
|
453
539
|
|a |b |c
|
454
540
|
|===
|
455
541
|
INPUT
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
542
|
+
#{BLANK_HDR}
|
543
|
+
<sections>
|
544
|
+
<table id="_">
|
545
|
+
<thead>
|
546
|
+
<tr>
|
547
|
+
<th align="left" valign="top">a</th>
|
548
|
+
<th align="left" valign="top">b</th>
|
549
|
+
<th align="left" valign="top">c</th>
|
550
|
+
</tr>
|
551
|
+
<tr>
|
552
|
+
<th align="left" valign="top">a</th>
|
553
|
+
<th align="left" valign="top">b</th>
|
554
|
+
<th align="left" valign="top">c</th>
|
555
|
+
</tr>
|
556
|
+
<tr>
|
557
|
+
<th align="left" valign="top">a</th>
|
558
|
+
<th align="left" valign="top">b</th>
|
559
|
+
<th align="left" valign="top">c</th>
|
560
|
+
</tr>
|
561
|
+
</thead>
|
562
|
+
<tbody>
|
563
|
+
<tr>
|
564
|
+
<td align="left" valign="top">a</td>
|
565
|
+
<td align="left" valign="top">b</td>
|
566
|
+
<td align="left" valign="top">c</td>
|
567
|
+
</tr>
|
568
|
+
</tbody>
|
569
|
+
</table>
|
570
|
+
</sections>
|
571
|
+
</iso-standard>
|
481
572
|
OUTPUT
|
482
573
|
end
|
483
574
|
|
484
575
|
it "processes headerrows attribute for table with header rows" do
|
485
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
576
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
486
577
|
#{ASCIIDOC_BLANK_HDR}
|
487
578
|
[headerrows=3]
|
488
579
|
|===
|
@@ -493,41 +584,41 @@ RSpec.describe Asciidoctor::ISO do
|
|
493
584
|
|a |b |c
|
494
585
|
|===
|
495
586
|
INPUT
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
587
|
+
#{BLANK_HDR}
|
588
|
+
<sections>
|
589
|
+
<table id="_">
|
590
|
+
<thead>
|
591
|
+
<tr>
|
592
|
+
<th align="left" valign="top">a</th>
|
593
|
+
<th align="left" valign="top">b</th>
|
594
|
+
<th align="left" valign="top">c</th>
|
595
|
+
</tr>
|
596
|
+
<tr>
|
597
|
+
<th align="left" valign="top">a</th>
|
598
|
+
<th align="left" valign="top">b</th>
|
599
|
+
<th align="left" valign="top">c</th>
|
600
|
+
</tr>
|
601
|
+
<tr>
|
602
|
+
<th align="left" valign="top">a</th>
|
603
|
+
<th align="left" valign="top">b</th>
|
604
|
+
<th align="left" valign="top">c</th>
|
605
|
+
</tr>
|
606
|
+
</thead>
|
607
|
+
<tbody>
|
608
|
+
<tr>
|
609
|
+
<td align="left" valign="top">a</td>
|
610
|
+
<td align="left" valign="top">b</td>
|
611
|
+
<td align="left" valign="top">c</td>
|
612
|
+
</tr>
|
613
|
+
</tbody>
|
614
|
+
</table>
|
615
|
+
</sections>
|
616
|
+
</iso-standard>
|
526
617
|
OUTPUT
|
527
618
|
end
|
528
619
|
|
529
620
|
it "moves table notes inside table" do
|
530
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
621
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
531
622
|
#{ASCIIDOC_BLANK_HDR}
|
532
623
|
|===
|
533
624
|
|a |b |c
|
@@ -538,27 +629,29 @@ RSpec.describe Asciidoctor::ISO do
|
|
538
629
|
NOTE: Note 2
|
539
630
|
INPUT
|
540
631
|
#{BLANK_HDR}
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
632
|
+
<sections>
|
633
|
+
<table id="_">
|
634
|
+
<tbody>
|
635
|
+
<tr>
|
636
|
+
<td align="left" valign="top">a</td>
|
637
|
+
<td align="left" valign="top">b</td>
|
638
|
+
<td align="left" valign="top">c</td>
|
639
|
+
</tr>
|
640
|
+
</tbody>
|
641
|
+
<note id="_">
|
642
|
+
<p id="_">Note 1</p>
|
643
|
+
</note>
|
644
|
+
<note id="_">
|
645
|
+
<p id="_">Note 2</p>
|
646
|
+
</note>
|
647
|
+
</table>
|
648
|
+
</sections>
|
649
|
+
</iso-standard>
|
557
650
|
OUTPUT
|
558
651
|
end
|
559
652
|
|
560
653
|
it "moves formula key inside formula" do
|
561
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
654
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
562
655
|
#{ASCIIDOC_BLANK_HDR}
|
563
656
|
[stem]
|
564
657
|
++++
|
@@ -569,23 +662,32 @@ RSpec.describe Asciidoctor::ISO do
|
|
569
662
|
|
570
663
|
a:: b
|
571
664
|
INPUT
|
572
|
-
|
573
|
-
|
574
|
-
<
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
665
|
+
#{BLANK_HDR}
|
666
|
+
<sections>
|
667
|
+
<formula id="_">
|
668
|
+
<stem type="MathML">
|
669
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
670
|
+
<mi>F</mi>
|
671
|
+
<mi>or</mi>
|
672
|
+
<mi>μ</mi>
|
673
|
+
<mi>l</mi>
|
674
|
+
<mi>a</mi>
|
675
|
+
</math>
|
676
|
+
</stem>
|
677
|
+
<dl id="_" key="true">
|
678
|
+
<dt>a</dt>
|
679
|
+
<dd>
|
680
|
+
<p id="_">b</p>
|
681
|
+
</dd>
|
682
|
+
</dl>
|
683
|
+
</formula>
|
684
|
+
</sections>
|
685
|
+
</iso-standard>
|
584
686
|
OUTPUT
|
585
687
|
end
|
586
688
|
|
587
689
|
it "moves footnotes inside figures" do
|
588
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
690
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
589
691
|
#{ASCIIDOC_BLANK_HDR}
|
590
692
|
image::spec/examples/rice_images/rice_image1.png[]
|
591
693
|
|
@@ -593,23 +695,24 @@ RSpec.describe Asciidoctor::ISO do
|
|
593
695
|
|
594
696
|
footnote:[This is another footnote to a figure]
|
595
697
|
INPUT
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
698
|
+
#{BLANK_HDR}
|
699
|
+
<sections>
|
700
|
+
<figure id="_">
|
701
|
+
<image height="auto" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
|
702
|
+
<fn reference="a">
|
703
|
+
<p id="_">This is a footnote to a figure</p>
|
704
|
+
</fn>
|
705
|
+
<fn reference="b">
|
706
|
+
<p id="_">This is another footnote to a figure</p>
|
707
|
+
</fn>
|
708
|
+
</figure>
|
709
|
+
</sections>
|
710
|
+
</iso-standard>
|
608
711
|
OUTPUT
|
609
712
|
end
|
610
713
|
|
611
714
|
it "moves figure key inside figure" do
|
612
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
715
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
613
716
|
#{ASCIIDOC_BLANK_HDR}
|
614
717
|
image::spec/examples/rice_images/rice_image1.png[]
|
615
718
|
|
@@ -617,24 +720,24 @@ RSpec.describe Asciidoctor::ISO do
|
|
617
720
|
|
618
721
|
a:: b
|
619
722
|
INPUT
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
723
|
+
#{BLANK_HDR}
|
724
|
+
<sections>
|
725
|
+
<figure id="_">
|
726
|
+
<image height="auto" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
|
727
|
+
<dl id="_" key="true">
|
728
|
+
<dt>a</dt>
|
729
|
+
<dd>
|
730
|
+
<p id="_">b</p>
|
731
|
+
</dd>
|
732
|
+
</dl>
|
733
|
+
</figure>
|
734
|
+
</sections>
|
735
|
+
</iso-standard>
|
633
736
|
OUTPUT
|
634
737
|
end
|
635
738
|
|
636
739
|
it "numbers bibliographic notes and footnotes sequentially" do
|
637
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
740
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
638
741
|
#{ASCIIDOC_BLANK_HDR}
|
639
742
|
footnote:[Footnote]
|
640
743
|
|
@@ -647,47 +750,54 @@ RSpec.describe Asciidoctor::ISO do
|
|
647
750
|
footnote:[Footnote2]
|
648
751
|
INPUT
|
649
752
|
#{BLANK_HDR}
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
<
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
753
|
+
<preface>
|
754
|
+
<foreword id="_" obligation="informative">
|
755
|
+
<title>Foreword</title>
|
756
|
+
<p id="_">
|
757
|
+
<fn reference="1">
|
758
|
+
<p id="_">Footnote</p>
|
759
|
+
</fn>
|
760
|
+
</p>
|
761
|
+
</foreword>
|
762
|
+
</preface>
|
763
|
+
<sections>
|
764
|
+
<clause id="_" inline-header="false" obligation="normative">
|
765
|
+
<title>Clause</title>
|
766
|
+
<p id="_">
|
767
|
+
<fn reference="2">
|
768
|
+
<p id="_">Footnote2</p>
|
769
|
+
</fn>
|
770
|
+
</p>
|
771
|
+
</clause>
|
772
|
+
</sections>
|
773
|
+
<bibliography>
|
774
|
+
<references id="_" normative="true" obligation="informative">
|
775
|
+
<title>Normative references</title>
|
776
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
777
|
+
<bibitem id="iso123" type="standard">
|
778
|
+
<title format="text/plain">Standard</title>
|
779
|
+
<docidentifier>ISO 123:—</docidentifier>
|
780
|
+
<docnumber>123</docnumber>
|
781
|
+
<date type="published">
|
782
|
+
<on>–</on>
|
783
|
+
</date>
|
784
|
+
<contributor>
|
785
|
+
<role type="publisher"/>
|
786
|
+
<organization>
|
787
|
+
<name>International Organization for Standardization</name>
|
788
|
+
<abbreviation>ISO</abbreviation>
|
789
|
+
</organization>
|
790
|
+
</contributor>
|
791
|
+
<note format="text/plain" type="Unpublished-Status">The standard is in press</note>
|
792
|
+
</bibitem>
|
793
|
+
</references>
|
794
|
+
</bibliography>
|
685
795
|
</iso-standard>
|
686
796
|
OUTPUT
|
687
797
|
end
|
688
798
|
|
689
799
|
it "defaults section obligations" do
|
690
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
800
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
691
801
|
#{ASCIIDOC_BLANK_HDR}
|
692
802
|
|
693
803
|
== Clause
|
@@ -698,322 +808,327 @@ RSpec.describe Asciidoctor::ISO do
|
|
698
808
|
|
699
809
|
Text
|
700
810
|
INPUT
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
811
|
+
#{BLANK_HDR}
|
812
|
+
<sections>
|
813
|
+
<clause id="_" inline-header="false" obligation="normative">
|
814
|
+
<title>Clause</title>
|
815
|
+
<p id="_">Text</p>
|
816
|
+
</clause>
|
817
|
+
</sections>
|
818
|
+
<annex id="_" inline-header="false" obligation="normative">
|
819
|
+
<title>Clause</title>
|
820
|
+
<p id="_">Text</p>
|
821
|
+
</annex>
|
822
|
+
</iso-standard>
|
711
823
|
OUTPUT
|
712
824
|
end
|
713
825
|
|
714
826
|
it "extends clause levels past 5" do
|
715
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
716
|
-
|
827
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
828
|
+
#{ASCIIDOC_BLANK_HDR}
|
717
829
|
|
718
|
-
|
830
|
+
== Clause1
|
719
831
|
|
720
|
-
|
832
|
+
=== Clause2
|
721
833
|
|
722
|
-
|
834
|
+
==== Clause3
|
723
835
|
|
724
|
-
|
836
|
+
===== Clause4
|
725
837
|
|
726
|
-
|
838
|
+
====== Clause 5
|
727
839
|
|
728
|
-
|
729
|
-
|
840
|
+
[level=6]
|
841
|
+
====== Clause 6
|
730
842
|
|
731
|
-
|
732
|
-
|
843
|
+
[level=7]
|
844
|
+
====== Clause 7A
|
733
845
|
|
734
|
-
|
735
|
-
|
846
|
+
[level=7]
|
847
|
+
====== Clause 7B
|
736
848
|
|
737
|
-
|
738
|
-
|
849
|
+
[level=6]
|
850
|
+
====== Clause 6B
|
739
851
|
|
740
|
-
|
852
|
+
====== Clause 5B
|
741
853
|
|
742
854
|
INPUT
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
<clause id="_" inline-header="false" obligation="normative">
|
754
|
-
|
755
|
-
<clause id="_" inline-header="false" obligation="normative">
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
</clause
|
760
|
-
|
761
|
-
</
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
</
|
770
|
-
</clause>
|
771
|
-
</clause>
|
772
|
-
</
|
773
|
-
</
|
855
|
+
#{BLANK_HDR}
|
856
|
+
<sections>
|
857
|
+
<clause id="_" inline-header="false" obligation="normative">
|
858
|
+
<title>Clause1</title>
|
859
|
+
<clause id="_" inline-header="false" obligation="normative">
|
860
|
+
<title>Clause2</title>
|
861
|
+
<clause id="_" inline-header="false" obligation="normative">
|
862
|
+
<title>Clause3</title>
|
863
|
+
<clause id="_" inline-header="false" obligation="normative">
|
864
|
+
<title>Clause4</title>
|
865
|
+
<clause id="_" inline-header="false" obligation="normative">
|
866
|
+
<title>Clause 5</title>
|
867
|
+
<clause id="_" inline-header="false" obligation="normative">
|
868
|
+
<title>Clause 6</title>
|
869
|
+
<clause id="_" inline-header="false" obligation="normative">
|
870
|
+
<title>Clause 7A</title>
|
871
|
+
</clause>
|
872
|
+
<clause id="_" inline-header="false" obligation="normative">
|
873
|
+
<title>Clause 7B</title>
|
874
|
+
</clause>
|
875
|
+
</clause>
|
876
|
+
<clause id="_" inline-header="false" obligation="normative">
|
877
|
+
<title>Clause 6B</title>
|
878
|
+
</clause>
|
879
|
+
</clause>
|
880
|
+
<clause id="_" inline-header="false" obligation="normative">
|
881
|
+
<title>Clause 5B</title>
|
882
|
+
</clause>
|
883
|
+
</clause>
|
884
|
+
</clause>
|
885
|
+
</clause>
|
886
|
+
</clause>
|
887
|
+
</sections>
|
888
|
+
</iso-standard>
|
774
889
|
OUTPUT
|
775
890
|
end
|
776
891
|
|
777
892
|
it "reorders references in bibliography, and renumbers citations accordingly" do
|
778
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
893
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
894
|
+
#{ASCIIDOC_BLANK_HDR}
|
895
|
+
|
896
|
+
== Clause 1
|
897
|
+
<<ref1>>
|
898
|
+
<<ref1a>>
|
899
|
+
<<ref1b>>
|
900
|
+
<<ref2>>
|
901
|
+
<<ref3>>
|
902
|
+
<<ref4>>
|
903
|
+
<<ref5>>
|
904
|
+
<<ref6>>
|
905
|
+
<<ref7>>
|
906
|
+
<<ref8>>
|
907
|
+
<<ref9>>
|
908
|
+
<<ref10>>
|
909
|
+
|
910
|
+
[bibliography]
|
911
|
+
== Bibliography
|
912
|
+
|
913
|
+
[bibliography]
|
914
|
+
=== Clause 1
|
915
|
+
* [[[ref3,IEC 123]]], _Standard IEC 123_
|
916
|
+
* [[[ref5,20]]], _Standard 10_
|
917
|
+
* [[[ref1,ISO 123]]], _Standard ISO 123_
|
918
|
+
* [[[ref1a,ISO 123-100]]], _Standard ISO 123_
|
919
|
+
* [[[ref1b,ISO/TS 123-1]]], _Standard ISO 123_
|
920
|
+
* [[[ref4,GB 123]]], _Standard GB 123_
|
921
|
+
* [[[ref2,ISO/IEC 123]]], _Standard ISO/IEC 123_
|
922
|
+
* [[[ref6,(B)]]], _Standard 20_
|
923
|
+
* [[[ref7,(A)]]], _Standard 30_
|
924
|
+
|
925
|
+
[bibliography]
|
926
|
+
=== {blank}
|
927
|
+
* [[[ref15,20]]], _Standard 10_
|
928
|
+
* [[[ref14,GB 123]]], _Standard GB 123_
|
929
|
+
* [[[ref13,IEC 123]]], _Standard IEC 123_
|
930
|
+
* [[[ref11,ISO 123]]], _Standard ISO 123_
|
931
|
+
* [[[ref10,ISO/IEC 123]]], _Standard ISO/IEC 123_
|
932
|
+
* [[[ref16,(B)]]], _Standard 20_
|
933
|
+
* [[[ref17,(A)]]], _Standard 30_
|
819
934
|
INPUT
|
820
|
-
|
935
|
+
#{BLANK_HDR}
|
821
936
|
<sections>
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
937
|
+
<clause id="_" inline-header="false" obligation="normative">
|
938
|
+
<title>Clause 1</title>
|
939
|
+
<p id="_">
|
940
|
+
<eref bibitemid="ref1" citeas="ISO 123" type="inline"/>
|
941
|
+
<eref bibitemid="ref1a" citeas="ISO 123-100" type="inline"/>
|
942
|
+
<eref bibitemid="ref1b" citeas="ISO/TS 123-1" type="inline"/>
|
943
|
+
<eref bibitemid="ref2" citeas="ISO/IEC 123" type="inline"/>
|
944
|
+
<eref bibitemid="ref3" citeas="IEC 123" type="inline"/>
|
945
|
+
<eref bibitemid="ref4" citeas="GB 123" type="inline"/>
|
946
|
+
<eref bibitemid="ref5" citeas="[6]" type="inline"/>
|
947
|
+
<eref bibitemid="ref6" citeas="[B]" type="inline"/>
|
948
|
+
<eref bibitemid="ref7" citeas="[A]" type="inline"/>
|
949
|
+
<xref target="ref8"/>
|
950
|
+
<xref target="ref9"/>
|
951
|
+
<eref bibitemid="ref10" citeas="ISO/IEC 123" type="inline"/>
|
952
|
+
</p>
|
953
|
+
</clause>
|
954
|
+
</sections>
|
955
|
+
<bibliography>
|
956
|
+
<clause id="_" obligation="informative">
|
957
|
+
<title>Bibliography</title>
|
958
|
+
<references id="_" normative="false" obligation="informative">
|
959
|
+
<title>Clause 1</title>
|
960
|
+
<bibitem id="ref1" type="standard">
|
961
|
+
<title format="text/plain">Standard ISO 123</title>
|
962
|
+
<docidentifier>ISO 123</docidentifier>
|
963
|
+
<docnumber>123</docnumber>
|
964
|
+
<contributor>
|
965
|
+
<role type="publisher"/>
|
966
|
+
<organization>
|
967
|
+
<name>International Organization for Standardization</name>
|
968
|
+
<abbreviation>ISO</abbreviation>
|
969
|
+
</organization>
|
970
|
+
</contributor>
|
971
|
+
</bibitem>
|
972
|
+
<bibitem id="ref2" type="standard">
|
973
|
+
<title format="text/plain">Standard ISO/IEC 123</title>
|
974
|
+
<docidentifier>ISO/IEC 123</docidentifier>
|
975
|
+
<docnumber>123</docnumber>
|
976
|
+
<contributor>
|
977
|
+
<role type="publisher"/>
|
978
|
+
<organization>
|
979
|
+
<name>International Organization for Standardization</name>
|
980
|
+
<abbreviation>ISO</abbreviation>
|
981
|
+
</organization>
|
982
|
+
</contributor>
|
983
|
+
<contributor>
|
984
|
+
<role type="publisher"/>
|
985
|
+
<organization>
|
986
|
+
<name>International Electrotechnical Commission</name>
|
987
|
+
<abbreviation>IEC</abbreviation>
|
988
|
+
</organization>
|
989
|
+
</contributor>
|
990
|
+
</bibitem>
|
991
|
+
<bibitem id="ref1b" type="standard">
|
992
|
+
<title format="text/plain">Standard ISO 123</title>
|
993
|
+
<docidentifier>ISO/TS 123-1</docidentifier>
|
994
|
+
<docnumber>123-1</docnumber>
|
995
|
+
<contributor>
|
996
|
+
<role type="publisher"/>
|
997
|
+
<organization>
|
998
|
+
<name>International Organization for Standardization</name>
|
999
|
+
<abbreviation>ISO</abbreviation>
|
1000
|
+
</organization>
|
1001
|
+
</contributor>
|
1002
|
+
<contributor>
|
1003
|
+
<role type="publisher"/>
|
1004
|
+
<organization>
|
1005
|
+
<name>TS</name>
|
1006
|
+
</organization>
|
1007
|
+
</contributor>
|
1008
|
+
</bibitem>
|
1009
|
+
<bibitem id="ref1a" type="standard">
|
1010
|
+
<title format="text/plain">Standard ISO 123</title>
|
1011
|
+
<docidentifier>ISO 123-100</docidentifier>
|
1012
|
+
<docnumber>123-100</docnumber>
|
1013
|
+
<contributor>
|
1014
|
+
<role type="publisher"/>
|
1015
|
+
<organization>
|
1016
|
+
<name>International Organization for Standardization</name>
|
1017
|
+
<abbreviation>ISO</abbreviation>
|
1018
|
+
</organization>
|
1019
|
+
</contributor>
|
1020
|
+
</bibitem>
|
1021
|
+
<bibitem id="ref3" type="standard">
|
1022
|
+
<title format="text/plain">Standard IEC 123</title>
|
1023
|
+
<docidentifier>IEC 123</docidentifier>
|
1024
|
+
<docnumber>123</docnumber>
|
1025
|
+
<contributor>
|
1026
|
+
<role type="publisher"/>
|
1027
|
+
<organization>
|
1028
|
+
<name>International Electrotechnical Commission</name>
|
1029
|
+
<abbreviation>IEC</abbreviation>
|
1030
|
+
</organization>
|
1031
|
+
</contributor>
|
1032
|
+
</bibitem>
|
1033
|
+
<bibitem id="ref5">
|
1034
|
+
<formattedref format="application/x-isodoc+xml">
|
1035
|
+
<em>Standard 10</em>
|
1036
|
+
</formattedref>
|
1037
|
+
<docidentifier type="metanorma">[6]</docidentifier>
|
1038
|
+
</bibitem>
|
1039
|
+
<bibitem id="ref6">
|
1040
|
+
<formattedref format="application/x-isodoc+xml">
|
1041
|
+
<em>Standard 20</em>
|
1042
|
+
</formattedref>
|
1043
|
+
<docidentifier type="metanorma">[B]</docidentifier>
|
1044
|
+
</bibitem>
|
1045
|
+
<bibitem id="ref7">
|
1046
|
+
<formattedref format="application/x-isodoc+xml">
|
1047
|
+
<em>Standard 30</em>
|
1048
|
+
</formattedref>
|
1049
|
+
<docidentifier type="metanorma">[A]</docidentifier>
|
1050
|
+
</bibitem>
|
1051
|
+
<bibitem id="ref4">
|
1052
|
+
<formattedref format="application/x-isodoc+xml">
|
1053
|
+
<em>Standard GB 123</em>
|
1054
|
+
</formattedref>
|
1055
|
+
<docidentifier>GB 123</docidentifier>
|
1056
|
+
<docnumber>123</docnumber>
|
1057
|
+
</bibitem>
|
1058
|
+
</references>
|
1059
|
+
<references id="_" normative="false" obligation="informative">
|
1060
|
+
<bibitem id="ref11" type="standard">
|
1061
|
+
<title format="text/plain">Standard ISO 123</title>
|
1062
|
+
<docidentifier>ISO 123</docidentifier>
|
1063
|
+
<docnumber>123</docnumber>
|
1064
|
+
<contributor>
|
1065
|
+
<role type="publisher"/>
|
1066
|
+
<organization>
|
1067
|
+
<name>International Organization for Standardization</name>
|
1068
|
+
<abbreviation>ISO</abbreviation>
|
1069
|
+
</organization>
|
1070
|
+
</contributor>
|
1071
|
+
</bibitem>
|
1072
|
+
<bibitem id="ref10" type="standard">
|
1073
|
+
<title format="text/plain">Standard ISO/IEC 123</title>
|
1074
|
+
<docidentifier>ISO/IEC 123</docidentifier>
|
1075
|
+
<docnumber>123</docnumber>
|
1076
|
+
<contributor>
|
1077
|
+
<role type="publisher"/>
|
1078
|
+
<organization>
|
1079
|
+
<name>International Organization for Standardization</name>
|
1080
|
+
<abbreviation>ISO</abbreviation>
|
1081
|
+
</organization>
|
1082
|
+
</contributor>
|
1083
|
+
<contributor>
|
1084
|
+
<role type="publisher"/>
|
1085
|
+
<organization>
|
1086
|
+
<name>International Electrotechnical Commission</name>
|
1087
|
+
<abbreviation>IEC</abbreviation>
|
1088
|
+
</organization>
|
1089
|
+
</contributor>
|
1090
|
+
</bibitem>
|
1091
|
+
<bibitem id="ref13" type="standard">
|
1092
|
+
<title format="text/plain">Standard IEC 123</title>
|
1093
|
+
<docidentifier>IEC 123</docidentifier>
|
1094
|
+
<docnumber>123</docnumber>
|
1095
|
+
<contributor>
|
1096
|
+
<role type="publisher"/>
|
1097
|
+
<organization>
|
1098
|
+
<name>International Electrotechnical Commission</name>
|
1099
|
+
<abbreviation>IEC</abbreviation>
|
1100
|
+
</organization>
|
1101
|
+
</contributor>
|
1102
|
+
</bibitem>
|
1103
|
+
<bibitem id="ref15">
|
1104
|
+
<formattedref format="application/x-isodoc+xml">
|
1105
|
+
<em>Standard 10</em>
|
1106
|
+
</formattedref>
|
1107
|
+
<docidentifier type="metanorma">[13]</docidentifier>
|
1108
|
+
</bibitem>
|
1109
|
+
<bibitem id="ref16">
|
1110
|
+
<formattedref format="application/x-isodoc+xml">
|
1111
|
+
<em>Standard 20</em>
|
1112
|
+
</formattedref>
|
1113
|
+
<docidentifier type="metanorma">[B]</docidentifier>
|
1114
|
+
</bibitem>
|
1115
|
+
<bibitem id="ref17">
|
1116
|
+
<formattedref format="application/x-isodoc+xml">
|
1117
|
+
<em>Standard 30</em>
|
1118
|
+
</formattedref>
|
1119
|
+
<docidentifier type="metanorma">[A]</docidentifier>
|
1120
|
+
</bibitem>
|
1121
|
+
<bibitem id="ref14">
|
1122
|
+
<formattedref format="application/x-isodoc+xml">
|
1123
|
+
<em>Standard GB 123</em>
|
1124
|
+
</formattedref>
|
1125
|
+
<docidentifier>GB 123</docidentifier>
|
1126
|
+
<docnumber>123</docnumber>
|
1127
|
+
</bibitem>
|
1128
|
+
</references>
|
1129
|
+
</clause>
|
1130
|
+
</bibliography>
|
1131
|
+
</iso-standard>
|
1017
1132
|
OUTPUT
|
1018
1133
|
end
|
1019
1134
|
end
|