isodoc 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.tb.yml +20 -10
  3. data/lib/isodoc/blocks.rb +13 -13
  4. data/lib/isodoc/cleanup.rb +19 -3
  5. data/lib/isodoc/comments.rb +1 -1
  6. data/lib/isodoc/convert.rb +2 -0
  7. data/lib/isodoc/footnotes.rb +4 -2
  8. data/lib/isodoc/html.rb +28 -10
  9. data/lib/isodoc/i18n-en.yaml +9 -0
  10. data/lib/isodoc/i18n-fr.yaml +12 -3
  11. data/lib/isodoc/i18n-zh-Hans.yaml +10 -1
  12. data/lib/isodoc/i18n.rb +9 -2
  13. data/lib/isodoc/inline.rb +5 -6
  14. data/lib/isodoc/iso2wordhtml.rb +9 -6
  15. data/lib/isodoc/lists.rb +7 -5
  16. data/lib/isodoc/metadata.rb +27 -10
  17. data/lib/isodoc/references.rb +12 -6
  18. data/lib/isodoc/section.rb +17 -11
  19. data/lib/isodoc/table.rb +2 -4
  20. data/lib/isodoc/terms.rb +3 -3
  21. data/lib/isodoc/utils.rb +15 -14
  22. data/lib/isodoc/version.rb +1 -1
  23. data/lib/isodoc/wordconvert/comments.rb +1 -1
  24. data/lib/isodoc/wordconvert/wordconvertmodule.rb +51 -12
  25. data/lib/isodoc/xref_gen.rb +30 -26
  26. data/lib/isodoc/xref_sect_gen.rb +31 -13
  27. data/spec/assets/scripts.html +1 -0
  28. data/spec/isodoc/blocks_spec.rb +50 -49
  29. data/spec/isodoc/cleanup_spec.rb +6 -6
  30. data/spec/isodoc/footnotes_spec.rb +10 -2
  31. data/spec/isodoc/i18n_spec.rb +86 -54
  32. data/spec/isodoc/inline_spec.rb +22 -18
  33. data/spec/isodoc/lists_spec.rb +25 -11
  34. data/spec/isodoc/metadata_spec.rb +4 -3
  35. data/spec/isodoc/postproc_spec.rb +108 -42
  36. data/spec/isodoc/ref_spec.rb +9 -7
  37. data/spec/isodoc/section_spec.rb +162 -141
  38. data/spec/isodoc/table_spec.rb +18 -16
  39. data/spec/isodoc/terms_spec.rb +9 -9
  40. data/spec/isodoc/xref_spec.rb +153 -122
  41. metadata +3 -2
@@ -323,8 +323,8 @@ INPUT
323
323
  </tr>
324
324
  <tr><td colspan="5" style="border-top:0pt;border-bottom:solid windowtext 1.5pt;"><div id="" class="Note">
325
325
  <p class="Note">NOTE<span style="mso-tab-count:1">&#xA0; </span>This is a table about rice</p>
326
- </div><div class="Note"><div id="ftntableD-1a">
327
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55" class="Note"><a id="tableD-1a" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#xA0; </span></a>Parboiled rice.</p>
326
+ </div><div class="TableFootnote"><div id="ftntableD-1a">
327
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55" class="TableFootnote"><a id="tableD-1a" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#xA0; </span></a>Parboiled rice.</p>
328
328
  </div></div></td></tr></tfoot>
329
329
  <dl>
330
330
  <dt>
@@ -480,8 +480,8 @@ INPUT
480
480
  </tr>
481
481
  <tr><td colspan="5" style="border-top:0pt;mso-border-top-alt:0pt; border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;"><div id="" class="Note">
482
482
  <p class="Note">NOTE<span style="mso-tab-count:1">&#xA0; </span>This is a table about rice</p>
483
- </div><div class="Note"><div id="ftntableD-1a">
484
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55" class="Note"><a id="tableD-1a" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#xA0; </span></a>Parboiled rice.</p>
483
+ </div><div class="TableFootnote"><div id="ftntableD-1a">
484
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55" class="TableFootnote"><a id="tableD-1a" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#xA0; </span></a>Parboiled rice.</p>
485
485
  </div></div></td></tr></tfoot>
486
486
  <dl>
487
487
  <dt>
@@ -628,8 +628,8 @@ INPUT
628
628
 
