isodoc 1.0.27 → 1.0.28
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 -1
- data/lib/isodoc/function/blocks.rb +1 -1
- data/lib/isodoc/function/cleanup.rb +8 -4
- data/lib/isodoc/function/inline.rb +45 -82
- data/lib/isodoc/function/inline_simple.rb +72 -0
- data/lib/isodoc/function/references.rb +2 -2
- data/lib/isodoc/function/section.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +19 -11
- data/lib/isodoc/function/utils.rb +1 -1
- data/lib/isodoc/html_function/footnotes.rb +1 -1
- data/lib/isodoc/html_function/html.rb +12 -0
- data/lib/isodoc/html_function/postprocess.rb +3 -3
- data/lib/isodoc/metadata.rb +6 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/footnotes.rb +1 -1
- data/spec/assets/i18n.yaml +4 -1
- data/spec/isodoc/blocks_spec.rb +4 -4
- data/spec/isodoc/cleanup_spec.rb +135 -6
- data/spec/isodoc/footnotes_spec.rb +20 -5
- data/spec/isodoc/inline_spec.rb +54 -1
- data/spec/isodoc/metadata_spec.rb +6 -3
- data/spec/isodoc/postproc_spec.rb +5 -5
- data/spec/isodoc/ref_spec.rb +118 -49
- data/spec/isodoc/section_spec.rb +32 -18
- data/spec/isodoc/table_spec.rb +2 -2
- metadata +5 -4
@@ -179,7 +179,7 @@ module IsoDoc::HtmlFunction
|
|
179
179
|
def html_footnote_filter(docxml)
|
180
180
|
seen = {}
|
181
181
|
i = 1
|
182
|
-
docxml.xpath('//a[@
|
182
|
+
docxml.xpath('//a[@class = "FootnoteRef"]').each do |x|
|
183
183
|
fn = docxml.at(%<//*[@id = '#{x['href'].sub(/^#/, '')}']>) || next
|
184
184
|
i, seen = update_footnote_filter(fn, x, i, seen)
|
185
185
|
end
|
@@ -188,7 +188,7 @@ module IsoDoc::HtmlFunction
|
|
188
188
|
|
189
189
|
def footnote_backlinks(docxml)
|
190
190
|
seen = {}
|
191
|
-
docxml.xpath('//a[@
|
191
|
+
docxml.xpath('//a[@class = "FootnoteRef"]').each_with_index do |x, i|
|
192
192
|
seen[x["href"]] and next or seen[x["href"]] = true
|
193
193
|
fn = docxml.at(%<//*[@id = '#{x['href'].sub(/^#/, '')}']>) || next
|
194
194
|
xdup = x.dup
|
@@ -201,7 +201,7 @@ module IsoDoc::HtmlFunction
|
|
201
201
|
end
|
202
202
|
|
203
203
|
def footnote_format(docxml)
|
204
|
-
docxml.xpath("//a[@
|
204
|
+
docxml.xpath("//a[@class = 'FootnoteRef']/sup").each do |x|
|
205
205
|
footnote_reference_format(x)
|
206
206
|
end
|
207
207
|
docxml.xpath("//a[@class = 'TableFootnoteRef'] | "\
|
data/lib/isodoc/metadata.rb
CHANGED
@@ -218,5 +218,11 @@ module IsoDoc
|
|
218
218
|
a = xml.at(ns("//bibdata/uri[@type = 'pdf']")) and set(:pdf, a.text)
|
219
219
|
a = xml.at(ns("//bibdata/uri[@type = 'doc']")) and set(:doc, a.text)
|
220
220
|
end
|
221
|
+
|
222
|
+
def keywords(isoxml, _out)
|
223
|
+
ret = []
|
224
|
+
isoxml.xpath(ns("//bibdata/keyword")).each { |kw| ret << kw.text }
|
225
|
+
set(:keywords, ret)
|
226
|
+
end
|
221
227
|
end
|
222
228
|
end
|
data/lib/isodoc/version.rb
CHANGED
@@ -84,7 +84,7 @@ module IsoDoc::WordFunction
|
|
84
84
|
return seen_footnote_parse(node, out, fn) if @seen_footnote.include?(fn)
|
85
85
|
@fn_bookmarks[fn] = bookmarkid
|
86
86
|
out.span **{style: "mso-bookmark:_Ref#{@fn_bookmarks[fn]}"} do |s|
|
87
|
-
s.a **{ "epub:type": "footnote", href: "#ftn#{fn}" } do |a|
|
87
|
+
s.a **{ "class": "FootnoteRef", "epub:type": "footnote", href: "#ftn#{fn}" } do |a|
|
88
88
|
a.sup { |sup| sup << fn }
|
89
89
|
end
|
90
90
|
end
|
data/spec/assets/i18n.yaml
CHANGED
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -355,7 +355,7 @@ B
|
|
355
355
|
</div></aside>
|
356
356
|
<p style='page-break-after:avoid;'><b>Key</b></p><dl><dt><p>A</p></dt><dd><p>B</p></dd></dl>
|
357
357
|
<p class="FigureTitle" style="text-align:center;">Figure 1 — Split-it-right <i>sample</i> divider
|
358
|
-
<a
|
358
|
+
<a class='FootnoteRef' href='#fn:1'>
|
359
359
|
<sup>1</sup>
|
360
360
|
</a>
|
361
361
|
</p></div>
|
@@ -426,7 +426,7 @@ B
|
|
426
426
|
<p class='FigureTitle' style='text-align:center;'>
|
427
427
|
Figure 1 — Split-it-right sample divider
|
428
428
|
<span style='mso-bookmark:_Ref'>
|
429
|
-
<a href='#ftn1' epub:type='footnote'>
|
429
|
+
<a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
|
430
430
|
<sup>1</sup>
|
431
431
|
</a>
|
432
432
|
</span>
|
@@ -681,7 +681,7 @@ Que?
|
|
681
681
|
<br/>
|
682
682
|
<div>
|
683
683
|
<h1 class="ForewordTitle">Foreword</h1>
|
684
|
-
<div class="Admonition"><p class="AdmonitionTitle" style="text-align:center;">CAUTION</p>
|
684
|
+
<div class="Admonition" id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a'><p class="AdmonitionTitle" style="text-align:center;">CAUTION</p>
|
685
685
|
<p id="_e94663cc-2473-4ccc-9a72-983a74d989f2">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
|
686
686
|
</div>
|
687
687
|
</div>
|
@@ -707,7 +707,7 @@ Que?
|
|
707
707
|
<br/>
|
708
708
|
<div>
|
709
709
|
<h1 class="ForewordTitle">Foreword</h1>
|
710
|
-
<div class="Admonition"><p class="AdmonitionTitle" style="text-align:center;">Title</p>
|
710
|
+
<div class="Admonition" id="_70234f78-64e5-4dfc-8b6f-f3f037348b6a"><p class="AdmonitionTitle" style="text-align:center;">Title</p>
|
711
711
|
<p id="_e94663cc-2473-4ccc-9a72-983a74d989f2">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
|
712
712
|
</div>
|
713
713
|
</div>
|
data/spec/isodoc/cleanup_spec.rb
CHANGED
@@ -154,9 +154,9 @@ RSpec.describe IsoDoc do
|
|
154
154
|
<br/>
|
155
155
|
<div>
|
156
156
|
<h1 class="ForewordTitle">Foreword</h1>
|
157
|
-
<p>A.<a
|
158
|
-
<p>B.<a
|
159
|
-
<p>C.<a
|
157
|
+
<p>A.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
158
|
+
<p>B.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
159
|
+
<p>C.<a class="FootnoteRef" href="#fn:1" epub:type="footnote"><sup>1</sup></a></p>
|
160
160
|
</div>
|
161
161
|
<p class="zzSTDTitle1"/>
|
162
162
|
<aside id="fn:2" class="footnote">
|
@@ -173,9 +173,9 @@ RSpec.describe IsoDoc do
|
|
173
173
|
<br/>
|
174
174
|
<div>
|
175
175
|
<h1 class="ForewordTitle">Foreword</h1>
|
176
|
-
<p>A.<a
|
177
|
-
<p>B.<a
|
178
|
-
<p>C.<a
|
176
|
+
<p>A.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>1</sup></a></p>
|
177
|
+
<p>B.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
178
|
+
<p>C.<a class="FootnoteRef" href="#fn:1" epub:type="footnote"><sup>3</sup></a></p>
|
179
179
|
</div>
|
180
180
|
<p class="zzSTDTitle1"/>
|
181
181
|
<aside id="fn:2" class="footnote">
|
@@ -1056,4 +1056,133 @@ INPUT
|
|
1056
1056
|
OUTPUT
|
1057
1057
|
end
|
1058
1058
|
|
1059
|
+
it "cleans up term sources" do
|
1060
|
+
c = IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"})
|
1061
|
+
c.i18n_init("en", "Latn")
|
1062
|
+
expect(xmlpp(c.textcleanup(<<~"INPUT").to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1063
|
+
#{HTML_HDR}
|
1064
|
+
<p class="zzSTDTitle1"/>
|
1065
|
+
<div id="_terms_and_definitions"><h1>1.  Terms and Definitions</h1><p>For the purposes of this document,
|
1066
|
+
the following terms and definitions apply.</p>
|
1067
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
1068
|
+
|
1069
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
1070
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
|
1071
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
1072
|
+
<ul>
|
1073
|
+
<li>A</li>
|
1074
|
+
</ul>
|
1075
|
+
</div>
|
1076
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
1077
|
+
<ul>
|
1078
|
+
<li>A</li>
|
1079
|
+
</ul>
|
1080
|
+
</div>
|
1081
|
+
|
1082
|
+
<p>[TERMREF]
|
1083
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1084
|
+
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
1085
|
+
[/TERMREF]</p>
|
1086
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
1087
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
1088
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
1089
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
1090
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
1091
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
1092
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
1093
|
+
<ul>
|
1094
|
+
<li>A</li>
|
1095
|
+
</ul>
|
1096
|
+
</div>
|
1097
|
+
<div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
1098
|
+
<div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
1099
|
+
<p>[TERMREF]
|
1100
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1101
|
+
[/TERMREF]</p></div>
|
1102
|
+
</div>
|
1103
|
+
</body>
|
1104
|
+
</html>
|
1105
|
+
INPUT
|
1106
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
1107
|
+
<head/>
|
1108
|
+
<body lang='en'>
|
1109
|
+
<div class='title-section'>
|
1110
|
+
<p> </p>
|
1111
|
+
</div>
|
1112
|
+
<br/>
|
1113
|
+
<div class='prefatory-section'>
|
1114
|
+
<p> </p>
|
1115
|
+
</div>
|
1116
|
+
<br/>
|
1117
|
+
<div class='main-section'>
|
1118
|
+
<p class='zzSTDTitle1'/>
|
1119
|
+
<div id='_terms_and_definitions'>
|
1120
|
+
<h1>1.  Terms and Definitions</h1>
|
1121
|
+
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
1122
|
+
<p class='TermNum' id='paddy1'>1.1.</p>
|
1123
|
+
<p class='Terms' style='text-align:left;'>paddy</p>
|
1124
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'><rice> rice retaining its husk after threshing</p>
|
1125
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' class='example'>
|
1126
|
+
<p class='example-title'>EXAMPLE 1</p>
|
1127
|
+
<p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
|
1128
|
+
<ul>
|
1129
|
+
<li>A</li>
|
1130
|
+
</ul>
|
1131
|
+
</div>
|
1132
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f894' class='example'>
|
1133
|
+
<p class='example-title'>EXAMPLE 2</p>
|
1134
|
+
<ul>
|
1135
|
+
<li>A</li>
|
1136
|
+
</ul>
|
1137
|
+
</div>
|
1138
|
+
<p>
|
1139
|
+
[SOURCE:
|
1140
|
+
<a href='#ISO7301'>ISO 7301:2011, Clause 3.1</a>
|
1141
|
+
, modified — The term "cargo rice" is shown as deprecated, and
|
1142
|
+
Note 1 to entry is not included here; Termbase IEV, term ID xyz;
|
1143
|
+
Termbase IEV, term ID xyz, modified — with adjustments]
|
1144
|
+
</p>
|
1145
|
+
<p class='TermNum' id='paddy'>1.2.</p>
|
1146
|
+
<p class='Terms' style='text-align:left;'>paddy</p>
|
1147
|
+
<p class='AltTerms' style='text-align:left;'>paddy rice</p>
|
1148
|
+
<p class='AltTerms' style='text-align:left;'>rough rice</p>
|
1149
|
+
<p class='DeprecatedTerms' style='text-align:left;'>DEPRECATED: cargo rice</p>
|
1150
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
1151
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f893' class='example'>
|
1152
|
+
<p class='example-title'>EXAMPLE</p>
|
1153
|
+
<ul>
|
1154
|
+
<li>A</li>
|
1155
|
+
</ul>
|
1156
|
+
</div>
|
1157
|
+
<div class='Note'>
|
1158
|
+
<p>
|
1159
|
+
Note 1 to entry: The starch of waxy rice consists almost entirely of
|
1160
|
+
amylopectin. The kernels have a tendency to stick together after
|
1161
|
+
cooking.
|
1162
|
+
</p>
|
1163
|
+
</div>
|
1164
|
+
<div class='Note'>
|
1165
|
+
<p>
|
1166
|
+
Note 2 to entry:
|
1167
|
+
<ul>
|
1168
|
+
<li>A</li>
|
1169
|
+
</ul>
|
1170
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
1171
|
+
The starch of waxy rice consists almost entirely of amylopectin.
|
1172
|
+
The kernels have a tendency to stick together after cooking.
|
1173
|
+
</p>
|
1174
|
+
</p>
|
1175
|
+
</div>
|
1176
|
+
<p>
|
1177
|
+
[SOURCE:
|
1178
|
+
<a href='#ISO7301'>ISO 7301:2011, Clause 3.1</a>
|
1179
|
+
]
|
1180
|
+
</p>
|
1181
|
+
</div>
|
1182
|
+
</div>
|
1183
|
+
</body>
|
1184
|
+
</html>
|
1185
|
+
OUTPUT
|
1186
|
+
end
|
1187
|
+
|
1059
1188
|
end
|
@@ -24,9 +24,24 @@ RSpec.describe IsoDoc do
|
|
24
24
|
<br/>
|
25
25
|
<div>
|
26
26
|
<h1 class="ForewordTitle">Foreword</h1>
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
<p>
|
28
|
+
A.
|
29
|
+
<a class='FootnoteRef' href='#fn:2'>
|
30
|
+
<sup>2</sup>
|
31
|
+
</a>
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
B.
|
35
|
+
<a class='FootnoteRef' href='#fn:2'>
|
36
|
+
<sup>2</sup>
|
37
|
+
</a>
|
38
|
+
</p>
|
39
|
+
<p>
|
40
|
+
C.
|
41
|
+
<a class='FootnoteRef' href='#fn:1'>
|
42
|
+
<sup>1</sup>
|
43
|
+
</a>
|
44
|
+
</p>
|
30
45
|
</div>
|
31
46
|
<p class="zzSTDTitle1"/>
|
32
47
|
<aside id="fn:2" class="footnote">
|
@@ -80,7 +95,7 @@ RSpec.describe IsoDoc do
|
|
80
95
|
<p>
|
81
96
|
A.
|
82
97
|
<span style='mso-bookmark:_Ref'>
|
83
|
-
<a href='#ftn2' epub:type='footnote'>
|
98
|
+
<a href='#ftn2' epub:type='footnote' class='FootnoteRef'>
|
84
99
|
<sup>2</sup>
|
85
100
|
</a>
|
86
101
|
</span>
|
@@ -96,7 +111,7 @@ RSpec.describe IsoDoc do
|
|
96
111
|
<p>
|
97
112
|
C.
|
98
113
|
<span style='mso-bookmark:_Ref'>
|
99
|
-
<a href='#ftn1' epub:type='footnote'>
|
114
|
+
<a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
|
100
115
|
<sup>1</sup>
|
101
116
|
</a>
|
102
117
|
</span>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -549,6 +549,59 @@ OUTPUT
|
|
549
549
|
OUTPUT
|
550
550
|
end
|
551
551
|
|
552
|
-
|
552
|
+
it "cases xrefs" do
|
553
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
554
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
555
|
+
<sections>
|
556
|
+
<clause id="A">
|
557
|
+
<table id="B">
|
558
|
+
</table>
|
559
|
+
</clause>
|
560
|
+
<clause id="C">
|
561
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
562
|
+
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
563
|
+
<xref target="A"/> is clause <em>initial.</em><br/>
|
564
|
+
<xref target="A"/> is too. </p>
|
565
|
+
<p><xref target="A"/> is also.</p>
|
566
|
+
</clause>
|
567
|
+
</sections>
|
568
|
+
</iso-standard>
|
569
|
+
INPUT
|
570
|
+
#{HTML_HDR}
|
571
|
+
<p class='zzSTDTitle1'/>
|
572
|
+
<div id='A'>
|
573
|
+
<h1>1.  </h1>
|
574
|
+
<p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
|
575
|
+
<table id='B' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
|
576
|
+
</div>
|
577
|
+
<div id='C'>
|
578
|
+
<h1>2.  </h1>
|
579
|
+
<p>
|
580
|
+
This is
|
581
|
+
<a href='#A'>klaŭzo 1</a>
|
582
|
+
and
|
583
|
+
<a href='#B'>Tabelo 1</a>
|
584
|
+
. This is
|
585
|
+
<a href='#A'>Klaŭzo 1</a>
|
586
|
+
and
|
587
|
+
<a href='#B'>tabelo 1</a>
|
588
|
+
.
|
589
|
+
<a href='#A'>Klaŭzo 1</a>
|
590
|
+
is clause
|
591
|
+
<i>initial.</i>
|
592
|
+
<br/>
|
593
|
+
<a href='#A'>Klaŭzo 1</a>
|
594
|
+
is too.
|
595
|
+
</p>
|
596
|
+
<p>
|
597
|
+
<a href='#A'>Klaŭzo 1</a>
|
598
|
+
is also.
|
599
|
+
</p>
|
600
|
+
</div>
|
601
|
+
</div>
|
602
|
+
</body>
|
603
|
+
</html>
|
604
|
+
OUTPUT
|
605
|
+
end
|
553
606
|
|
554
607
|
end
|
@@ -88,13 +88,16 @@ RSpec.describe IsoDoc do
|
|
88
88
|
</organization>
|
89
89
|
</owner>
|
90
90
|
</copyright>
|
91
|
+
<keyword>KW2</keyword>
|
92
|
+
<keyword>KW1</keyword>
|
93
|
+
<keyword>KW3</keyword>
|
91
94
|
<ext>
|
92
95
|
<doctype>international-standard</doctype>
|
93
96
|
</ext>
|
94
97
|
</bibdata>
|
95
98
|
</iso-standard>
|
96
99
|
INPUT
|
97
|
-
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>["Barney Rubble", "Fred Flintstone"], :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]}, :circulateddate=>"2015", :confirmeddate=>"2017", :copieddate=>"2016", :createddate=>"2010–2011", :doc=>"URL E", :docnumber=>"17301-1", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :html=>"URL B", :implementeddate=>"XXX", :issueddate=>"XXX", :iteration=>"2", :obsoleteddate=>"2014", :pdf=>"URL D", :publisheddate=>"2011", :publisher=>"", :receiveddate=>"XXX", :revdate=>"2016-05-01", :revdate_monthyear=>"May 2016", :stage=>"Committee draft", :stageabbr=>"CD", :substage=>"Withdrawn", :transmitteddate=>"2020", :unchangeddate=>"2019", :unpublished=>true, :updateddate=>"2018", :url=>"URL A", :vote_endeddate=>"2022", :vote_starteddate=>"2021", :xml=>"URL C"}
|
100
|
+
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>["Barney Rubble", "Fred Flintstone"], :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]}, :circulateddate=>"2015", :confirmeddate=>"2017", :copieddate=>"2016", :createddate=>"2010–2011", :doc=>"URL E", :docnumber=>"17301-1", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :html=>"URL B", :implementeddate=>"XXX", :issueddate=>"XXX", :iteration=>"2", :keywords=>["KW2", "KW1", "KW3"], :obsoleteddate=>"2014", :pdf=>"URL D", :publisheddate=>"2011", :publisher=>"", :receiveddate=>"XXX", :revdate=>"2016-05-01", :revdate_monthyear=>"May 2016", :stage=>"Committee draft", :stageabbr=>"CD", :substage=>"Withdrawn", :transmitteddate=>"2020", :unchangeddate=>"2019", :unpublished=>true, :updateddate=>"2018", :url=>"URL A", :vote_endeddate=>"2022", :vote_starteddate=>"2021", :xml=>"URL C"}
|
98
101
|
OUTPUT
|
99
102
|
end
|
100
103
|
|
@@ -168,7 +171,7 @@ OUTPUT
|
|
168
171
|
</version>
|
169
172
|
</iso-standard>
|
170
173
|
INPUT
|
171
|
-
{:accesseddate=>"XXX", :agency=>"ISO/IEC/IEEE", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05)", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :partof=>"IEC 8122", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"May 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
|
174
|
+
{:accesseddate=>"XXX", :agency=>"ISO/IEC/IEEE", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05)", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :keywords=>[], :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :partof=>"IEC 8122", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"May 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
|
172
175
|
OUTPUT
|
173
176
|
end
|
174
177
|
|
@@ -227,7 +230,7 @@ OUTPUT
|
|
227
230
|
</bibdata>
|
228
231
|
</iso-standard>
|
229
232
|
INPUT
|
230
|
-
{:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization et International Electrotechnical Commission", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"Mai 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
|
233
|
+
{:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :docnumeric=>"17301", :doctitle=>"Cereals and pulses", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :implementeddate=>"XXX", :issueddate=>"XXX", :keywords=>[], :obsoleteddate=>"XXX", :publisheddate=>"2011-01", :publisher=>"International Organization for Standardization et International Electrotechnical Commission", :receiveddate=>"XXX", :revdate=>"2016-05", :revdate_monthyear=>"Mai 2016", :stage=>"Published", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
|
231
234
|
OUTPUT
|
232
235
|
end
|
233
236
|
|
@@ -558,25 +558,25 @@ TOCLEVEL
|
|
558
558
|
<p class="zzSTDTitle1"></p>
|
559
559
|
<div id="A">
|
560
560
|
<h1>1.  Clause 4</h1>
|
561
|
-
<a
|
561
|
+
<a class='FootnoteRef' href='#fn:3' id='fnref:1'>
|
562
562
|
<sup>1</sup>
|
563
563
|
</a>
|
564
564
|
<div id="N">
|
565
565
|
|
566
|
-
<h2>1.1.  Introduction to this<a
|
566
|
+
<h2>1.1.  Introduction to this<a class='FootnoteRef' href='#fn:2' id='fnref:2'><sup>2</sup></a></h2>
|
567
567
|
</div>
|
568
568
|
<div id="O">
|
569
569
|
<h2>1.2.  Clause 4.2</h2>
|
570
|
-
<p>A<a
|
570
|
+
<p>A<a class='FootnoteRef' href='#fn:2'><sup>2</sup></a></p>
|
571
571
|
</div>
|
572
572
|
</div>
|
573
573
|
<aside id="fn:3" class="footnote">
|
574
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a
|
574
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class='FootnoteRef' href='#fn:3'>
|
575
575
|
<sup>1</sup>
|
576
576
|
</a>This is a footnote.</p>
|
577
577
|
<a href="#fnref:1">↩</a></aside>
|
578
578
|
<aside id="fn:2" class="footnote">
|
579
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a
|
579
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class='FootnoteRef' href='#fn:2'><sup>2</sup></a>Formerly denoted as 15 % (m/m).</p>
|
580
580
|
<a href="#fnref:2">↩</a></aside>
|
581
581
|
|
582
582
|
</main>
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -125,55 +125,124 @@ RSpec.describe IsoDoc do
|
|
125
125
|
</iso-standard>
|
126
126
|
INPUT
|
127
127
|
#{HTML_HDR}
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
</
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
128
|
+
<br/>
|
129
|
+
<div>
|
130
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
131
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
132
|
+
<a href='#ISO712'>[110]</a>
|
133
|
+
<a href='#ISBN'>[1]</a>
|
134
|
+
<a href='#ISSN'>[2]</a>
|
135
|
+
<a href='#ISO16634'>ISO 16634:-- (all parts)</a>
|
136
|
+
<a href='#ref1'>ICC 167</a>
|
137
|
+
<a href='#ref10'>[10]</a>
|
138
|
+
<a href='#ref12'>Citn</a>
|
139
|
+
<a href='#zip_ffs'>[5]</a>
|
140
|
+
</p>
|
141
|
+
</div>
|
142
|
+
<p class='zzSTDTitle1'/>
|
143
|
+
<div>
|
144
|
+
<h1>1.  Normative references</h1>
|
145
|
+
<p>
|
146
|
+
The following documents are referred to in the text in such a way that
|
147
|
+
some or all of their content constitutes requirements of this
|
148
|
+
document. For dated references, only the edition cited applies. For
|
149
|
+
undated references, the latest edition of the referenced document
|
150
|
+
(including any amendments) applies.
|
151
|
+
</p>
|
152
|
+
<p id='ISO712' class='NormRef'>
|
153
|
+
[110], ISO 712,
|
154
|
+
<i>Cereals and cereal products</i>
|
155
|
+
</p>
|
156
|
+
<p id='ISO16634' class='NormRef'>
|
157
|
+
ISO 16634:-- (all parts)
|
158
|
+
<a class='FootnoteRef' href='#fn:1'>
|
159
|
+
<sup>1</sup>
|
160
|
+
</a>
|
161
|
+
,
|
162
|
+
<i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
|
163
|
+
</p>
|
164
|
+
<p id='ISO20483' class='NormRef'>
|
165
|
+
ISO 20483:2013-2014,
|
166
|
+
<i>Cereals and pulses</i>
|
167
|
+
</p>
|
168
|
+
<p id='ref1' class='NormRef'>
|
169
|
+
ICC 167,
|
170
|
+
<span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
|
171
|
+
.
|
172
|
+
<i>
|
173
|
+
Determination of the protein content in cereal and cereal products
|
174
|
+
for food and animal feeding stuffs according to the Dumas combustion
|
175
|
+
method
|
176
|
+
</i>
|
177
|
+
(see
|
178
|
+
<a href='http://www.icc.or.at'>http://www.icc.or.at</a>
|
179
|
+
)
|
180
|
+
</p>
|
181
|
+
<div id='' class='Note'>
|
182
|
+
<p>
|
183
|
+
<span class='note_label'>NOTE</span>
|
184
|
+
  This is an annotation of ISO 20483:2013-2014
|
185
|
+
</p>
|
186
|
+
</div>
|
187
|
+
<p id='zip_ffs' class='NormRef'>[5], Title 5</p>
|
188
|
+
</div>
|
189
|
+
<br/>
|
190
|
+
<div>
|
191
|
+
<h1 class='Section3'>Bibliography</h1>
|
192
|
+
<p id='ISBN' class='Biblio'>
|
193
|
+
[1] 
|
194
|
+
<i>Chemicals for analytical laboratory use</i>
|
195
|
+
</p>
|
196
|
+
<p id='ISSN' class='Biblio'>
|
197
|
+
[2] 
|
198
|
+
<i>Instruments for analytical laboratory use</i>
|
199
|
+
</p>
|
200
|
+
<div id='' class='Note'>
|
201
|
+
<p>
|
202
|
+
<span class='note_label'>NOTE</span>
|
203
|
+
  This is an annotation of document ISSN.
|
204
|
+
</p>
|
205
|
+
</div>
|
206
|
+
<div id='' class='Note'>
|
207
|
+
<p>
|
208
|
+
<span class='note_label'>NOTE</span>
|
209
|
+
  This is another annotation of document ISSN.
|
210
|
+
</p>
|
211
|
+
</div>
|
212
|
+
<p id='ISO3696' class='Biblio'>
|
213
|
+
[3]  ISO 3696,
|
214
|
+
<i>Water for analytical laboratory use</i>
|
215
|
+
</p>
|
216
|
+
<p id='ref10' class='Biblio'>
|
217
|
+
[10] 
|
218
|
+
<span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
|
219
|
+
.
|
220
|
+
<i>
|
221
|
+
Determination of the protein content in cereal and cereal products
|
222
|
+
for food and animal feeding stuffs according to the Dumas combustion
|
223
|
+
method
|
224
|
+
</i>
|
225
|
+
(see
|
226
|
+
<a href='http://www.icc.or.at'>http://www.icc.or.at</a>
|
227
|
+
)
|
228
|
+
</p>
|
229
|
+
<p id='ref11' class='Biblio'>
|
230
|
+
[5]  IETF RFC 10,
|
231
|
+
<i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
|
232
|
+
</p>
|
233
|
+
<p id='ref12' class='Biblio'>
|
234
|
+
[6]  Citn, IETF RFC 20, CitationWorks. 2019.
|
235
|
+
<i>How to cite a reference</i>
|
236
|
+
.
|
237
|
+
</p>
|
238
|
+
</div>
|
239
|
+
<aside id='fn:1' class='footnote'>
|
240
|
+
<p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
|
241
|
+
</aside>
|
242
|
+
</div>
|
243
|
+
</body>
|
244
|
+
</html>
|
245
|
+
|
177
246
|
OUTPUT
|
178
247
|
end
|
179
248
|
|