isodoc 0.5.9 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +1 -0
- data/lib/isodoc.rb +2 -0
- data/lib/isodoc/convert.rb +17 -1
- data/lib/isodoc/footnotes.rb +8 -3
- data/lib/isodoc/html.rb +65 -27
- data/lib/isodoc/i18n-en.yaml +1 -1
- data/lib/isodoc/iso/convert.rb +46 -0
- data/lib/isodoc/iso/html/header.html +184 -0
- data/lib/isodoc/iso/html/html_iso_intro.html +34 -0
- data/lib/isodoc/iso/html/html_iso_titlepage.html +32 -0
- data/lib/isodoc/iso/html/htmlstyle.scss +46 -0
- data/lib/isodoc/iso/html/isodoc.scss +679 -0
- data/lib/isodoc/iso/html/scripts.html +174 -0
- data/lib/isodoc/iso/html/style-human.scss +1277 -0
- data/lib/isodoc/iso/html/style-iso.scss +1257 -0
- data/lib/isodoc/iso/html/word_iso_intro.html +72 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +58 -0
- data/lib/isodoc/iso/html/wordstyle.scss +1135 -0
- data/lib/isodoc/iso/wordconvert.rb +34 -0
- data/lib/isodoc/iso2wordhtml.rb +17 -23
- data/lib/isodoc/section.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/wordconvert/comments.rb +0 -15
- data/lib/isodoc/wordconvert/convert.rb +1 -0
- data/lib/isodoc/wordconvert/footnotes.rb +0 -12
- data/lib/isodoc/wordconvert/postprocess.rb +110 -0
- data/lib/isodoc/wordconvert/wordconvertmodule.rb +18 -130
- data/lib/isodoc/xref_sect_gen.rb +7 -4
- data/spec/assets/scripts.html +3 -1
- data/spec/isodoc/blocks_spec.rb +97 -211
- data/spec/isodoc/cleanup_spec.rb +27 -0
- data/spec/isodoc/footnotes_spec.rb +40 -53
- data/spec/isodoc/i18n_spec.rb +4 -56
- data/spec/isodoc/inline_spec.rb +7 -98
- data/spec/isodoc/iso_spec.rb +89 -0
- data/spec/isodoc/lists_spec.rb +5 -57
- data/spec/isodoc/postproc_spec.rb +43 -79
- data/spec/isodoc/ref_spec.rb +4 -17
- data/spec/isodoc/section_spec.rb +11 -24
- data/spec/isodoc/table_spec.rb +61 -76
- data/spec/isodoc/terms_spec.rb +1 -13
- data/spec/isodoc/xref_spec.rb +21 -164
- data/spec/spec_helper.rb +21 -1
- metadata +31 -2
@@ -0,0 +1,89 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe IsoDoc do
|
4
|
+
system "rm -f test.html"
|
5
|
+
it "processes isodoc as ISO: HTML output" do
|
6
|
+
IsoDoc::Iso::Convert.new({}).convert_file(<<~"INPUT", "test", false)
|
7
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
8
|
+
<preface><foreword>
|
9
|
+
<note>
|
10
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
11
|
+
</note>
|
12
|
+
</foreword></preface>
|
13
|
+
</iso-standard>
|
14
|
+
INPUT
|
15
|
+
html = File.read("test.html", encoding: "utf-8")
|
16
|
+
expect(html).to match(%r[\.Sourcecode[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
17
|
+
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
18
|
+
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "processes isodoc as ISO: alt HTML output" do
|
22
|
+
system "rm -f test.html"
|
23
|
+
IsoDoc::Iso::Convert.new({alt: true}).convert_file(<<~"INPUT", "test", false)
|
24
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
25
|
+
<preface><foreword>
|
26
|
+
<note>
|
27
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
28
|
+
</note>
|
29
|
+
</foreword></preface>
|
30
|
+
</iso-standard>
|
31
|
+
INPUT
|
32
|
+
html = File.read("test.html", encoding: "utf-8")
|
33
|
+
expect(html).to match(%r[\.Sourcecode[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
|
34
|
+
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
35
|
+
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "processes isodoc as ISO: Chinese HTML output" do
|
39
|
+
system "rm -f test.html"
|
40
|
+
IsoDoc::Iso::Convert.new({script: "Hans"}).convert_file(<<~"INPUT", "test", false)
|
41
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
42
|
+
<preface><foreword>
|
43
|
+
<note>
|
44
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
45
|
+
</note>
|
46
|
+
</foreword></preface>
|
47
|
+
</iso-standard>
|
48
|
+
INPUT
|
49
|
+
html = File.read("test.html", encoding: "utf-8")
|
50
|
+
expect(html).to match(%r[\.Sourcecode[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
51
|
+
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "SimSun", serif;]m)
|
52
|
+
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "SimHei", sans-serif;]m)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "processes isodoc as ISO: user nominated fonts" do
|
56
|
+
system "rm -f test.html"
|
57
|
+
IsoDoc::Iso::Convert.new({bodyfont: "Zapf Chancery", headerfont: "Comic Sans", monospacefont: "Andale Mono"}).convert_file(<<~"INPUT", "test", false)
|
58
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
59
|
+
<preface><foreword>
|
60
|
+
<note>
|
61
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
62
|
+
</note>
|
63
|
+
</foreword></preface>
|
64
|
+
</iso-standard>
|
65
|
+
INPUT
|
66
|
+
html = File.read("test.html", encoding: "utf-8")
|
67
|
+
expect(html).to match(%r[\.Sourcecode[^{]+\{[^{]+font-family: Andale Mono;]m)
|
68
|
+
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
|
69
|
+
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
|
70
|
+
end
|
71
|
+
|
72
|
+
it "processes isodoc as ISO: Word output" do
|
73
|
+
system "rm -f test.doc"
|
74
|
+
IsoDoc::Iso::WordConvert.new({}).convert_file(<<~"INPUT", "test", false)
|
75
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
76
|
+
<preface><foreword>
|
77
|
+
<note>
|
78
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
79
|
+
</note>
|
80
|
+
</foreword></preface>
|
81
|
+
</iso-standard>
|
82
|
+
INPUT
|
83
|
+
html = File.read("test.doc", encoding: "utf-8")
|
84
|
+
expect(html).to match(%r[\.Sourcecode[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
85
|
+
expect(html).to match(%r[Quote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
86
|
+
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
data/spec/isodoc/lists_spec.rb
CHANGED
@@ -16,15 +16,7 @@ RSpec.describe IsoDoc do
|
|
16
16
|
</foreword></preface>
|
17
17
|
</iso-standard>
|
18
18
|
INPUT
|
19
|
-
|
20
|
-
<head>
|
21
|
-
<title>test</title>
|
22
|
-
<body lang="EN-US" link="blue" vlink="#954F72">
|
23
|
-
<div class="WordSection1">
|
24
|
-
<p> </p>
|
25
|
-
</div>
|
26
|
-
<br/>
|
27
|
-
<div class="WordSection2">
|
19
|
+
#{HTML_HDR}
|
28
20
|
<br/>
|
29
21
|
<div>
|
30
22
|
<h1 class="ForewordTitle">Foreword</h1>
|
@@ -37,14 +29,9 @@ RSpec.describe IsoDoc do
|
|
37
29
|
</li>
|
38
30
|
</ul>
|
39
31
|
</div>
|
40
|
-
<p> </p>
|
41
|
-
</div>
|
42
|
-
<br/>
|
43
|
-
<div class="WordSection3">
|
44
32
|
<p class="zzSTDTitle1"/>
|
45
33
|
</div>
|
46
34
|
</body>
|
47
|
-
</head>
|
48
35
|
</html>
|
49
36
|
OUTPUT
|
50
37
|
end
|
@@ -71,15 +58,7 @@ RSpec.describe IsoDoc do
|
|
71
58
|
</foreword></preface>
|
72
59
|
</iso-standard>
|
73
60
|
INPUT
|
74
|
-
|
75
|
-
<head>
|
76
|
-
<title>test</title>
|
77
|
-
<body lang="EN-US" link="blue" vlink="#954F72">
|
78
|
-
<div class="WordSection1">
|
79
|
-
<p> </p>
|
80
|
-
</div>
|
81
|
-
<br/>
|
82
|
-
<div class="WordSection2">
|
61
|
+
#{HTML_HDR}
|
83
62
|
<br/>
|
84
63
|
<div>
|
85
64
|
<h1 class="ForewordTitle">Foreword</h1>
|
@@ -99,14 +78,9 @@ RSpec.describe IsoDoc do
|
|
99
78
|
</ol>
|
100
79
|
</ol>
|
101
80
|
</div>
|
102
|
-
<p> </p>
|
103
|
-
</div>
|
104
|
-
<br/>
|
105
|
-
<div class="WordSection3">
|
106
81
|
<p class="zzSTDTitle1"/>
|
107
82
|
</div>
|
108
83
|
</body>
|
109
|
-
</head>
|
110
84
|
</html>
|
111
85
|
OUTPUT
|
112
86
|
end
|
@@ -129,15 +103,7 @@ RSpec.describe IsoDoc do
|
|
129
103
|
</foreword></preface>
|
130
104
|
</iso-standard>
|
131
105
|
INPUT
|
132
|
-
|
133
|
-
<head>
|
134
|
-
<title>test</title>
|
135
|
-
<body lang="EN-US" link="blue" vlink="#954F72">
|
136
|
-
<div class="WordSection1">
|
137
|
-
<p> </p>
|
138
|
-
</div>
|
139
|
-
<br/>
|
140
|
-
<div class="WordSection2">
|
106
|
+
#{HTML_HDR}
|
141
107
|
<br/>
|
142
108
|
<div>
|
143
109
|
<h1 class="ForewordTitle">Foreword</h1>
|
@@ -153,14 +119,9 @@ RSpec.describe IsoDoc do
|
|
153
119
|
</li>
|
154
120
|
</ol>
|
155
121
|
</div>
|
156
|
-
<p> </p>
|
157
|
-
</div>
|
158
|
-
<br/>
|
159
|
-
<div class="WordSection3">
|
160
122
|
<p class="zzSTDTitle1"/>
|
161
123
|
</div>
|
162
124
|
</body>
|
163
|
-
</head>
|
164
125
|
</html>
|
165
126
|
OUTPUT
|
166
127
|
end
|
@@ -183,15 +144,7 @@ RSpec.describe IsoDoc do
|
|
183
144
|
</foreword></preface>
|
184
145
|
</iso-standard>
|
185
146
|
INPUT
|
186
|
-
|
187
|
-
<head>
|
188
|
-
<title>test</title>
|
189
|
-
<body lang="EN-US" link="blue" vlink="#954F72">
|
190
|
-
<div class="WordSection1">
|
191
|
-
<p> </p>
|
192
|
-
</div>
|
193
|
-
<br/>
|
194
|
-
<div class="WordSection2">
|
147
|
+
#{HTML_HDR}
|
195
148
|
<br/>
|
196
149
|
<div>
|
197
150
|
<h1 class="ForewordTitle">Foreword</h1>
|
@@ -215,14 +168,9 @@ RSpec.describe IsoDoc do
|
|
215
168
|
<p class="Note"><span class="note_label">NOTE</span>  This is a note</p>
|
216
169
|
</div>
|
217
170
|
</div>
|
218
|
-
<p> </p>
|
219
|
-
</div>
|
220
|
-
<br/>
|
221
|
-
<div class="WordSection3">
|
222
171
|
<p class="zzSTDTitle1"/>
|
223
172
|
</div>
|
224
173
|
</body>
|
225
|
-
</head>
|
226
174
|
</html>
|
227
175
|
OUTPUT
|
228
176
|
end
|
@@ -248,6 +196,7 @@ RSpec.describe IsoDoc do
|
|
248
196
|
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
249
197
|
<head>
|
250
198
|
<title>test</title>
|
199
|
+
</head>
|
251
200
|
<body lang="EN-US" link="blue" vlink="#954F72">
|
252
201
|
<div class="WordSection1">
|
253
202
|
<p> </p>
|
@@ -294,7 +243,6 @@ RSpec.describe IsoDoc do
|
|
294
243
|
<p class="zzSTDTitle1"/>
|
295
244
|
</div>
|
296
245
|
</body>
|
297
|
-
</head>
|
298
246
|
</html>
|
299
247
|
OUTPUT
|
300
248
|
end
|
@@ -45,6 +45,8 @@ RSpec.describe IsoDoc do
|
|
45
45
|
expect(File.exist?("spec/assets/iso.html")).to be true
|
46
46
|
html = File.read("spec/assets/iso.html")
|
47
47
|
expect(html).to match(/another empty stylesheet/)
|
48
|
+
expect(html).to match(%r{https://use.fontawesome.com})
|
49
|
+
expect(html).to match(%r{libs/jquery})
|
48
50
|
end
|
49
51
|
|
50
52
|
it "generates Word output docs with null configuration from file" do
|
@@ -71,7 +73,8 @@ RSpec.describe IsoDoc do
|
|
71
73
|
expect(html).to match(/a third empty stylesheet/)
|
72
74
|
expect(html).to match(/an empty html cover page/)
|
73
75
|
expect(html).to match(/an empty html intro page/)
|
74
|
-
expect(html).to match(/This is a script/)
|
76
|
+
expect(html).to match(/This is > a script/)
|
77
|
+
expect(html).not_to match(/CDATA/)
|
75
78
|
expect(html).to match(%r{Enkonduko</h1>})
|
76
79
|
end
|
77
80
|
|
@@ -345,33 +348,35 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
|
|
345
348
|
</sections>
|
346
349
|
</iso-standard>
|
347
350
|
INPUT
|
348
|
-
html = File.read("test.html").sub(/^.*<
|
349
|
-
sub(%r{
|
351
|
+
html = File.read("test.html").sub(/^.*<main class="WordSection3">/m, '<main class="WordSection3">').
|
352
|
+
sub(%r{</main>.*$}m, "</main>")
|
350
353
|
expect(html).to be_equivalent_to <<~"OUTPUT"
|
351
|
-
<
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
<h2>1.1. Introduction to this<a href="#
|
354
|
+
<main class="WordSection3"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
355
|
+
<p class="zzSTDTitle1"></p>
|
356
|
+
<div>
|
357
|
+
<h1>1.  Clause 4</h1>
|
358
|
+
<a rel="footnote" href="#fn:3" epub:type="footnote" id="fnref:1">
|
359
|
+
<sup>1</sup>
|
360
|
+
</a>
|
361
|
+
<div id="N">
|
362
|
+
|
363
|
+
<h2>1.1. Introduction to this<a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2</sup></a></h2>
|
361
364
|
</div>
|
362
|
-
|
365
|
+
<div id="O">
|
363
366
|
<h2>1.2. Clause 4.2</h2>
|
364
|
-
<p>A<a href="#
|
367
|
+
<p>A<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
365
368
|
</div>
|
366
|
-
</div>
|
367
|
-
<aside id="ftn3" class="footnote">
|
368
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a href="#_footnote1">1) </a>This is a footnote.</p>
|
369
|
-
</aside>
|
370
|
-
<aside id="ftn2" class="footnote">
|
371
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a href="#_footnote2">2) </a>Formerly denoted as 15 % (m/m).</p>
|
372
|
-
</aside>
|
373
|
-
|
374
369
|
</div>
|
370
|
+
<aside id="fn:3" class="footnote">
|
371
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:3" epub:type="footnote" id="fnref:1">
|
372
|
+
<sup>1</sup>
|
373
|
+
</a>This is a footnote.</p>
|
374
|
+
<a href="#fnref:1">↩</a></aside>
|
375
|
+
<aside id="fn:2" class="footnote">
|
376
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2</sup></a>Formerly denoted as 15 % (m/m).</p>
|
377
|
+
<a href="#fnref:2">↩</a></aside>
|
378
|
+
|
379
|
+
</main>
|
375
380
|
OUTPUT
|
376
381
|
end
|
377
382
|
|
@@ -388,68 +393,27 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
|
|
388
393
|
</foreword></preface>
|
389
394
|
</iso-standard>
|
390
395
|
INPUT
|
391
|
-
html = File.read("test.html").sub(/^.*<
|
392
|
-
sub(%r{
|
396
|
+
html = File.read("test.html").sub(/^.*<main class="WordSection3">/m, '<main class="WordSection3">').
|
397
|
+
sub(%r{</main>.*$}m, "</main>")
|
393
398
|
expect(`ls _images`).to match(/\.png$/)
|
394
399
|
expect(html.gsub(/\/[0-9a-f-]+\.png/, "/_.png")).to be_equivalent_to <<~"OUTPUT"
|
395
|
-
|
396
|
-
<br />
|
397
|
-
<div>
|
398
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
399
|
-
<div id="_" class="figure">
|
400
|
-
|
401
|
-
<img src="_images/_.png" width="800" height="673" />
|
402
|
-
<p class="FigureTitle" align="center">Figure 1 — Split-it-right sample divider</p></div>
|
403
|
-
</div>
|
404
|
-
<p> </p>
|
405
|
-
</div>
|
406
|
-
<br />
|
407
|
-
OUTPUT
|
408
|
-
|
409
|
-
end
|
410
|
-
|
411
|
-
it "populates HTML ToC" do
|
412
|
-
system "rm -f test.html"
|
413
|
-
IsoDoc::Convert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", htmlintropage: "spec/assets/htmlintro.html"}).convert_file(<<~"INPUT", "test", false)
|
414
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
415
|
-
<sections>
|
416
|
-
<clause inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
417
|
-
|
418
|
-
<title>Introduction<bookmark id="Q"/> to this<fn reference="1">
|
419
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p>
|
420
|
-
</fn></title>
|
421
|
-
</clause>
|
422
|
-
<clause id="O" inline-header="false" obligation="normative">
|
423
|
-
<title>Clause 4.2</title>
|
424
|
-
<p>A<fn reference="1">
|
425
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p>
|
426
|
-
</fn></p>
|
427
|
-
</clause></clause>
|
428
|
-
<clause inline-header="false" obligation="normative"><title>Clause 5</title></clause>
|
429
|
-
</sections>
|
430
|
-
</iso-standard>
|
431
|
-
|
432
|
-
INPUT
|
433
|
-
html = File.read("test.html").sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">').
|
434
|
-
sub(%r{<div class="WordSection3">.*$}m, "")
|
435
|
-
expect(html.gsub(/"#[a-f0-9-]+"/, "#_")).to be_equivalent_to <<~"OUTPUT"
|
436
|
-
<div class="WordSection2">
|
437
|
-
|
438
|
-
/* an empty html intro page */
|
439
|
-
|
440
|
-
<ul><li><a href=#_>2.  Clause 4</a></li><ul><li><a href=#_>1.1. Introduction to this</a></li><li><a href=#_>1.2. Clause 4.2</a></li></ul><li><a href=#_>2.  Clause 5</a></li></ul>
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
<p> </p>
|
445
|
-
</div>
|
400
|
+
<main class="WordSection3"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
446
401
|
<br />
|
402
|
+
<div>
|
403
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
404
|
+
<div id="_" class="figure">
|
447
405
|
|
406
|
+
<img src="_images/_.png" width="800" height="673" />
|
407
|
+
<p class="FigureTitle" align="center">Figure 1 — Split-it-right sample divider</p></div>
|
408
|
+
</div>
|
409
|
+
<p class="zzSTDTitle1"></p>
|
410
|
+
</main>
|
448
411
|
OUTPUT
|
412
|
+
|
449
413
|
end
|
450
414
|
|
451
415
|
it "processes IsoXML terms for HTML" do
|
452
|
-
|
416
|
+
system "rm -f test.doc"
|
453
417
|
system "rm -f test.html"
|
454
418
|
IsoDoc::Convert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert_file(<<~"INPUT", "test", false)
|
455
419
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -501,10 +465,10 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
|
|
501
465
|
</sections>
|
502
466
|
</iso-standard>
|
503
467
|
INPUT
|
504
|
-
|
468
|
+
expect(File.exist?("test.html")).to be true
|
505
469
|
html = File.read("test.html")
|
506
470
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1</h2>})
|
507
471
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
|
508
|
-
end
|
472
|
+
end
|
509
473
|
|
510
474
|
end
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -76,15 +76,7 @@ RSpec.describe IsoDoc do
|
|
76
76
|
</bibliography>
|
77
77
|
</iso-standard>
|
78
78
|
INPUT
|
79
|
-
|
80
|
-
<head>
|
81
|
-
<title>test</title>
|
82
|
-
<body lang="EN-US" link="blue" vlink="#954F72">
|
83
|
-
<div class="WordSection1">
|
84
|
-
<p> </p>
|
85
|
-
</div>
|
86
|
-
<br/>
|
87
|
-
<div class="WordSection2">
|
79
|
+
#{HTML_HDR}
|
88
80
|
<br/>
|
89
81
|
<div>
|
90
82
|
<h1 class="ForewordTitle">Foreword</h1>
|
@@ -94,16 +86,12 @@ RSpec.describe IsoDoc do
|
|
94
86
|
<a href="#ref10">[10]</a>
|
95
87
|
</p>
|
96
88
|
</div>
|
97
|
-
<p> </p>
|
98
|
-
</div>
|
99
|
-
<br/>
|
100
|
-
<div class="WordSection3">
|
101
89
|
<p class="zzSTDTitle1"/>
|
102
90
|
<div>
|
103
91
|
<h1>1.  Normative References</h1>
|
104
92
|
<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>
|
105
93
|
<p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
|
106
|
-
<p id="ISO16634">ISO 16634:All Parts: --<a href="#
|
94
|
+
<p id="ISO16634">ISO 16634:All Parts: --<a rel="footnote" href="#fn:1" epub:type="footnote"><sup>1</sup></a>, <i> Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
|
107
95
|
<p id="ISO20483">ISO 20483: 2013–2014, <i> Cereals and pulses</i></p>
|
108
96
|
<p id="ref1" class="Biblio">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
109
97
|
</div>
|
@@ -114,12 +102,11 @@ RSpec.describe IsoDoc do
|
|
114
102
|
<p id="ref10" class="Biblio">[10]  <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
115
103
|
<p id="ref11" class="Biblio">[3]  IETF RFC 10,<span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
116
104
|
</div>
|
117
|
-
<aside
|
105
|
+
<aside id="fn:1" class="footnote">
|
118
106
|
<p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
|
119
107
|
</aside>
|
120
108
|
</div>
|
121
109
|
</body>
|
122
|
-
</head>
|
123
110
|
</html>
|
124
111
|
OUTPUT
|
125
112
|
end
|
@@ -135,6 +122,7 @@ RSpec.describe IsoDoc do
|
|
135
122
|
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
136
123
|
<head>
|
137
124
|
<title>test</title>
|
125
|
+
</head>
|
138
126
|
<body lang="EN-US" link="blue" vlink="#954F72">
|
139
127
|
<div class="WordSection1">
|
140
128
|
<p> </p>
|
@@ -152,7 +140,6 @@ RSpec.describe IsoDoc do
|
|
152
140
|
</div>
|
153
141
|
</div>
|
154
142
|
</body>
|
155
|
-
</head>
|
156
143
|
</html>
|
157
144
|
OUTPUT
|
158
145
|
end
|