629
629
  <tfoot><tr><td colspan="5" style="border-top:0pt;border-bottom:solid windowtext 1.5pt;"><div id="" class="Note">
630
630
  <p class="Note">NOTE<span style="mso-tab-count:1">&#xA0; </span>This is a table about rice</p>
631
- </div><div class="Note"><div id="ftntableD-1a">
632
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55" class="Note"><a id="tableD-1a" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#xA0; </span></a>Parboiled rice.</p>
631
+ </div><div class="TableFootnote"><div id="ftntableD-1a">
632
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55" class="TableFootnote"><a id="tableD-1a" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#xA0; </span></a>Parboiled rice.</p>
633
633
  </div></div></td></tr></tfoot></table>
634
634
  </div>
635
635
  <p>&#xA0;</p>
@@ -4,6 +4,7 @@ RSpec.describe IsoDoc do
4
4
  it "processes IsoXML footnotes" do
5
5
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface>
7
8
  <foreword>
8
9
  <p>A.<fn reference="2">
9
10
  <p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
@@ -15,6 +16,7 @@ RSpec.describe IsoDoc do
15
16
  <p id="_1e228e29-baef-4f38-b048-b05a051747e4">Hello! denoted as 15 % (m/m).</p>
16
17
  </fn></p>
17
18
  </foreword>
19
+ </preface>
18
20
  </iso-standard>
19
21
  INPUT
20
22
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -38,10 +40,10 @@ RSpec.describe IsoDoc do
38
40
  <br/>
39
41
  <div class="WordSection3">
40
42
  <p class="zzSTDTitle1"/>
41
- <aside id="ftn2">
43
+ <aside id="ftn2" class="footnote">
42
44
  <p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
43
45
  </aside>
44
- <aside id="ftn1">
46
+ <aside id="ftn1" class="footnote">
45
47
  <p id="_1e228e29-baef-4f38-b048-b05a051747e4">Hello! denoted as 15 % (m/m).</p>
46
48
  </aside>
47
49
  </div>
@@ -54,6 +56,7 @@ RSpec.describe IsoDoc do
54
56
  it "processes IsoXML footnotes (Word)" do
