isodoc 1.6.7.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc-yaml/i18n-ar.yaml +19 -25
- data/lib/isodoc-yaml/i18n-de.yaml +1 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +1 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/convert.rb +1 -1
- data/lib/isodoc/function/blocks.rb +1 -1
- data/lib/isodoc/html_function/postprocess.rb +8 -4
- data/lib/isodoc/html_function/sectionsplit.rb +18 -4
- data/lib/isodoc/presentation_function/block.rb +7 -4
- data/lib/isodoc/presentation_function/inline.rb +7 -12
- data/lib/isodoc/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref.rb +8 -7
- data/lib/isodoc/xref/xref_anchor.rb +45 -44
- data/lib/isodoc/xref/xref_counter.rb +113 -103
- data/lib/isodoc/xref/xref_gen.rb +39 -11
- data/spec/isodoc/inline_spec.rb +157 -169
- data/spec/isodoc/postproc_spec.rb +68 -24
- data/spec/isodoc/xref_spec.rb +274 -652
- metadata +2 -2
@@ -1,33 +1,37 @@
|
|
1
1
|
require "roman-numerals"
|
2
2
|
|
3
|
-
module IsoDoc
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
if
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
3
|
+
module IsoDoc
|
4
|
+
module XrefGen
|
5
|
+
class Counter
|
6
|
+
def initialize(num = 0, opts = { numerals: :arabic })
|
7
|
+
@num = num
|
8
|
+
@letter = ""
|
9
|
+
@subseq = ""
|
10
|
+
@letter_override = nil
|
11
|
+
@number_override = nil
|
12
|
+
@style = opts[:numerals]
|
13
|
+
@skip_i = opts[:skip_i]
|
14
|
+
@base = ""
|
15
|
+
if num.is_a? String
|
16
|
+
if /^\d+$/.match?(num)
|
17
|
+
@num = num.to_i
|
18
|
+
else
|
19
|
+
@num = nil
|
20
|
+
@base = num[0..-2]
|
21
|
+
@letter = num[-1]
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
|
-
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
def new_subseq_increment(node)
|
27
|
+
@subseq = node["subsequence"]
|
28
|
+
@num += 1 unless @num.nil?
|
29
|
+
@letter = node["subsequence"] ? "a" : ""
|
30
|
+
@base = ""
|
31
|
+
new_subseq_increment1(node) if node["number"]
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_subseq_increment1(node)
|
31
35
|
/^(?<b>.*?)(?<n>\d*)(?<a>[a-zA-Z]*)$/ =~ node["number"]
|
32
36
|
if !n.empty? || !a.empty?
|
33
37
|
@letter_override = @letter = a unless a.empty?
|
@@ -38,108 +42,114 @@ module IsoDoc::XrefGen
|
|
38
42
|
@letter = @letter_override if /^[a-zA-Z]$/.match?(@letter_override)
|
39
43
|
end
|
40
44
|
end
|
41
|
-
end
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
def sequence_increment(node)
|
47
|
+
if node["number"]
|
48
|
+
@base = @letter_override = @number_override = ""
|
49
|
+
/^(?<b>.*?)(?<n>\d+)$/ =~ node["number"]
|
50
|
+
if blank?(n)
|
51
|
+
@num = nil
|
52
|
+
@base = node["number"][0..-2]
|
53
|
+
@letter = @letter_override = node["number"][-1]
|
54
|
+
else
|
55
|
+
@number_override = @num = n.to_i
|
56
|
+
@base = b
|
57
|
+
@letter = ""
|
58
|
+
end
|
59
|
+
else @num += 1
|
55
60
|
end
|
56
|
-
else
|
57
|
-
@num += 1
|
58
61
|
end
|
59
|
-
end
|
60
62
|
|
61
|
-
|
62
|
-
|
63
|
+
def subsequence_increment(node)
|
64
|
+
return increment_letter unless node["number"]
|
65
|
+
|
63
66
|
@base = ""
|
64
67
|
@letter_override = node["number"]
|
65
68
|
/^(?<b>.*?)(?<n>\d*)(?<a>[a-zA-Z])$/ =~ node["number"]
|
66
|
-
if blank?(a)
|
67
|
-
if /^\d+$/.match?(node["number"])
|
68
|
-
@letter_override = @letter = ""
|
69
|
-
@number_override = @num = node["number"].to_i
|
70
|
-
else
|
71
|
-
/^(?<b>.*)(?<a>[a-zA-Z])$/ =~ node["number"]
|
72
|
-
unless blank?(a)
|
73
|
-
@letter = @letter_override = a
|
74
|
-
@base = b
|
75
|
-
end
|
76
|
-
end
|
69
|
+
if blank?(a) then subsequence_increment_no_letter(node)
|
77
70
|
else
|
78
71
|
@letter_override = @letter = a
|
79
72
|
@base = b
|
80
73
|
@number_override = @num = n.to_i unless n.empty?
|
81
74
|
end
|
82
|
-
else
|
83
|
-
increment_letter
|
84
75
|
end
|
85
|
-
end
|
86
76
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
77
|
+
def subsequence_increment_no_letter(node)
|
78
|
+
if /^\d+$/.match?(node["number"])
|
79
|
+
@letter_override = @letter = ""
|
80
|
+
@number_override = @num = node["number"].to_i
|
81
|
+
else
|
82
|
+
/^(?<b>.*)(?<a>[a-zA-Z])$/ =~ node["number"]
|
83
|
+
unless blank?(a)
|
84
|
+
@letter = @letter_override = a
|
85
|
+
@base = b
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def string_inc(str, start)
|
91
|
+
return start if str.empty?
|
92
|
+
|
93
|
+
str[0..-2] + (str[-1].ord + 1).chr.to_s
|
95
94
|
end
|
96
|
-
|
97
|
-
|
95
|
+
|
96
|
+
def increment_letter
|
97
|
+
case @letter
|
98
|
+
when "Z"
|
99
|
+
@letter = "@"
|
100
|
+
@base = string_inc(@base, "A")
|
101
|
+
when "z"
|
102
|
+
@letter = "`"
|
103
|
+
@base = string_inc(@base, "a")
|
104
|
+
end
|
98
105
|
@letter = (@letter.ord + 1).chr.to_s
|
99
|
-
|
106
|
+
@skip_i && %w(i I).include?(@letter) and
|
107
|
+
@letter = (@letter.ord + 1).chr.to_s
|
108
|
+
end
|
100
109
|
|
101
|
-
|
102
|
-
|
103
|
-
|
110
|
+
def blank?(str)
|
111
|
+
str.nil? || str.empty?
|
112
|
+
end
|
104
113
|
|
105
|
-
|
106
|
-
|
114
|
+
def increment(node)
|
115
|
+
return self if node["unnumbered"]
|
107
116
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
117
|
+
@letter_override = nil
|
118
|
+
@number_override = nil
|
119
|
+
if node["subsequence"] != @subseq &&
|
120
|
+
!(blank?(node["subsequence"]) && blank?(@subseq))
|
121
|
+
new_subseq_increment(node)
|
122
|
+
elsif @letter.empty? then sequence_increment(node)
|
123
|
+
else subsequence_increment(node)
|
124
|
+
end
|
125
|
+
self
|
115
126
|
end
|
116
|
-
self
|
117
|
-
end
|
118
127
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
128
|
+
def print
|
129
|
+
num = @number_override || @num
|
130
|
+
out = @style == :roman && !num.nil? ? RomanNumerals.to_roman(num) : num
|
131
|
+
"#{@base}#{out}#{@letter_override || @letter}"
|
132
|
+
end
|
124
133
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
134
|
+
def ol_type(list, depth)
|
135
|
+
return list["type"].to_sym if list["type"]
|
136
|
+
return :arabic if [2, 7].include? depth
|
137
|
+
return :alphabet if [1, 6].include? depth
|
138
|
+
return :alphabet_upper if [4, 9].include? depth
|
139
|
+
return :roman if [3, 8].include? depth
|
140
|
+
return :roman_upper if [5, 10].include? depth
|
132
141
|
|
133
|
-
|
134
|
-
|
142
|
+
:arabic
|
143
|
+
end
|
135
144
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
145
|
+
def listlabel(list, depth)
|
146
|
+
case ol_type(list, depth)
|
147
|
+
when :arabic then @num.to_s
|
148
|
+
when :alphabet then (96 + @num).chr.to_s
|
149
|
+
when :alphabet_upper then (64 + @num).chr.to_s
|
150
|
+
when :roman then RomanNumerals.to_roman(@num).downcase
|
151
|
+
when :roman_upper then RomanNumerals.to_roman(@num).upcase
|
152
|
+
end
|
143
153
|
end
|
144
154
|
end
|
145
155
|
end
|
data/lib/isodoc/xref/xref_gen.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative "xref_gen_seq"
|
|
3
3
|
module IsoDoc::XrefGen
|
4
4
|
module Blocks
|
5
5
|
NUMBERED_BLOCKS = %w(termnote termexample note example requirement
|
6
|
-
|
6
|
+
recommendation permission figure table formula admonition sourcecode).freeze
|
7
7
|
|
8
8
|
def amend_preprocess(xmldoc)
|
9
9
|
xmldoc.xpath(ns("//amend[newcontent]")).each do |a|
|
@@ -60,9 +60,9 @@ module IsoDoc::XrefGen
|
|
60
60
|
|
61
61
|
c.increment(n)
|
62
62
|
idx = increment_label(examples, n, c, false)
|
63
|
-
@anchors[n["id"]] =
|
64
|
-
type: "termexample", label: idx, value: c.print,
|
65
|
-
|
63
|
+
@anchors[n["id"]] =
|
64
|
+
{ type: "termexample", label: idx, value: c.print,
|
65
|
+
xref: l10n("#{anchor(t['id'], :xref)}, "\
|
66
66
|
"#{@labels['example_xref']} #{c.print}") }
|
67
67
|
end
|
68
68
|
end
|
@@ -86,9 +86,8 @@ module IsoDoc::XrefGen
|
|
86
86
|
|
87
87
|
def note_anchor_names(sections)
|
88
88
|
sections.each do |s|
|
89
|
-
notes = s.xpath(CHILD_NOTES_XPATH)
|
90
89
|
c = Counter.new
|
91
|
-
notes.each do |n|
|
90
|
+
(notes = s.xpath(CHILD_NOTES_XPATH)).each do |n|
|
92
91
|
next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
|
93
92
|
|
94
93
|
@anchors[n["id"]] =
|
@@ -105,13 +104,12 @@ module IsoDoc::XrefGen
|
|
105
104
|
"xmlns:example | ./xmlns:example".freeze
|
106
105
|
|
107
106
|
CHILD_SECTIONS = "./clause | ./appendix | ./terms | ./definitions | "\
|
108
|
-
"./references"
|
107
|
+
"./references".freeze
|
109
108
|
|
110
109
|
def example_anchor_names(sections)
|
111
110
|
sections.each do |s|
|
112
|
-
notes = s.xpath(CHILD_EXAMPLES_XPATH)
|
113
111
|
c = Counter.new
|
114
|
-
notes.each do |n|
|
112
|
+
(notes = s.xpath(CHILD_EXAMPLES_XPATH)).each do |n|
|
115
113
|
next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
|
116
114
|
|
117
115
|
@anchors[n["id"]] =
|
@@ -145,14 +143,44 @@ module IsoDoc::XrefGen
|
|
145
143
|
label = "#{prev_label}.#{label}" unless prev_label.empty?
|
146
144
|
label = "#{list_anchor[:xref]} #{label}" if refer_list
|
147
145
|
li["id"] and @anchors[li["id"]] =
|
148
|
-
|
149
|
-
|
146
|
+
{ xref: "#{label})", type: "listitem",
|
147
|
+
container: list_anchor[:container] }
|
150
148
|
li.xpath(ns("./ol")).each do |ol|
|
151
149
|
list_item_anchor_names(ol, list_anchor, depth + 1, label, false)
|
152
150
|
end
|
153
151
|
end
|
154
152
|
end
|
155
153
|
|
154
|
+
def deflist_anchor_names(sections)
|
155
|
+
sections.each do |s|
|
156
|
+
notes = s.xpath(ns(".//dl")) - s.xpath(ns(".//clause//dl")) -
|
157
|
+
s.xpath(ns(".//appendix//dl")) - s.xpath(ns(".//dl//dl"))
|
158
|
+
c = Counter.new
|
159
|
+
notes.each do |n|
|
160
|
+
next if n["id"].nil? || n["id"].empty?
|
161
|
+
|
162
|
+
@anchors[n["id"]] =
|
163
|
+
anchor_struct(increment_label(notes, n, c), n,
|
164
|
+
@labels["deflist"], "deflist", false)
|
165
|
+
deflist_term_anchor_names(n, @anchors[n["id"]])
|
166
|
+
end
|
167
|
+
deflist_anchor_names(s.xpath(ns(CHILD_SECTIONS)))
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def deflist_term_anchor_names(list, list_anchor)
|
172
|
+
list.xpath(ns("./dt")).each do |li|
|
173
|
+
label = li.text
|
174
|
+
label = l10n("#{list_anchor[:xref]}: #{label}")
|
175
|
+
li["id"] and @anchors[li["id"]] =
|
176
|
+
{ xref: label, type: "deflistitem",
|
177
|
+
container: list_anchor[:container] }
|
178
|
+
li.xpath(ns("./dl")).each do |dl|
|
179
|
+
deflist_term_anchor_names(dl, list_anchor)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
156
184
|
def bookmark_anchor_names(docxml)
|
157
185
|
docxml.xpath(ns(".//bookmark")).each do |n|
|
158
186
|
next if n["id"].nil? || n["id"].empty?
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -139,19 +139,27 @@ RSpec.describe IsoDoc do
|
|
139
139
|
<preface><foreword>
|
140
140
|
<p>
|
141
141
|
<ul>
|
142
|
-
<li><concept
|
142
|
+
<li><concept><refterm>term</refterm>
|
143
143
|
<xref target='clause1'/>
|
144
144
|
</concept></li>
|
145
|
-
|
146
|
-
<
|
145
|
+
<li><concept><refterm>term</refterm>
|
146
|
+
<renderterm>term</renderterm>
|
147
|
+
<xref target='clause1'/>
|
148
|
+
</concept></li>
|
149
|
+
<li><concept><refterm>term</refterm>
|
150
|
+
<renderterm>w[o]rd</renderterm>
|
151
|
+
<xref target='clause1'>Clause #1</xref>
|
147
152
|
</concept></li>
|
148
|
-
<li><concept
|
153
|
+
<li><concept><refterm>term</refterm>
|
154
|
+
<renderterm>term</renderterm>
|
149
155
|
<eref bibitemid="ISO712" type="inline" citeas="ISO 712"/>
|
150
156
|
</concept></li>
|
151
|
-
<li><concept
|
152
|
-
<
|
157
|
+
<li><concept><refterm>term</refterm>
|
158
|
+
<renderterm>word</renderterm>
|
159
|
+
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">The Aforementioned Citation</eref>
|
153
160
|
</concept></li>
|
154
|
-
<li><concept>
|
161
|
+
<li><concept><refterm>term</refterm>
|
162
|
+
<renderterm>word</renderterm>
|
155
163
|
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
156
164
|
<locality type='clause'>
|
157
165
|
<referenceFrom>3.1</referenceFrom>
|
@@ -161,7 +169,8 @@ RSpec.describe IsoDoc do
|
|
161
169
|
</locality>
|
162
170
|
</eref>
|
163
171
|
</concept></li>
|
164
|
-
<li><concept>
|
172
|
+
<li><concept><refterm>term</refterm>
|
173
|
+
<renderterm>word</renderterm>
|
165
174
|
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
166
175
|
<localityStack>
|
167
176
|
<locality type='clause'>
|
@@ -175,7 +184,8 @@ RSpec.describe IsoDoc do
|
|
175
184
|
</localityStack>
|
176
185
|
</eref>
|
177
186
|
</concept></li>
|
178
|
-
<li><concept>
|
187
|
+
<li><concept><refterm>term</refterm>
|
188
|
+
<renderterm>word</renderterm>
|
179
189
|
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
180
190
|
<localityStack>
|
181
191
|
<locality type='clause'>
|
@@ -187,14 +197,16 @@ RSpec.describe IsoDoc do
|
|
187
197
|
<referenceFrom>b</referenceFrom>
|
188
198
|
</locality>
|
189
199
|
</localityStack>
|
190
|
-
|
200
|
+
The Aforementioned Citation
|
191
201
|
</eref>
|
192
202
|
</concept></li>
|
193
|
-
<li><concept
|
203
|
+
<li><concept><refterm>term</refterm>
|
204
|
+
<renderterm>word</renderterm>
|
194
205
|
<termref base='IEV' target='135-13-13'/>
|
195
206
|
</concept></li>
|
196
|
-
<li><concept
|
197
|
-
<
|
207
|
+
<li><concept><refterm>term</refterm>
|
208
|
+
<renderterm>word</renderterm>
|
209
|
+
<termref base='IEV' target='135-13-13'>The IEV database</termref>
|
198
210
|
</concept></li>
|
199
211
|
</ul>
|
200
212
|
</p>
|
@@ -219,190 +231,166 @@ RSpec.describe IsoDoc do
|
|
219
231
|
</iso-standard>
|
220
232
|
INPUT
|
221
233
|
presxml = <<~OUTPUT
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
</preface>
|
311
|
-
<sections>
|
312
|
-
<clause id='clause1' displayorder="3">
|
313
|
-
<title depth='1'>
|
314
|
-
2.
|
315
|
-
<tab/>
|
316
|
-
Clause 1
|
317
|
-
</title>
|
318
|
-
</clause>
|
319
|
-
</sections>
|
320
|
-
<bibliography>
|
321
|
-
<references id='_normative_references' obligation='informative' normative='true' displayorder="2">
|
322
|
-
<title depth='1'>
|
323
|
-
1.
|
324
|
-
<tab/>
|
325
|
-
Normative References
|
326
|
-
</title>
|
327
|
-
<p>
|
328
|
-
The following documents are referred to in the text in such a way that
|
329
|
-
some or all of their content constitutes requirements of this document.
|
330
|
-
For dated references, only the edition cited applies. For undated
|
331
|
-
references, the latest edition of the referenced document (including any
|
332
|
-
amendments) applies.
|
333
|
-
</p>
|
334
|
-
<bibitem id='ISO712' type='standard'>
|
335
|
-
<title format='text/plain'>Cereals or cereal products</title>
|
336
|
-
<title type='main' format='text/plain'>Cereals and cereal products</title>
|
337
|
-
<docidentifier type='ISO'>ISO 712</docidentifier>
|
338
|
-
<contributor>
|
339
|
-
<role type='publisher'/>
|
340
|
-
<organization>
|
341
|
-
<name>International Organization for Standardization</name>
|
342
|
-
</organization>
|
343
|
-
</contributor>
|
344
|
-
</bibitem>
|
345
|
-
</references>
|
346
|
-
</bibliography>
|
347
|
-
</iso-standard>
|
234
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
235
|
+
<preface><foreword displayorder="1">
|
236
|
+
<p>
|
237
|
+
<ul>
|
238
|
+
<li>
|
239
|
+
[term defined in <xref target="clause1">Clause 2</xref>]
|
240
|
+
</li>
|
241
|
+
<li>
|
242
|
+
<em>term</em>
|
243
|
+
[term defined in <xref target="clause1">Clause 2</xref>]
|
244
|
+
</li>
|
245
|
+
<li>
|
246
|
+
<em>w[o]rd</em>
|
247
|
+
[term defined in <xref target="clause1">Clause #1</xref>]
|
248
|
+
</li>
|
249
|
+
<li>
|
250
|
+
<em>term</em>
|
251
|
+
[term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712">ISO 712</eref>]
|
252
|
+
</li>
|
253
|
+
<li>
|
254
|
+
<em>word</em>
|
255
|
+
[term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712">The Aforementioned Citation</eref>]
|
256
|
+
</li>
|
257
|
+
<li>
|
258
|
+
<em>word</em>
|
259
|
+
[term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712"><locality type="clause">
|
260
|
+
<referenceFrom>3.1</referenceFrom>
|
261
|
+
</locality><locality type="figure">
|
262
|
+
<referenceFrom>a</referenceFrom>
|
263
|
+
</locality>ISO 712, Clause 3.1, Figure a</eref>]
|
264
|
+
</li>
|
265
|
+
<li>
|
266
|
+
<em>word</em>
|
267
|
+
[term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712"><localityStack>
|
268
|
+
<locality type="clause">
|
269
|
+
<referenceFrom>3.1</referenceFrom>
|
270
|
+
</locality>
|
271
|
+
</localityStack><localityStack>
|
272
|
+
<locality type="figure">
|
273
|
+
<referenceFrom>b</referenceFrom>
|
274
|
+
</locality>
|
275
|
+
</localityStack>ISO 712, Clause 3.1; Figure b</eref>]
|
276
|
+
</li>
|
277
|
+
<li>
|
278
|
+
<em>word</em>
|
279
|
+
[term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
280
|
+
<localityStack>
|
281
|
+
<locality type="clause">
|
282
|
+
<referenceFrom>3.1</referenceFrom>
|
283
|
+
</locality>
|
284
|
+
</localityStack>
|
285
|
+
<localityStack>
|
286
|
+
<locality type="figure">
|
287
|
+
<referenceFrom>b</referenceFrom>
|
288
|
+
</locality>
|
289
|
+
</localityStack>
|
290
|
+
The Aforementioned Citation
|
291
|
+
</eref>]
|
292
|
+
</li>
|
293
|
+
<li>
|
294
|
+
<em>word</em>
|
295
|
+
[term defined in <termref base="IEV" target="135-13-13"/>]
|
296
|
+
</li>
|
297
|
+
<li>
|
298
|
+
<em>word</em>
|
299
|
+
[term defined in <termref base="IEV" target="135-13-13">The IEV database</termref>]
|
300
|
+
</li>
|
301
|
+
</ul>
|
302
|
+
</p>
|
303
|
+
</foreword></preface>
|
304
|
+
<sections>
|
305
|
+
<clause id="clause1" displayorder="3"><title depth="1">2.<tab/>Clause 1</title></clause>
|
306
|
+
</sections>
|
307
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="2"><title depth="1">1.<tab/>Normative References</title>
|
308
|
+
<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>
|
309
|
+
<bibitem id="ISO712" type="standard">
|
310
|
+
<title format="text/plain">Cereals or cereal products</title>
|
311
|
+
<title type="main" format="text/plain">Cereals and cereal products</title>
|
312
|
+
<docidentifier type="ISO">ISO 712</docidentifier>
|
313
|
+
<contributor>
|
314
|
+
<role type="publisher"/>
|
315
|
+
<organization>
|
316
|
+
<name>International Organization for Standardization</name>
|
317
|
+
</organization>
|
318
|
+
</contributor>
|
319
|
+
</bibitem>
|
320
|
+
</references></bibliography>
|
321
|
+
</iso-standard>
|
348
322
|
OUTPUT
|
349
323
|
output = <<~OUTPUT
|
350
324
|
#{HTML_HDR}
|
351
|
-
|
325
|
+
<br/>
|
352
326
|
<div>
|
353
327
|
<h1 class='ForewordTitle'>Foreword</h1>
|
354
328
|
<p>
|
355
329
|
<ul>
|
356
330
|
<li>
|
357
|
-
|
358
|
-
|
359
|
-
|
331
|
+
[term defined in
|
332
|
+
<a href='#clause1'>Clause 2</a>
|
333
|
+
]
|
334
|
+
</li>
|
335
|
+
<li>
|
336
|
+
<i>term</i>
|
337
|
+
[term defined in
|
338
|
+
<a href='#clause1'>Clause 2</a>
|
339
|
+
]
|
340
|
+
</li>
|
341
|
+
<li>
|
342
|
+
<i>w[o]rd</i>
|
343
|
+
[term defined in
|
344
|
+
<a href='#clause1'>Clause #1</a>
|
345
|
+
]
|
360
346
|
</li>
|
361
347
|
<li>
|
362
|
-
<i>
|
363
|
-
|
364
|
-
</
|
348
|
+
<i>term</i>
|
349
|
+
[term defined in
|
350
|
+
<a href='#ISO712'>ISO 712</a>
|
351
|
+
]
|
365
352
|
</li>
|
366
353
|
<li>
|
367
|
-
<i>
|
368
|
-
|
369
|
-
</
|
354
|
+
<i>word</i>
|
355
|
+
[term defined in
|
356
|
+
<a href='#ISO712'>The Aforementioned Citation</a>
|
357
|
+
]
|
370
358
|
</li>
|
371
359
|
<li>
|
372
|
-
<i>
|
373
|
-
|
374
|
-
</
|
360
|
+
<i>word</i>
|
361
|
+
[term defined in
|
362
|
+
<a href='#ISO712'>ISO 712, Clause 3.1, Figure a</a>
|
363
|
+
]
|
375
364
|
</li>
|
376
365
|
<li>
|
377
|
-
<i>
|
378
|
-
|
379
|
-
</
|
366
|
+
<i>word</i>
|
367
|
+
[term defined in
|
368
|
+
<a href='#ISO712'>ISO 712, Clause 3.1; Figure b</a>
|
369
|
+
]
|
380
370
|
</li>
|
381
371
|
<li>
|
382
|
-
<i>
|
383
|
-
|
384
|
-
</
|
372
|
+
<i>word</i>
|
373
|
+
[term defined in
|
374
|
+
<a href='#ISO712'> The Aforementioned Citation </a>
|
375
|
+
]
|
385
376
|
</li>
|
386
377
|
<li>
|
387
|
-
<i>
|
388
|
-
|
389
|
-
<i>word</i>
|
390
|
-
</a>
|
391
|
-
</i>
|
378
|
+
<i>word</i>
|
379
|
+
[term defined in Termbase IEV, term ID 135-13-13]
|
392
380
|
</li>
|
393
|
-
<li> [term defined in Termbase IEV, term ID 135-13-13 ] </li>
|
394
381
|
<li>
|
395
|
-
<i>
|
382
|
+
<i>word</i>
|
383
|
+
[term defined in Termbase IEV, term ID 135-13-13]
|
396
384
|
</li>
|
397
385
|
</ul>
|
398
386
|
</p>
|
399
387
|
</div>
|
400
388
|
<p class='zzSTDTitle1'/>
|
401
389
|
<div>
|
402
|
-
<h1>
|
390
|
+
<h1>1.  Normative References</h1>
|
403
391
|
<p>
|
404
|
-
|
405
|
-
|
392
|
+
The following documents are referred to in the text in such a way that
|
393
|
+
some or all of their content constitutes requirements of this
|
406
394
|
document. For dated references, only the edition cited applies. For
|
407
395
|
undated references, the latest edition of the referenced document
|
408
396
|
(including any amendments) applies.
|
@@ -413,7 +401,7 @@ RSpec.describe IsoDoc do
|
|
413
401
|
</p>
|
414
402
|
</div>
|
415
403
|
<div id='clause1'>
|
416
|
-
<h1>
|
404
|
+
<h1>2.  Clause 1</h1>
|
417
405
|
</div>
|
418
406
|
</div>
|
419
407
|
</body>
|