metanorma-iso 1.7.1 → 1.8.1
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 +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/iso/base.rb +18 -16
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +28 -24
- data/lib/asciidoctor/iso/front.rb +26 -16
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/isodoc.rng +172 -3
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +17 -97
- data/lib/asciidoctor/iso/validate.rb +22 -109
- data/lib/asciidoctor/iso/validate_image.rb +97 -0
- data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
- data/lib/asciidoctor/iso/validate_section.rb +39 -20
- data/lib/asciidoctor/iso/validate_style.rb +36 -24
- data/lib/asciidoctor/iso/validate_title.rb +23 -17
- data/lib/isodoc/iso/base_convert.rb +19 -2
- data/lib/isodoc/iso/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/html_convert.rb +0 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1092 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +1092 -208
- data/lib/isodoc/iso/presentation_xml_convert.rb +45 -37
- data/lib/isodoc/iso/word_convert.rb +0 -1
- data/lib/isodoc/iso/xref.rb +15 -7
- data/lib/metanorma/iso/processor.rb +1 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +8 -8
- data/spec/asciidoctor/amd_spec.rb +696 -0
- data/spec/asciidoctor/base_spec.rb +733 -0
- data/spec/asciidoctor/blocks_spec.rb +527 -0
- data/spec/asciidoctor/cleanup_spec.rb +1134 -0
- data/spec/asciidoctor/inline_spec.rb +195 -0
- data/spec/asciidoctor/lists_spec.rb +197 -0
- data/spec/asciidoctor/refs_spec.rb +375 -0
- data/spec/asciidoctor/section_spec.rb +393 -0
- data/spec/asciidoctor/table_spec.rb +329 -0
- data/spec/asciidoctor/validate_spec.rb +1627 -0
- 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 +836 -657
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +821 -519
- 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 +178 -193
- metadata +65 -66
- data/.rubocop.ribose.yml +0 -66
- data/lib/isodoc/iso/html/scripts.html +0 -178
- data/spec/asciidoctor-iso/amd_spec.rb +0 -694
- data/spec/asciidoctor-iso/base_spec.rb +0 -713
- data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
- data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
- data/spec/asciidoctor-iso/inline_spec.rb +0 -170
- data/spec/asciidoctor-iso/lists_spec.rb +0 -190
- data/spec/asciidoctor-iso/refs_spec.rb +0 -317
- data/spec/asciidoctor-iso/section_spec.rb +0 -362
- data/spec/asciidoctor-iso/table_spec.rb +0 -313
- data/spec/asciidoctor-iso/validate_spec.rb +0 -1621
- data/spec/assets/xref_error.adoc +0 -7
@@ -0,0 +1,393 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Asciidoctor::ISO do
|
4
|
+
it "processes sections" do
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
|
+
#{ASCIIDOC_BLANK_HDR}
|
7
|
+
== Foreword
|
8
|
+
|
9
|
+
Text
|
10
|
+
|
11
|
+
== Introduction
|
12
|
+
|
13
|
+
=== Introduction Subsection
|
14
|
+
|
15
|
+
== Scope
|
16
|
+
|
17
|
+
Text
|
18
|
+
|
19
|
+
== Acknowledgements
|
20
|
+
|
21
|
+
== Normative References
|
22
|
+
|
23
|
+
== Terms and Definitions
|
24
|
+
|
25
|
+
=== Term1
|
26
|
+
|
27
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
28
|
+
|
29
|
+
=== Normal Terms
|
30
|
+
|
31
|
+
==== Term2
|
32
|
+
|
33
|
+
=== Symbols and Abbreviated Terms
|
34
|
+
|
35
|
+
== Symbols and Abbreviated Terms
|
36
|
+
|
37
|
+
== Clause 4
|
38
|
+
|
39
|
+
=== Introduction
|
40
|
+
|
41
|
+
=== Clause 4.2
|
42
|
+
|
43
|
+
== Terms and Definitions
|
44
|
+
|
45
|
+
[appendix]
|
46
|
+
== Annex
|
47
|
+
|
48
|
+
=== Annex A.1
|
49
|
+
|
50
|
+
[%appendix]
|
51
|
+
=== Appendix 1
|
52
|
+
|
53
|
+
==== Appendix subclause
|
54
|
+
|
55
|
+
== Bibliography
|
56
|
+
|
57
|
+
=== Bibliography Subsection
|
58
|
+
INPUT
|
59
|
+
#{BLANK_HDR}
|
60
|
+
<preface>
|
61
|
+
<foreword id="_" obligation="informative">
|
62
|
+
<title>Foreword</title>
|
63
|
+
<p id="_">Text</p>
|
64
|
+
</foreword>
|
65
|
+
<introduction id="_" obligation="informative">
|
66
|
+
<title>Introduction</title>
|
67
|
+
<clause id="_" inline-header="false" obligation="informative">
|
68
|
+
<title>Introduction Subsection</title>
|
69
|
+
</clause>
|
70
|
+
</introduction>
|
71
|
+
<acknowledgements id="_" obligation="informative">
|
72
|
+
<title>Acknowledgements</title>
|
73
|
+
</acknowledgements>
|
74
|
+
</preface>
|
75
|
+
<sections>
|
76
|
+
<clause id="_" inline-header="false" obligation="normative" type="scope">
|
77
|
+
<title>Scope</title>
|
78
|
+
<p id="_">Text</p>
|
79
|
+
</clause>
|
80
|
+
<terms id="_" obligation="normative">
|
81
|
+
<title>Terms and definitions</title>
|
82
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
83
|
+
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
84
|
+
<ul id="_">
|
85
|
+
<li>
|
86
|
+
<p id="_">ISO Online browsing platform: available at
|
87
|
+
|
88
|
+
<link target="http://www.iso.org/obp"/></p>
|
89
|
+
</li>
|
90
|
+
<li>
|
91
|
+
<p id="_">IEC Electropedia: available at
|
92
|
+
|
93
|
+
<link target="http://www.electropedia.org"/></p>
|
94
|
+
</li>
|
95
|
+
</ul>
|
96
|
+
<term id="term-term1">
|
97
|
+
<preferred>Term1</preferred>
|
98
|
+
</term>
|
99
|
+
</terms>
|
100
|
+
<clause id="_" obligation="normative">
|
101
|
+
<title>Terms, definitions, symbols and abbreviated terms</title>
|
102
|
+
<terms id="_" obligation="normative">
|
103
|
+
<title>Normal Terms</title>
|
104
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
105
|
+
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
106
|
+
<ul id="_">
|
107
|
+
<li>
|
108
|
+
<p id="_">ISO Online browsing platform: available at
|
109
|
+
|
110
|
+
<link target="http://www.iso.org/obp"/></p>
|
111
|
+
</li>
|
112
|
+
<li>
|
113
|
+
<p id="_">IEC Electropedia: available at
|
114
|
+
|
115
|
+
<link target="http://www.electropedia.org"/></p>
|
116
|
+
</li>
|
117
|
+
</ul>
|
118
|
+
<term id="term-term2">
|
119
|
+
<preferred>Term2</preferred>
|
120
|
+
</term>
|
121
|
+
</terms>
|
122
|
+
<definitions id="_" obligation="normative">
|
123
|
+
<title>Symbols and abbreviated terms</title>
|
124
|
+
</definitions>
|
125
|
+
</clause>
|
126
|
+
<definitions id="_" obligation="normative">
|
127
|
+
<title>Symbols and abbreviated terms</title>
|
128
|
+
</definitions>
|
129
|
+
<clause id="_" inline-header="false" obligation="normative">
|
130
|
+
<title>Clause 4</title>
|
131
|
+
<clause id="_" inline-header="false" obligation="normative">
|
132
|
+
<title>Introduction</title>
|
133
|
+
</clause>
|
134
|
+
<clause id="_" inline-header="false" obligation="normative">
|
135
|
+
<title>Clause 4.2</title>
|
136
|
+
</clause>
|
137
|
+
</clause>
|
138
|
+
<clause id="_" inline-header="false" obligation="normative">
|
139
|
+
<title>Terms and Definitions</title>
|
140
|
+
</clause>
|
141
|
+
</sections>
|
142
|
+
<annex id="_" inline-header="false" obligation="normative">
|
143
|
+
<title>Annex</title>
|
144
|
+
<clause id="_" inline-header="false" obligation="normative">
|
145
|
+
<title>Annex A.1</title>
|
146
|
+
</clause>
|
147
|
+
<appendix id="_" inline-header="false" obligation="normative">
|
148
|
+
<title>Appendix 1</title>
|
149
|
+
<clause id="_" inline-header="false" obligation="normative">
|
150
|
+
<title>Appendix subclause</title>
|
151
|
+
</clause>
|
152
|
+
</appendix>
|
153
|
+
</annex>
|
154
|
+
<bibliography>
|
155
|
+
<references id="_" normative="true" obligation="informative">
|
156
|
+
<title>Normative references</title>
|
157
|
+
<p id="_">There are no normative references in this document.</p>
|
158
|
+
</references>
|
159
|
+
<clause id="_" obligation="informative">
|
160
|
+
<title>Bibliography</title>
|
161
|
+
<references id="_" normative="false" obligation="informative">
|
162
|
+
<title>Bibliography Subsection</title>
|
163
|
+
</references>
|
164
|
+
</clause>
|
165
|
+
</bibliography>
|
166
|
+
</iso-standard>
|
167
|
+
OUTPUT
|
168
|
+
end
|
169
|
+
|
170
|
+
it "processes section obligations" do
|
171
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
172
|
+
#{ASCIIDOC_BLANK_HDR}
|
173
|
+
[obligation=informative]
|
174
|
+
== Clause 1
|
175
|
+
|
176
|
+
=== Clause 1a
|
177
|
+
|
178
|
+
[obligation=normative]
|
179
|
+
== Clause 2
|
180
|
+
|
181
|
+
[appendix,obligation=informative]
|
182
|
+
== Annex
|
183
|
+
INPUT
|
184
|
+
#{BLANK_HDR}
|
185
|
+
<sections>
|
186
|
+
<clause id="_" inline-header="false" obligation="informative">
|
187
|
+
<title>Clause 1</title>
|
188
|
+
<clause id="_" inline-header="false" obligation="informative">
|
189
|
+
<title>Clause 1a</title>
|
190
|
+
</clause>
|
191
|
+
</clause>
|
192
|
+
<clause id="_" inline-header="false" obligation="normative">
|
193
|
+
<title>Clause 2</title>
|
194
|
+
</clause>
|
195
|
+
</sections>
|
196
|
+
<annex id="_" inline-header="false" obligation="informative">
|
197
|
+
<title>Annex</title>
|
198
|
+
</annex>
|
199
|
+
</iso-standard>
|
200
|
+
OUTPUT
|
201
|
+
end
|
202
|
+
|
203
|
+
it "processes inline headers" do
|
204
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
205
|
+
#{ASCIIDOC_BLANK_HDR}
|
206
|
+
== Clause 1
|
207
|
+
|
208
|
+
[%inline-header]
|
209
|
+
=== Clause 1a
|
210
|
+
|
211
|
+
[appendix]
|
212
|
+
== Annex A
|
213
|
+
|
214
|
+
[%inline-header]
|
215
|
+
=== Clause Aa
|
216
|
+
INPUT
|
217
|
+
#{BLANK_HDR}
|
218
|
+
<sections>
|
219
|
+
<clause id="_" inline-header="false" obligation="normative">
|
220
|
+
<title>Clause 1</title>
|
221
|
+
<clause id="_" inline-header="true" obligation="normative">
|
222
|
+
<title>Clause 1a</title>
|
223
|
+
</clause>
|
224
|
+
</clause>
|
225
|
+
</sections>
|
226
|
+
<annex id="_" inline-header="false" obligation="normative">
|
227
|
+
<title>Annex A</title>
|
228
|
+
<clause id="_" inline-header="true" obligation="normative">
|
229
|
+
<title>Clause Aa</title>
|
230
|
+
</clause>
|
231
|
+
</annex>
|
232
|
+
</iso-standard>
|
233
|
+
OUTPUT
|
234
|
+
end
|
235
|
+
|
236
|
+
it "processes blank headers" do
|
237
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
238
|
+
#{ASCIIDOC_BLANK_HDR}
|
239
|
+
== Clause 1
|
240
|
+
|
241
|
+
=== {blank}
|
242
|
+
|
243
|
+
INPUT
|
244
|
+
#{BLANK_HDR}
|
245
|
+
<sections>
|
246
|
+
<clause id="_" inline-header="false" obligation="normative">
|
247
|
+
<title>Clause 1</title>
|
248
|
+
<clause id="_" inline-header="false" obligation="normative"/>
|
249
|
+
</clause>
|
250
|
+
</sections>
|
251
|
+
</iso-standard>
|
252
|
+
OUTPUT
|
253
|
+
end
|
254
|
+
|
255
|
+
it "processes terms & definitions with external source" do
|
256
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
257
|
+
#{ASCIIDOC_BLANK_HDR}
|
258
|
+
|
259
|
+
Foreword
|
260
|
+
|
261
|
+
[source="iso1234,iso5678"]
|
262
|
+
== Terms and Definitions
|
263
|
+
|
264
|
+
=== Term1
|
265
|
+
|
266
|
+
INPUT
|
267
|
+
#{BLANK_HDR.sub(/<boilerplate>/, '<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><boilerplate>')}
|
268
|
+
<preface>
|
269
|
+
<foreword id="_" obligation="informative">
|
270
|
+
<title>Foreword</title>
|
271
|
+
<p id="_">Foreword</p>
|
272
|
+
</foreword>
|
273
|
+
</preface>
|
274
|
+
<sections>
|
275
|
+
<terms id="_" obligation="normative">
|
276
|
+
<title>Terms and definitions</title>
|
277
|
+
<p id="_">For the purposes of this document, the terms and definitions
|
278
|
+
given in <eref bibitemid="iso1234"/>
|
279
|
+
and <eref bibitemid="iso5678"/>
|
280
|
+
and the following apply.</p>
|
281
|
+
<p id="_">ISO and IEC maintain terminological databases for use in
|
282
|
+
standardization at the following addresses:</p>
|
283
|
+
<ul id="_">
|
284
|
+
<li>
|
285
|
+
<p id="_">ISO Online browsing platform: available at
|
286
|
+
|
287
|
+
<link target="http://www.iso.org/obp"/></p>
|
288
|
+
</li>
|
289
|
+
<li>
|
290
|
+
<p id="_">IEC Electropedia: available at
|
291
|
+
|
292
|
+
<link target="http://www.electropedia.org"/></p>
|
293
|
+
</li>
|
294
|
+
</ul>
|
295
|
+
<term id="term-term1">
|
296
|
+
<preferred>Term1</preferred>
|
297
|
+
</term>
|
298
|
+
</terms>
|
299
|
+
</sections>
|
300
|
+
</iso-standard>
|
301
|
+
OUTPUT
|
302
|
+
end
|
303
|
+
|
304
|
+
it "processes empty terms & definitions" do
|
305
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
306
|
+
#{ASCIIDOC_BLANK_HDR}
|
307
|
+
|
308
|
+
Foreword
|
309
|
+
|
310
|
+
== Terms and Definitions
|
311
|
+
|
312
|
+
|
313
|
+
INPUT
|
314
|
+
#{BLANK_HDR}
|
315
|
+
<preface>
|
316
|
+
<foreword id="_" obligation="informative">
|
317
|
+
<title>Foreword</title>
|
318
|
+
<p id="_">Foreword</p>
|
319
|
+
</foreword>
|
320
|
+
</preface>
|
321
|
+
<sections>
|
322
|
+
<terms id='_' obligation='normative'>
|
323
|
+
<title>Terms and definitions</title>
|
324
|
+
<p id='_'>No terms and definitions are listed in this document.</p>
|
325
|
+
<p id='_'>
|
326
|
+
ISO and IEC maintain terminological databases for use in standardization
|
327
|
+
at the following addresses:
|
328
|
+
</p>
|
329
|
+
<ul id='_'>
|
330
|
+
<li>
|
331
|
+
<p id='_'>
|
332
|
+
ISO Online browsing platform: available at
|
333
|
+
<link target='http://www.iso.org/obp'/>
|
334
|
+
</p>
|
335
|
+
</li>
|
336
|
+
<li>
|
337
|
+
<p id='_'>
|
338
|
+
IEC Electropedia: available at
|
339
|
+
<link target='http://www.electropedia.org'/>
|
340
|
+
</p>
|
341
|
+
</li>
|
342
|
+
</ul>
|
343
|
+
</terms>
|
344
|
+
</sections>
|
345
|
+
</iso-standard>
|
346
|
+
|
347
|
+
OUTPUT
|
348
|
+
end
|
349
|
+
|
350
|
+
it "processes empty terms & definitions with external source" do
|
351
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
352
|
+
#{ASCIIDOC_BLANK_HDR}
|
353
|
+
|
354
|
+
Foreword
|
355
|
+
|
356
|
+
[source="iso1234,iso5678"]
|
357
|
+
== Terms and Definitions
|
358
|
+
|
359
|
+
INPUT
|
360
|
+
#{BLANK_HDR.sub(/<boilerplate>/, '<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><boilerplate>')}
|
361
|
+
<preface>
|
362
|
+
<foreword id="_" obligation="informative">
|
363
|
+
<title>Foreword</title>
|
364
|
+
<p id="_">Foreword</p>
|
365
|
+
</foreword>
|
366
|
+
</preface>
|
367
|
+
<sections>
|
368
|
+
<terms id="_" obligation="normative">
|
369
|
+
<title>Terms and definitions</title>
|
370
|
+
<p id="_">For the purposes of this document,
|
371
|
+
the terms and definitions given in <eref bibitemid="iso1234"/>
|
372
|
+
and <eref bibitemid="iso5678"/>
|
373
|
+
apply.
|
374
|
+
</p>
|
375
|
+
<p id="_">ISO and IEC maintain terminological databases for use in standardization at the following addresses:</p>
|
376
|
+
<ul id="_">
|
377
|
+
<li>
|
378
|
+
<p id="_">ISO Online browsing platform: available at
|
379
|
+
|
380
|
+
<link target="http://www.iso.org/obp"/></p>
|
381
|
+
</li>
|
382
|
+
<li>
|
383
|
+
<p id="_">IEC Electropedia: available at
|
384
|
+
|
385
|
+
<link target="http://www.electropedia.org"/></p>
|
386
|
+
</li>
|
387
|
+
</ul>
|
388
|
+
</terms>
|
389
|
+
</sections>
|
390
|
+
</iso-standard>
|
391
|
+
OUTPUT
|
392
|
+
end
|
393
|
+
end
|
@@ -0,0 +1,329 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Asciidoctor::ISO do
|
4
|
+
it "processes basic tables" do
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
|
+
#{ASCIIDOC_BLANK_HDR}
|
7
|
+
.Table Name
|
8
|
+
|===
|
9
|
+
|A |B |C
|
10
|
+
|
11
|
+
h|1 |2 |3
|
12
|
+
|===
|
13
|
+
INPUT
|
14
|
+
#{BLANK_HDR}
|
15
|
+
<sections>
|
16
|
+
<table id="_">
|
17
|
+
<name>Table Name</name>
|
18
|
+
<thead>
|
19
|
+
<tr>
|
20
|
+
<th align="left" valign="top">A</th>
|
21
|
+
<th align="left" valign="top">B</th>
|
22
|
+
<th align="left" valign="top">C</th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<th align="left" valign="top">1</th>
|
28
|
+
<td align="left" valign="top">2</td>
|
29
|
+
<td align="left" valign="top">3</td>
|
30
|
+
</tr>
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
</sections>
|
34
|
+
</iso-standard>
|
35
|
+
OUTPUT
|
36
|
+
end
|
37
|
+
|
38
|
+
it "inserts header rows in a table with a name and no header" do
|
39
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
40
|
+
#{ASCIIDOC_BLANK_HDR}
|
41
|
+
[headerrows=2]
|
42
|
+
.Table Name
|
43
|
+
|===
|
44
|
+
|A |B |C
|
45
|
+
h|1 |2 |3
|
46
|
+
h|1 |2 |3
|
47
|
+
|===
|
48
|
+
INPUT
|
49
|
+
#{BLANK_HDR}
|
50
|
+
<sections>
|
51
|
+
<table id="_">
|
52
|
+
<name>Table Name</name>
|
53
|
+
<thead>
|
54
|
+
<tr>
|
55
|
+
<th align="left" valign="top">A</th>
|
56
|
+
<th align="left" valign="top">B</th>
|
57
|
+
<th align="left" valign="top">C</th>
|
58
|
+
</tr>
|
59
|
+
<tr>
|
60
|
+
<th align="left" valign="top">1</th>
|
61
|
+
<th align="left" valign="top">2</th>
|
62
|
+
<th align="left" valign="top">3</th>
|
63
|
+
</tr>
|
64
|
+
</thead>
|
65
|
+
<tbody>
|
66
|
+
<tr>
|
67
|
+
<th align="left" valign="top">1</th>
|
68
|
+
<td align="left" valign="top">2</td>
|
69
|
+
<td align="left" valign="top">3</td>
|
70
|
+
</tr>
|
71
|
+
</tbody>
|
72
|
+
</table>
|
73
|
+
</sections>
|
74
|
+
</iso-standard>
|
75
|
+
OUTPUT
|
76
|
+
end
|
77
|
+
|
78
|
+
it "inserts header rows in a table without a name and no header" do
|
79
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
80
|
+
#{ASCIIDOC_BLANK_HDR}
|
81
|
+
[headerrows=2]
|
82
|
+
|===
|
83
|
+
|A |B |C
|
84
|
+
h|1 |2 |3
|
85
|
+
h|1 |2 |3
|
86
|
+
|===
|
87
|
+
INPUT
|
88
|
+
#{BLANK_HDR}
|
89
|
+
<sections>
|
90
|
+
<table id="_">
|
91
|
+
<thead>
|
92
|
+
<tr>
|
93
|
+
<th align="left" valign="top">A</th>
|
94
|
+
<th align="left" valign="top">B</th>
|
95
|
+
<th align="left" valign="top">C</th>
|
96
|
+
</tr>
|
97
|
+
<tr>
|
98
|
+
<th align="left" valign="top">1</th>
|
99
|
+
<th align="left" valign="top">2</th>
|
100
|
+
<th align="left" valign="top">3</th>
|
101
|
+
</tr>
|
102
|
+
</thead>
|
103
|
+
<tbody>
|
104
|
+
<tr>
|
105
|
+
<th align="left" valign="top">1</th>
|
106
|
+
<td align="left" valign="top">2</td>
|
107
|
+
<td align="left" valign="top">3</td>
|
108
|
+
</tr>
|
109
|
+
</tbody>
|
110
|
+
</table>
|
111
|
+
</sections>
|
112
|
+
</iso-standard>
|
113
|
+
OUTPUT
|
114
|
+
end
|
115
|
+
|
116
|
+
it "processes complex tables" do
|
117
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
118
|
+
#{ASCIIDOC_BLANK_HDR}
|
119
|
+
[cols="<,^,^,^,^",options="header,footer",headerrows=2]
|
120
|
+
.Maximum permissible mass fraction of defects
|
121
|
+
|===
|
122
|
+
.2+|Defect 4+^| Maximum permissible mass fraction of defects in husked rice +
|
123
|
+
stem:[w_max]
|
124
|
+
| in husked rice | in milled rice (non-glutinous) | in husked parboiled rice | in milled parboiled rice
|
125
|
+
|
126
|
+
| Extraneous matter: organic footnote:[Organic extraneous matter includes foreign seeds, husks, bran, parts of straw, etc.] | 1,0 | 0,5 | 1,0 | 0,5
|
127
|
+
// not rendered list here
|
128
|
+
| Extraneous matter: inorganic footnote:[Inorganic extraneous matter includes stones, sand, dust, etc.] | 0,5 | 0,5 | 0,5 | 0,5
|
129
|
+
| Paddy | 2,5 | 0,3 | 2,5 | 0,3
|
130
|
+
| Husked rice, non-parboiled | Not applicable | 1,0 | 1,0 | 1,0
|
131
|
+
| Milled rice, non-parboiled | 1,0 | Not applicable | 1,0 | 1,0
|
132
|
+
| Husked rice, parboiled | 1,0 | 1,0 | Not applicable | 1,0
|
133
|
+
| Milled rice, parboiled | 1,0 | 1,0 | 1,0 | Not applicable
|
134
|
+
| Chips | 0,1 | 0,1 | 0,1 | 0,1
|
135
|
+
| HDK | 2,0 footnote:defectsmass[The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.] | 2,0 | 2,0 footnote:defectsmass[] | 2,0
|
136
|
+
| Damaged kernels | 4,0 | 3,0 | 4,0 | 3,0
|
137
|
+
| Immature and/or malformed kernels | 8,0 | 2,0 | 8,0 | 2,0
|
138
|
+
| Chalky kernels | 5,0 footnote:defectsmass[] | 5,0 | Not applicable | Not applicable
|
139
|
+
| Red kernels and red-streaked kernels | 12,0 | 12,0 | 12,0 footnote:defectsmass[] | 12,0
|
140
|
+
| Partly gelatinized kernels | Not applicable | Not applicable | 11,0 footnote:defectsmass[] | 11,0
|
141
|
+
| Pecks | Not applicable | Not applicable | 4,0 | 2,0
|
142
|
+
| Waxy rice | 1,0 footnote:defectsmass[] | 1,0 | 1,0 footnote:defectsmass[] | 1,0
|
143
|
+
|
144
|
+
5+a| Live insects shall not be present. Dead insects shall be included in extraneous matter.
|
145
|
+
|===
|
146
|
+
INPUT
|
147
|
+
#{BLANK_HDR}
|
148
|
+
<sections>
|
149
|
+
<table id="_">
|
150
|
+
<name>Maximum permissible mass fraction of defects</name>
|
151
|
+
<thead>
|
152
|
+
<tr>
|
153
|
+
<th align="left" rowspan="2" valign="top">Defect</th>
|
154
|
+
<th align="center" colspan="4" valign="top">Maximum permissible mass fraction of defects in husked rice
|
155
|
+
<br/>
|
156
|
+
<stem type="MathML">
|
157
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
158
|
+
<msub>
|
159
|
+
<mrow>
|
160
|
+
<mi>w</mi></mrow>
|
161
|
+
<mrow>
|
162
|
+
<mo>max</mo>
|
163
|
+
</mrow>
|
164
|
+
</msub>
|
165
|
+
</math>
|
166
|
+
</stem>
|
167
|
+
</th>
|
168
|
+
</tr>
|
169
|
+
<tr>
|
170
|
+
<th align="left" valign="top">in husked rice</th>
|
171
|
+
<th align="center" valign="top">in milled rice (non-glutinous)</th>
|
172
|
+
<th align="center" valign="top">in husked parboiled rice</th>
|
173
|
+
<th align="center" valign="top">in milled parboiled rice</th>
|
174
|
+
</tr>
|
175
|
+
</thead>
|
176
|
+
<tbody>
|
177
|
+
<tr>
|
178
|
+
<td align="left" valign="top">Extraneous matter: organic
|
179
|
+
<fn reference="a">
|
180
|
+
<p id="_">Organic extraneous matter includes foreign seeds, husks, bran, parts of straw, etc.</p></fn>
|
181
|
+
</td>
|
182
|
+
<td align="center" valign="top">1,0</td>
|
183
|
+
<td align="center" valign="top">0,5</td>
|
184
|
+
<td align="center" valign="top">1,0</td>
|
185
|
+
<td align="center" valign="top">0,5</td>
|
186
|
+
</tr>
|
187
|
+
<tr>
|
188
|
+
<td align="left" valign="top">Extraneous matter: inorganic
|
189
|
+
<fn reference="b">
|
190
|
+
<p id="_">Inorganic extraneous matter includes stones, sand, dust, etc.</p></fn>
|
191
|
+
</td>
|
192
|
+
<td align="center" valign="top">0,5</td>
|
193
|
+
<td align="center" valign="top">0,5</td>
|
194
|
+
<td align="center" valign="top">0,5</td>
|
195
|
+
<td align="center" valign="top">0,5</td>
|
196
|
+
</tr>
|
197
|
+
<tr>
|
198
|
+
<td align="left" valign="top">Paddy</td>
|
199
|
+
<td align="center" valign="top">2,5</td>
|
200
|
+
<td align="center" valign="top">0,3</td>
|
201
|
+
<td align="center" valign="top">2,5</td>
|
202
|
+
<td align="center" valign="top">0,3</td>
|
203
|
+
</tr>
|
204
|
+
<tr>
|
205
|
+
<td align="left" valign="top">Husked rice, non-parboiled</td>
|
206
|
+
<td align="center" valign="top">Not applicable</td>
|
207
|
+
<td align="center" valign="top">1,0</td>
|
208
|
+
<td align="center" valign="top">1,0</td>
|
209
|
+
<td align="center" valign="top">1,0</td>
|
210
|
+
</tr>
|
211
|
+
<tr>
|
212
|
+
<td align="left" valign="top">Milled rice, non-parboiled</td>
|
213
|
+
<td align="center" valign="top">1,0</td>
|
214
|
+
<td align="center" valign="top">Not applicable</td>
|
215
|
+
<td align="center" valign="top">1,0</td>
|
216
|
+
<td align="center" valign="top">1,0</td>
|
217
|
+
</tr>
|
218
|
+
<tr>
|
219
|
+
<td align="left" valign="top">Husked rice, parboiled</td>
|
220
|
+
<td align="center" valign="top">1,0</td>
|
221
|
+
<td align="center" valign="top">1,0</td>
|
222
|
+
<td align="center" valign="top">Not applicable</td>
|
223
|
+
<td align="center" valign="top">1,0</td>
|
224
|
+
</tr>
|
225
|
+
<tr>
|
226
|
+
<td align="left" valign="top">Milled rice, parboiled</td>
|
227
|
+
<td align="center" valign="top">1,0</td>
|
228
|
+
<td align="center" valign="top">1,0</td>
|
229
|
+
<td align="center" valign="top">1,0</td>
|
230
|
+
<td align="center" valign="top">Not applicable</td>
|
231
|
+
</tr>
|
232
|
+
<tr>
|
233
|
+
<td align="left" valign="top">Chips</td>
|
234
|
+
<td align="center" valign="top">0,1</td>
|
235
|
+
<td align="center" valign="top">0,1</td>
|
236
|
+
<td align="center" valign="top">0,1</td>
|
237
|
+
<td align="center" valign="top">0,1</td>
|
238
|
+
</tr>
|
239
|
+
<tr>
|
240
|
+
<td align="left" valign="top">HDK</td>
|
241
|
+
<td align="center" valign="top">2,0
|
242
|
+
<fn reference="c">
|
243
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
244
|
+
</td>
|
245
|
+
<td align="center" valign="top">2,0</td>
|
246
|
+
<td align="center" valign="top">2,0
|
247
|
+
<fn reference="c">
|
248
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
249
|
+
</td>
|
250
|
+
<td align="center" valign="top">2,0</td>
|
251
|
+
</tr>
|
252
|
+
<tr>
|
253
|
+
<td align="left" valign="top">Damaged kernels</td>
|
254
|
+
<td align="center" valign="top">4,0</td>
|
255
|
+
<td align="center" valign="top">3,0</td>
|
256
|
+
<td align="center" valign="top">4,0</td>
|
257
|
+
<td align="center" valign="top">3,0</td>
|
258
|
+
</tr>
|
259
|
+
<tr>
|
260
|
+
<td align="left" valign="top">Immature and/or malformed kernels</td>
|
261
|
+
<td align="center" valign="top">8,0</td>
|
262
|
+
<td align="center" valign="top">2,0</td>
|
263
|
+
<td align="center" valign="top">8,0</td>
|
264
|
+
<td align="center" valign="top">2,0</td>
|
265
|
+
</tr>
|
266
|
+
<tr>
|
267
|
+
<td align="left" valign="top">Chalky kernels</td>
|
268
|
+
<td align="center" valign="top">5,0
|
269
|
+
<fn reference="c">
|
270
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
271
|
+
</td>
|
272
|
+
<td align="center" valign="top">5,0</td>
|
273
|
+
<td align="center" valign="top">Not applicable</td>
|
274
|
+
<td align="center" valign="top">Not applicable</td>
|
275
|
+
</tr>
|
276
|
+
<tr>
|
277
|
+
<td align="left" valign="top">Red kernels and red-streaked kernels</td>
|
278
|
+
<td align="center" valign="top">12,0</td>
|
279
|
+
<td align="center" valign="top">12,0</td>
|
280
|
+
<td align="center" valign="top">12,0
|
281
|
+
<fn reference="c">
|
282
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
283
|
+
</td>
|
284
|
+
<td align="center" valign="top">12,0</td>
|
285
|
+
</tr>
|
286
|
+
<tr>
|
287
|
+
<td align="left" valign="top">Partly gelatinized kernels</td>
|
288
|
+
<td align="center" valign="top">Not applicable</td>
|
289
|
+
<td align="center" valign="top">Not applicable</td>
|
290
|
+
<td align="center" valign="top">11,0
|
291
|
+
<fn reference="c">
|
292
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
293
|
+
</td>
|
294
|
+
<td align="center" valign="top">11,0</td>
|
295
|
+
</tr>
|
296
|
+
<tr>
|
297
|
+
<td align="left" valign="top">Pecks</td>
|
298
|
+
<td align="center" valign="top">Not applicable</td>
|
299
|
+
<td align="center" valign="top">Not applicable</td>
|
300
|
+
<td align="center" valign="top">4,0</td>
|
301
|
+
<td align="center" valign="top">2,0</td>
|
302
|
+
</tr>
|
303
|
+
<tr>
|
304
|
+
<td align="left" valign="top">Waxy rice</td>
|
305
|
+
<td align="center" valign="top">1,0
|
306
|
+
<fn reference="c">
|
307
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
308
|
+
</td>
|
309
|
+
<td align="center" valign="top">1,0</td>
|
310
|
+
<td align="center" valign="top">1,0
|
311
|
+
<fn reference="c">
|
312
|
+
<p id="_">The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.</p></fn>
|
313
|
+
</td>
|
314
|
+
<td align="center" valign="top">1,0</td>
|
315
|
+
</tr>
|
316
|
+
</tbody>
|
317
|
+
<tfoot>
|
318
|
+
<tr>
|
319
|
+
<td align="left" colspan="5" valign="top">
|
320
|
+
<p id="_">Live insects shall not be present. Dead insects shall be included in extraneous matter.</p>
|
321
|
+
</td>
|
322
|
+
</tr>
|
323
|
+
</tfoot>
|
324
|
+
</table>
|
325
|
+
</sections>
|
326
|
+
</iso-standard>
|
327
|
+
OUTPUT
|
328
|
+
end
|
329
|
+
end
|