55
57
  expect(IsoDoc::WordConvert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
56
58
  <iso-standard xmlns="http://riboseinc.com/isoxml">
59
+ <preface>
57
60
  <foreword>
58
61
  <p>A.<fn reference="2">
59
62
  <p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
@@ -65,6 +68,7 @@ RSpec.describe IsoDoc do
65
68
  <p id="_1e228e29-baef-4f38-b048-b05a051747e4">Hello! denoted as 15 % (m/m).</p>
66
69
  </fn></p>
67
70
  </foreword>
71
+ </preface>
68
72
  </iso-standard>
69
73
  INPUT
70
74
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -105,6 +109,7 @@ RSpec.describe IsoDoc do
105
109
  system "rm -f test.html"
106
110
  IsoDoc::Convert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert_file(<<~"INPUT", "test", false)
107
111
  <iso-standard xmlns="http://riboseinc.com/isoxml">
112
+ <preface>
108
113
  <foreword>
109
114
  <p id="A">A.</p>
110
115
  <p id="B">B.</p>
@@ -116,6 +121,7 @@ RSpec.describe IsoDoc do
116
121
  <introduction>
117
122
  <review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c712" date="20170108T0000" from="A" to="C"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08">Second note.</p></review>
118
123
  </introduction>
124
+ </preface>
119
125
  </iso-standard>
120
126
  INPUT
121
127
  html = File.read("test.html").sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>")
@@ -198,6 +204,7 @@ RSpec.describe IsoDoc do
198
204
  system "rm -f test.doc"
199
205
  IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert_file(<<~"INPUT", "test", false)
200
206
  <iso-standard xmlns="http://riboseinc.com/isoxml">
207
+ <preface>
201
208
  <foreword>
202
209
  <p id="A">A.</p>
203
210
  <p id="B">B.</p>
@@ -209,6 +216,7 @@ RSpec.describe IsoDoc do
209
216
  <introduction>
210
217
  <review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c712" date="20170108T0000" from="A" to="C"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08">Second note.</p></review>
211
218
  </introduction>
219
+ </preface>
212
220
  </iso-standard>
213
221
  INPUT
214
222
  html = File.read("test.doc").sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>")
@@ -7,17 +7,18 @@ RSpec.describe IsoDoc do
7
7
  <bibdata>
8
8
  <language>en</language>
9
9
  </bibdata>
10
+ <preface>
10
11
  <foreword obligation="informative">
11
12
  <title>Foreword</title>
12
13
  <p id="A">This is a preamble</p>
13
14
  </foreword>
14
- <introduction id="B" obligation="informative"><title>Introduction</title><subsection id="C" inline-header="false" obligation="informative">
15
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
15
16
  <title>Introduction Subsection</title>
16
- </subsection>
17
+ </clause>
17
18
  <patent-notice>
18
19
  <p>This is patent boilerplate</p>
19
20
  </patent-notice>
20
- </introduction><sections>
21
+ </introduction></preface><sections>
21
22
  <clause id="D" obligation="normative">
22
23
  <title>Scope</title>
23
24
  <p id="E">Text</p>
@@ -42,22 +43,25 @@ RSpec.describe IsoDoc do
42
43
  <dd>Definition</dd>
43
44
  </dl>
44
45
  </symbols-abbrevs>
45
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><subsection id="N" inline-header="false" obligation="normative">
46
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
46
47
  <title>Introduction</title>
47
- </subsection>
48
- <subsection id="O" inline-header="false" obligation="normative">
48
+ </clause>
49
+ <clause id="O" inline-header="false" obligation="normative">
49
50
  <title>Clause 4.2</title>
50
- </subsection></clause>
51
+ </clause></clause>
51
52
 
52
53
  </sections><annex id="P" inline-header="false" obligation="normative">
53
54
  <title>Annex</title>
54
- <subsection id="Q" inline-header="false" obligation="normative">
55
+ <clause id="Q" inline-header="false" obligation="normative">
55
56
  <title>Annex A.1</title>
56
- <subsection id="Q1" inline-header="false" obligation="normative">
57
+ <clause id="Q1" inline-header="false" obligation="normative">
57
58
  <title>Annex A.1a</title>
58
- </subsection>
59
- </subsection>
60
- </annex><references id="R" obligation="informative">
59
+ </clause>
60
+ </clause>
61
+ <appendix id="Q2" inline-header="false" obligation="normative">
62
+ <title>An Appendix</title>
63
+ </appendix>
64
+ </annex><bibliography><references id="R" obligation="informative">
61
65
  <title>Normative References</title>
62
66
  </references><clause id="S" obligation="informative">
63
67
  <title>Bibliography</title>
@@ -65,6 +69,7 @@ RSpec.describe IsoDoc do
65
69
  <title>Bibliography Subsection</title>
66
70
  </references>
67
71
  </clause>
72
+ </bibliography>
68
73
  </iso-standard>
69
74
  INPUT
70
75
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -116,7 +121,7 @@ RSpec.describe IsoDoc do
116
121
  <div id="I">
117
122
  <h2>3.1. Normal Terms</h2>
118
123
  <p class="TermNum" id="J">3.1.1</p>
119
- <p class="Terms">Term2</p>
124
+ <p class="Terms" style="text-align:left;">Term2</p>
120
125
 
121
126
  </div><div id="K"><h2>3.2. Symbols and Abbreviated Terms</h2>
122
127
  <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
@@ -148,6 +153,9 @@ RSpec.describe IsoDoc do
148
153
  <h3>A.1.1. Annex A.1a</h3>
149
154
  </div>
150
155
  </div>
156
+ <div id="Q2">
157
+ <h2>Appendix 1. An Appendix</h2>
158
+ </div>
151
159
  </div>
152
160
  <br/>
153
161
  <div>
@@ -169,17 +177,18 @@ RSpec.describe IsoDoc do
169
177
  <bibdata>
170
178
  <language>tlh</language>
171
179
  </bibdata>
180
+ <preface>
172
181
  <foreword obligation="informative">
173
182
  <title>Foreword</title>
174
183
  <p id="A">This is a preamble</p>
175
184
  </foreword>
176
- <introduction id="B" obligation="informative"><title>Introduction</title><subsection id="C" inline-header="false" obligation="informative">
185
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
177
186
  <title>Introduction Subsection</title>
178
- </subsection>
187
+ </clause>
179
188
  <patent-notice>
180
189
  <p>This is patent boilerplate</p>
181
190
  </patent-notice>
182
- </introduction><sections>
191
+ </introduction></preface><sections>
183
192
  <clause id="D" obligation="normative">
184
193
  <title>Scope</title>
185
194
  <p id="E">Text</p>
@@ -204,22 +213,25 @@ RSpec.describe IsoDoc do
204
213
  <dd>Definition</dd>
205
214
  </dl>
206
215
  </symbols-abbrevs>
207
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><subsection id="N" inline-header="false" obligation="normative">
216
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
208
217
  <title>Introduction</title>
209
- </subsection>
210
- <subsection id="O" inline-header="false" obligation="normative">
218
+ </clause>
219
+ <clause id="O" inline-header="false" obligation="normative">
211
220
  <title>Clause 4.2</title>
212
- </subsection></clause>
221
+ </clause></clause>
213
222
 
214
223
  </sections><annex id="P" inline-header="false" obligation="normative">
215
224
  <title>Annex</title>
216
- <subsection id="Q" inline-header="false" obligation="normative">
225
+ <clause id="Q" inline-header="false" obligation="normative">
217
226
  <title>Annex A.1</title>
218
- <subsection id="Q1" inline-header="false" obligation="normative">
227
+ <clause id="Q1" inline-header="false" obligation="normative">
219
228
  <title>Annex A.1a</title>
220
- </subsection>
221
- </subsection>
222
- </annex><references id="R" obligation="informative">
229
+ </clause>
230
+ </clause>
231
+ <appendix id="Q2" inline-header="false" obligation="normative">
232
+ <title>An Appendix</title>
233
+ </appendix>
234
+ </annex><bibliography><references id="R" obligation="informative">
223
235
  <title>Normative References</title>
224
236
  </references><clause id="S" obligation="informative">
225
237
  <title>Bibliography</title>
@@ -227,6 +239,7 @@ RSpec.describe IsoDoc do
227
239
  <title>Bibliography Subsection</title>
228
240
  </references>
229
241
  </clause>
242
+ </bibliography>
230
243
  </iso-standard>
231
244
  INPUT
232
245
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -278,7 +291,7 @@ RSpec.describe IsoDoc do
278
291
  <div id="I">
279
292
  <h2>3.1. Normal Terms</h2>
280
293
  <p class="TermNum" id="J">3.1.1</p>
281
- <p class="Terms">Term2</p>
294
+ <p class="Terms" style="text-align:left;">Term2</p>
282
295
 
283
296
  </div><div id="K"><h2>3.2. Symbols and Abbreviated Terms</h2>
284
297
  <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
@@ -310,6 +323,9 @@ RSpec.describe IsoDoc do
310
323
  <h3>A.1.1. Annex A.1a</h3>
311
324
  </div>
312
325
  </div>
326
+ <div id="Q2">
327
+ <h2>Appendix 1. An Appendix</h2>
328
+ </div>
313
329
  </div>
314
330
  <br/>
315
331
  <div>
@@ -331,17 +347,18 @@ RSpec.describe IsoDoc do
331
347
  <bibdata>
332
348
  <language>fr</language>
333
349
  </bibdata>
350
+ <preface>
334
351
  <foreword obligation="informative">
335
352
  <title>Foreword</title>
336
353
  <p id="A">This is a preamble</p>
337
354
  </foreword>
338
- <introduction id="B" obligation="informative"><title>Introduction</title><subsection id="C" inline-header="false" obligation="informative">
355
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
339
356
  <title>Introduction Subsection</title>
340
- </subsection>
357
+ </clause>
341
358
  <patent-notice>
342
359
  <p>This is patent boilerplate</p>
343
360
  </patent-notice>
344
- </introduction><sections>
361
+ </introduction></preface><sections>
345
362
  <clause id="D" obligation="normative">
346
363
  <title>Scope</title>
347
364
  <p id="E">Text</p>
@@ -366,22 +383,25 @@ RSpec.describe IsoDoc do
366
383
  <dd>Definition</dd>
367
384
  </dl>
368
385
  </symbols-abbrevs>
369
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><subsection id="N" inline-header="false" obligation="normative">
386
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
370
387
  <title>Introduction</title>
371
- </subsection>
372
- <subsection id="O" inline-header="false" obligation="normative">
388
+ </clause>
389
+ <clause id="O" inline-header="false" obligation="normative">
373
390
  <title>Clause 4.2</title>
374
- </subsection></clause>
391
+ </clause></clause>
375
392
 
376
393
  </sections><annex id="P" inline-header="false" obligation="normative">
377
394
  <title>Annex</title>
378
- <subsection id="Q" inline-header="false" obligation="normative">
395
+ <clause id="Q" inline-header="false" obligation="normative">
379
396
  <title>Annex A.1</title>
380
- <subsection id="Q1" inline-header="false" obligation="normative">
397
+ <clause id="Q1" inline-header="false" obligation="normative">
381
398
  <title>Annex A.1a</title>
382
- </subsection>
383
- </subsection>
384
- </annex><references id="R" obligation="informative">
399
+ </clause>
400
+ </clause>
401
+ <appendix id="Q2" inline-header="false" obligation="normative">
402
+ <title>An Appendix</title>
403
+ </appendix>
404
+ </annex><bibliography><references id="R" obligation="informative">
385
405
  <title>Normative References</title>
386
406
  </references><clause id="S" obligation="informative">
387
407
  <title>Bibliography</title>
@@ -389,6 +409,7 @@ RSpec.describe IsoDoc do
389
409
  <title>Bibliography Subsection</title>
390
410
  </references>
391
411
  </clause>
412
+ </bibliography>
392
413
  </iso-standard>
393
414
  INPUT
394
415
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -439,7 +460,7 @@ RSpec.describe IsoDoc do
439
460
  <div id="I">
440
461
  <h2>3.1. Normal Terms</h2>
441
462
  <p class="TermNum" id="J">3.1.1</p>
442
- <p class="Terms">Term2</p>
463
+ <p class="Terms" style="text-align:left;">Term2</p>
443
464
 
444
465
  </div><div id="K"><h2>3.2. Symbols and Abbreviated Terms</h2>
445
466
  <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
@@ -471,10 +492,13 @@ RSpec.describe IsoDoc do
471
492
  <h3>A.1.1. Annex A.1a</h3>
472
493
  </div>
473
494
  </div>
495
+ <div id="Q2">
496
+ <h2>Appendice 1. An Appendix</h2>
497
+ </div>
474
498
  </div>
475
499
  <br/>
476
500
  <div>
477
- <h1 class="Section3">then Bibliographie</h1>
501
+ <h1 class="Section3">Bibliographie</h1>
478
502
  <div>
479
503
  <h2 class="Section3">Bibliography Subsection</h2>
480
504
  </div>
@@ -493,17 +517,18 @@ RSpec.describe IsoDoc do
493
517
  <language>zh</language>
494
518
  <script>Hans</script>
495
519
  </bibdata>
520
+ <preface>
496
521
  <foreword obligation="informative">
497
522
  <title>Foreword</title>
498
523
  <p id="A">This is a preamble</p>
499
524
  </foreword>
500
- <introduction id="B" obligation="informative"><title>Introduction</title><subsection id="C" inline-header="false" obligation="informative">
525
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
501
526
  <title>Introduction Subsection</title>
502
- </subsection>
527
+ </clause>
503
528
  <patent-notice>
504
529
  <p>This is patent boilerplate</p>
505
530
  </patent-notice>
506
- </introduction><sections>
531
+ </introduction></preface><sections>
507
532
  <clause id="D" obligation="normative">
508
533
  <title>Scope</title>
509
534
  <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
@@ -528,22 +553,25 @@ RSpec.describe IsoDoc do
528
553
  <dd>Definition</dd>
529
554
  </dl>
530
555
  </symbols-abbrevs>
531
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><subsection id="N" inline-header="false" obligation="normative">
556
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
532
557
  <title>Introduction</title>
533
- </subsection>
534
- <subsection id="O" inline-header="false" obligation="normative">
558
+ </clause>
559
+ <clause id="O" inline-header="false" obligation="normative">
535
560
  <title>Clause 4.2</title>
536
- </subsection></clause>
561
+ </clause></clause>
537
562
 
538
563
  </sections><annex id="P" inline-header="false" obligation="normative">
539
564
  <title>Annex</title>
540
- <subsection id="Q" inline-header="false" obligation="normative">
565
+ <clause id="Q" inline-header="false" obligation="normative">
541
566
  <title>Annex A.1</title>
542
- <subsection id="Q1" inline-header="false" obligation="normative">
567
+ <clause id="Q1" inline-header="false" obligation="normative">
543
568
  <title>Annex A.1a</title>
544
- </subsection>
545
- </subsection>
546
- </annex><references id="R" obligation="informative">
569
+ </clause>
570
+ </clause>
571
+ <appendix id="Q2" inline-header="false" obligation="normative">
572
+ <title>An Appendix</title>
573
+ </appendix>
574
+ </annex><bibliography><references id="R" obligation="informative">
547
575
  <title>Normative References</title>
548
576
  <bibitem id="ISO712" type="standard">
549
577
  <title format="text/plain">Cereals and cereal products</title>
@@ -561,6 +589,7 @@ RSpec.describe IsoDoc do
561
589
  <title>Bibliography Subsection</title>
562
590
  </references>
563
591
  </clause>
592
+ </bibliography>
564
593
  </iso-standard>
565
594
  INPUT
566
595
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -612,7 +641,7 @@ RSpec.describe IsoDoc do
612
641
  <div id="I">
613
642
  <h2>3.1. Normal Terms</h2>
614
643
  <p class="TermNum" id="J">3.1.1</p>
615
- <p class="Terms">Term2</p>
644
+ <p class="Terms" style="text-align:left;">Term2</p>
616
645
 
617
646
  </div><div id="K"><h2>3.2. Symbols and Abbreviated Terms</h2>
618
647
  <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
@@ -637,12 +666,15 @@ RSpec.describe IsoDoc do
637
666
  </div>
638
667
  <br/>
639
668
  <div id="P" class="Section3">
640
- <h1 class="Annex">&#38468;&#24405;A<br/>&#65288;&#35268;&#33539;&#24615;&#38468;&#24405;&#65289;<br/><br/><b>Annex</b></h1>
669
+ <h1 class="Annex">&#38468;&#20214;A<br/>&#65288;&#35268;&#33539;&#24615;&#38468;&#24405;&#65289;<br/><br/><b>Annex</b></h1>
641
670
  <div id="Q">
642
671
  <h2>A.1. Annex A.1</h2>
643
672
  <div id="Q1">
644
673
  <h3>A.1.1. Annex A.1a</h3>
645
674
  </div>
675
+ </div>
676
+ <div id="Q2">
677
+ <h2>&#38468;&#24405;1. An Appendix</h2>
646
678
  </div>
647
679
  </div>
648
680
  <br/>
@@ -4,13 +4,13 @@ RSpec.describe IsoDoc do
4
4
  it "processes inline formatting" do
5
5
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <foreword>
7
+ <preface><foreword>
8
8
  <p>
9
9
  <em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
10
10
  <strike>F</strike> <smallcap>G</smallcap> <br/> <hr/>
11
11
  <bookmark id="H"/> <pagebreak/>
12
12
  </p>
13
- </foreword>
13
+ </foreword></preface>
14
14
  <sections>
15
15
  </iso-standard>
16
16
  INPUT
@@ -47,12 +47,12 @@ RSpec.describe IsoDoc do
47
47
  it "processes links" do
48
48
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
49
49
  <iso-standard xmlns="http://riboseinc.com/isoxml">
50
- <foreword>
50
+ <preface><foreword>
51
51
  <p>
52
52
  <link target="http://example.com"/>
53
53
  <link target="http://example.com">example</link>
54
54
  </p>
55
- </foreword>
55
+ </foreword></preface>
56
56
  <sections>
57
57
  </iso-standard>
58
58
  INPUT
@@ -88,11 +88,11 @@ RSpec.describe IsoDoc do
88
88
  it "processes unrecognised markup" do
89
89
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
90
90
  <iso-standard xmlns="http://riboseinc.com/isoxml">
91
- <foreword>
91
+ <preface><foreword>
92
92
  <p>
93
93
  <barry fred="http://example.com">example</barry>
94
94
  </p>
95
- </foreword>
95
+ </foreword></preface>
96
96
  <sections>
97
97
  </iso-standard>
98
98
  INPUT
@@ -127,13 +127,13 @@ RSpec.describe IsoDoc do
127
127
  it "processes AsciiMath and MathML" do
128
128
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
129
129
  <iso-standard xmlns="http://riboseinc.com/isoxml">
130
- <foreword>
130
+ <preface><foreword>
131
131
  <p>
132
132
  <stem type="AsciiMath">A</stem>
133
133
  <stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
134
134
  <stem type="None">Latex?</stem>
135
135
  </p>
136
- </foreword>
136
+ </foreword></preface>
137
137
  <sections>
138
138
  </iso-standard>
139
139
  INPUT
@@ -172,12 +172,12 @@ RSpec.describe IsoDoc do
172
172
  it "overrides AsciiMath delimiters" do
173
173
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
174
174
  <iso-standard xmlns="http://riboseinc.com/isoxml">
175
- <foreword>
175
+ <preface><foreword>
176
176
  <p>
177
177
  <stem type="AsciiMath">A</stem>
178
178
  (#((Hello))#)
179
179
  </p>
180
- </foreword>
180
+ </foreword></preface>
181
181
  <sections>
182
182
  </iso-standard>
183
183
  INPUT
@@ -213,13 +213,13 @@ RSpec.describe IsoDoc do
213
213
  it "processes eref types" do
214
214
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
215
215
  <iso-standard xmlns="http://riboseinc.com/isoxml">
216
- <foreword>
216
+ <preface><foreword>
217
217
  <p>
218
218
  <eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
219
219
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
220
220
  </p>
221
- </foreword>
222
- <references id="_normative_references" obligation="informative"><title>Normative References</title>
221
+ </foreword></preface>
222
+ <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
223
223
  <bibitem id="ISO712" type="standard">
224
224
  <title format="text/plain">Cereals and cereal products</title>
225
225
  <docidentifier>ISO 712</docidentifier>
@@ -231,6 +231,7 @@ RSpec.describe IsoDoc do
231
231
  </contributor>
232
232
  </bibitem>
233
233
  </references>
234
+ </bibliography>
234
235
  </iso-standard>
235
236
  INPUT
236
237
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -256,7 +257,7 @@ RSpec.describe IsoDoc do
256
257
  <div class="WordSection3">
257
258
  <p class="zzSTDTitle1"/>
258
259
  <div>
259
- <h1>2.&#160; Normative References</h1>
260
+ <h1>1.&#160; Normative References</h1>
260
261
  <p>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>
261
262
  <p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
262
263
  </div>
@@ -270,7 +271,7 @@ RSpec.describe IsoDoc do
270
271
  it "processes eref content" do
271
272
  expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
272
273
  <iso-standard xmlns="http://riboseinc.com/isoxml">
273
- <foreword>
274
+ <preface><foreword>
274
275
  <p>
275
276
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
276
277
  <eref type="inline" bibitemid="ISO712"/>
@@ -281,10 +282,11 @@ RSpec.describe IsoDoc do
281
282
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
282
283
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
283
284
  <eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
285
+ <eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
284
286
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
285
287
  </p>
286
- </foreword>
287
- <references id="_normative_references" obligation="informative"><title>Normative References</title>
288
+ </foreword></preface>
289
+ <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
288
290
  <bibitem id="ISO712" type="standard">
289
291
  <title format="text/plain">Cereals and cereal products</title>
290
292
  <docidentifier>ISO 712</docidentifier>
@@ -296,6 +298,7 @@ RSpec.describe IsoDoc do
296
298
  </contributor>
297
299
  </bibitem>
298
300
  </references>
301
+ </bibliography>
299
302
  </iso-standard>
300
303
  INPUT
301
304
  <html xmlns:epub="http://www.idpf.org/2007/ops">
@@ -320,6 +323,7 @@ RSpec.describe IsoDoc do
320
323
  <a href="#ISO712">ISO 712, 1.5</a>
321
324
  <a href="#ISO712">A</a>
322
325
  <a href="#ISO712">ISO 712, </a>
326
+ <a href="#ISO712">ISO 712, Prelude 7</a>
323
327
  <a href="#ISO712">A</a>
324
328
  </p>
325
329
  </div>
@@ -329,7 +333,7 @@ RSpec.describe IsoDoc do
329
333
  <div class="WordSection3">
330
334
  <p class="zzSTDTitle1"/>
331
335
  <div>
332
- <h1>2.&#160; Normative References</h1>
336
+ <h1>1.&#160; Normative References</h1>
333
337
  <p>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>
334
338
  <p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
335
339
  </div>