isodoc 1.2.0 → 1.2.5
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-fr.yaml +1 -1
- data/lib/isodoc/base_style/metanorma_word.css +6 -0
- data/lib/isodoc/base_style/metanorma_word.scss +6 -0
- data/lib/isodoc/convert.rb +1 -1
- data/lib/isodoc/function/blocks.rb +1 -0
- data/lib/isodoc/function/cleanup.rb +1 -1
- data/lib/isodoc/function/references.rb +4 -2
- data/lib/isodoc/function/section.rb +13 -1
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +2 -0
- data/lib/isodoc/function/utils.rb +2 -2
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/i18n.rb +0 -1
- data/lib/isodoc/metadata.rb +10 -4
- data/lib/isodoc/presentation_function/bibdata.rb +24 -0
- data/lib/isodoc/presentation_function/block.rb +14 -0
- data/lib/isodoc/presentation_function/inline.rb +27 -14
- data/lib/isodoc/presentation_xml_convert.rb +4 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +1 -0
- data/lib/isodoc/word_function/postprocess.rb +1 -1
- data/lib/isodoc/word_function/table.rb +3 -2
- data/lib/isodoc/xref.rb +1 -0
- data/lib/isodoc/xref/xref_anchor.rb +8 -3
- data/lib/isodoc/xref/xref_counter.rb +21 -7
- data/lib/isodoc/xref/xref_gen.rb +29 -6
- data/lib/isodoc/xref/xref_sect_gen.rb +1 -1
- data/spec/assets/i18n.yaml +9 -0
- data/spec/isodoc/blocks_spec.rb +281 -13
- data/spec/isodoc/cleanup_spec.rb +3 -1
- data/spec/isodoc/i18n_spec.rb +43 -5
- data/spec/isodoc/inline_spec.rb +47 -5
- data/spec/isodoc/metadata_spec.rb +3 -1
- data/spec/isodoc/postproc_spec.rb +39 -3
- data/spec/isodoc/ref_spec.rb +4 -1
- data/spec/isodoc/section_spec.rb +134 -10
- data/spec/isodoc/table_spec.rb +306 -207
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +46 -18
- metadata +3 -2
@@ -8,17 +8,20 @@ module IsoDoc::XrefGen
|
|
8
8
|
@subseq = ""
|
9
9
|
@letter_override = nil
|
10
10
|
@number_override = nil
|
11
|
+
@base = ""
|
11
12
|
end
|
12
13
|
|
13
14
|
def new_subseq_increment(node)
|
14
15
|
@subseq = node["subsequence"]
|
15
16
|
@num += 1
|
16
17
|
@letter = node["subsequence"] ? "a" : ""
|
18
|
+
@base = ""
|
17
19
|
if node["number"]
|
18
|
-
/^(?<n>\d*)(?<a>[a-z]*)$/ =~ node["number"]
|
19
|
-
if n || a
|
20
|
-
@letter_override = @letter = a
|
21
|
-
@number_override = @num = n.to_i
|
20
|
+
/^(?<b>.*?)(?<n>\d*)(?<a>[a-z]*)$/ =~ node["number"]
|
21
|
+
if !n.empty? || !a.empty?
|
22
|
+
@letter_override = @letter = a unless a.empty?
|
23
|
+
@number_override = @num = n.to_i unless n.empty?
|
24
|
+
@base = b
|
22
25
|
else
|
23
26
|
@letter_override = node["number"]
|
24
27
|
@letter = @letter_override if /^[a-z]$/.match(@letter_override)
|
@@ -28,8 +31,13 @@ module IsoDoc::XrefGen
|
|
28
31
|
|
29
32
|
def sequence_increment(node)
|
30
33
|
if node["number"]
|
34
|
+
@base = ""
|
31
35
|
@number_override = node["number"]
|
32
|
-
|
36
|
+
/^(?<b>.*?)(?<n>\d+)$/ =~ node["number"]
|
37
|
+
unless n.nil? || n.empty?
|
38
|
+
@num = n.to_i
|
39
|
+
@base = b
|
40
|
+
end
|
33
41
|
else
|
34
42
|
@num += 1
|
35
43
|
end
|
@@ -37,8 +45,14 @@ module IsoDoc::XrefGen
|
|
37
45
|
|
38
46
|
def subsequence_increment(node)
|
39
47
|
if node["number"]
|
48
|
+
@base = ""
|
40
49
|
@letter_override = node["number"]
|
41
|
-
|
50
|
+
/^(?<b>.*?)(?<n>\d*)(?<a>[a-z]+)$/ =~ node["number"]
|
51
|
+
unless a.empty?
|
52
|
+
@letter = a
|
53
|
+
@base = b
|
54
|
+
@number_override = @num = n.to_i unless n.empty?
|
55
|
+
end
|
42
56
|
else
|
43
57
|
@letter = (@letter.ord + 1).chr.to_s
|
44
58
|
end
|
@@ -59,7 +73,7 @@ module IsoDoc::XrefGen
|
|
59
73
|
end
|
60
74
|
|
61
75
|
def print
|
62
|
-
"#{@number_override || @num}#{@letter_override || @letter}"
|
76
|
+
"#{@base}#{@number_override || @num}#{@letter_override || @letter}"
|
63
77
|
end
|
64
78
|
|
65
79
|
def listlabel(depth)
|
data/lib/isodoc/xref/xref_gen.rb
CHANGED
@@ -2,6 +2,29 @@ require_relative "xref_gen_seq.rb"
|
|
2
2
|
|
3
3
|
module IsoDoc::XrefGen
|
4
4
|
module Blocks
|
5
|
+
NUMBERED_BLOCKS = %w(termnote termexample note example requirement
|
6
|
+
recommendation permission figure table formula admonition sourcecode).freeze
|
7
|
+
|
8
|
+
def amend_preprocess(xmldoc)
|
9
|
+
xmldoc.xpath(ns("//amend[newcontent]")).each do |a|
|
10
|
+
autonum = amend_autonums(a)
|
11
|
+
NUMBERED_BLOCKS.each do |b|
|
12
|
+
a.xpath(ns("./newcontent//#{b}")).each_with_index do |e, i|
|
13
|
+
autonum[b] and i == 0 and e["number"] = autonum[b]
|
14
|
+
!autonum[b] and e["unnumbered"] = "true"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def amend_autonums(a)
|
21
|
+
autonum = {}
|
22
|
+
a.xpath(ns("./autonumber")).each do |n|
|
23
|
+
autonum[n["type"]] = n.text
|
24
|
+
end
|
25
|
+
autonum
|
26
|
+
end
|
27
|
+
|
5
28
|
def termnote_label(n)
|
6
29
|
@labels["termnote"].gsub(/%/, n.to_s)
|
7
30
|
end
|
@@ -13,7 +36,7 @@ module IsoDoc::XrefGen
|
|
13
36
|
return if n["id"].nil? || n["id"].empty?
|
14
37
|
c.increment(n)
|
15
38
|
@anchors[n["id"]] =
|
16
|
-
{ label: termnote_label(c.print), type: "termnote",
|
39
|
+
{ label: termnote_label(c.print), type: "termnote", value: c.print,
|
17
40
|
xref: l10n("#{anchor(t['id'], :xref)}, "\
|
18
41
|
"#{@labels["note_xref"]} #{c.print}") }
|
19
42
|
end
|
@@ -27,9 +50,9 @@ module IsoDoc::XrefGen
|
|
27
50
|
examples.each do |n|
|
28
51
|
return if n["id"].nil? || n["id"].empty?
|
29
52
|
c.increment(n)
|
30
|
-
idx = examples.size == 1 ? "" : c.print
|
53
|
+
idx = examples.size == 1 && !n["number"] ? "" : c.print
|
31
54
|
@anchors[n["id"]] = {
|
32
|
-
type: "termexample", label: idx,
|
55
|
+
type: "termexample", label: idx, value: c.print,
|
33
56
|
xref: l10n("#{anchor(t['id'], :xref)}, "\
|
34
57
|
"#{@labels["example_xref"]} #{c.print}") }
|
35
58
|
end
|
@@ -54,7 +77,7 @@ module IsoDoc::XrefGen
|
|
54
77
|
c = Counter.new
|
55
78
|
notes.each do |n|
|
56
79
|
next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
|
57
|
-
idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
|
80
|
+
idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
|
58
81
|
@anchors[n["id"]] = anchor_struct(idx, n, @labels["note_xref"],
|
59
82
|
"note", false)
|
60
83
|
end
|
@@ -76,7 +99,7 @@ module IsoDoc::XrefGen
|
|
76
99
|
notes.each do |n|
|
77
100
|
next if @anchors[n["id"]]
|
78
101
|
next if n["id"].nil? || n["id"].empty?
|
79
|
-
idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
|
102
|
+
idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
|
80
103
|
@anchors[n["id"]] = anchor_struct(idx, n, @labels["example_xref"],
|
81
104
|
"example", n["unnumbered"])
|
82
105
|
end
|
@@ -91,7 +114,7 @@ module IsoDoc::XrefGen
|
|
91
114
|
c = Counter.new
|
92
115
|
notes.each do |n|
|
93
116
|
next if n["id"].nil? || n["id"].empty?
|
94
|
-
idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
|
117
|
+
idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
|
95
118
|
@anchors[n["id"]] = anchor_struct(idx, n, @labels["list"], "list", false)
|
96
119
|
list_item_anchor_names(n, @anchors[n["id"]], 1, "", notes.size != 1)
|
97
120
|
end
|
@@ -113,7 +113,7 @@ module IsoDoc::XrefGen
|
|
113
113
|
|
114
114
|
def annex_names(clause, num)
|
115
115
|
@anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
|
116
|
-
type: "clause",
|
116
|
+
type: "clause", value: num.to_s,
|
117
117
|
xref: "#{@labels["annex"]} #{num}", level: 1 }
|
118
118
|
if a = single_annex_special_section(clause)
|
119
119
|
annex_names1(a, "#{num}", 1)
|
data/spec/assets/i18n.yaml
CHANGED
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -1,6 +1,257 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
+
it "processes amend blocks" do
|
5
|
+
input = <<~INPUT
|
6
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
7
|
+
<bibdata type='standard'>
|
8
|
+
<title language='en' format='text/plain'>Document title</title>
|
9
|
+
<language>en</language>
|
10
|
+
<script>Latn</script>
|
11
|
+
<status>
|
12
|
+
<stage>published</stage>
|
13
|
+
</status>
|
14
|
+
<copyright>
|
15
|
+
<from>2020</from>
|
16
|
+
</copyright>
|
17
|
+
<ext>
|
18
|
+
<doctype>article</doctype>
|
19
|
+
</ext>
|
20
|
+
</bibdata>
|
21
|
+
<sections>
|
22
|
+
<clause id='A' inline-header='false' obligation='normative'>
|
23
|
+
<title>Change Clause</title>
|
24
|
+
<amend id='B' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
|
25
|
+
<autonumber type='table'>2</autonumber>
|
26
|
+
<autonumber type='example'>7</autonumber>
|
27
|
+
<description>
|
28
|
+
<p id='C'>
|
29
|
+
<em>
|
30
|
+
This table contains information on polygon cells which are not
|
31
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
32
|
+
with:
|
33
|
+
</em>
|
34
|
+
</p>
|
35
|
+
</description>
|
36
|
+
<newcontent id='D'>
|
37
|
+
<table id='E'>
|
38
|
+
<name>Edges of triangle and quadrilateral cells</name>
|
39
|
+
<tbody>
|
40
|
+
<tr>
|
41
|
+
<th colspan='2' valign='middle' align='center'>triangle</th>
|
42
|
+
<th colspan='2' valign='middle' align='center'>quadrilateral</th>
|
43
|
+
</tr>
|
44
|
+
<tr>
|
45
|
+
<td valign='middle' align='center'>edge</td>
|
46
|
+
<td valign='middle' align='center'>vertices</td>
|
47
|
+
<td valign='middle' align='center'>edge</td>
|
48
|
+
<td valign='middle' align='center'>vertices</td>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td valign='middle' align='center'>1</td>
|
52
|
+
<td valign='middle' align='center'>1, 2</td>
|
53
|
+
<td valign='middle' align='center'>1</td>
|
54
|
+
<td valign='middle' align='center'>1, 2</td>
|
55
|
+
</tr>
|
56
|
+
<tr>
|
57
|
+
<td valign='middle' align='center'>2</td>
|
58
|
+
<td valign='middle' align='center'>2, 3</td>
|
59
|
+
<td valign='middle' align='center'>2</td>
|
60
|
+
<td valign='middle' align='center'>2, 3</td>
|
61
|
+
</tr>
|
62
|
+
<tr>
|
63
|
+
<td valign='middle' align='center'>3</td>
|
64
|
+
<td valign='middle' align='center'>3, 1</td>
|
65
|
+
<td valign='middle' align='center'>3</td>
|
66
|
+
<td valign='middle' align='center'>3, 4</td>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td valign='top' align='left'/>
|
70
|
+
<td valign='top' align='left'/>
|
71
|
+
<td valign='middle' align='center'>4</td>
|
72
|
+
<td valign='middle' align='center'>4, 1</td>
|
73
|
+
</tr>
|
74
|
+
</tbody>
|
75
|
+
</table>
|
76
|
+
<figure id="H"><name>Figure</name></figure>
|
77
|
+
<example id='F'>
|
78
|
+
<p id='G'>This is not generalised further.</p>
|
79
|
+
</example>
|
80
|
+
</newcontent>
|
81
|
+
</amend>
|
82
|
+
</clause>
|
83
|
+
</sections>
|
84
|
+
</standard-document>
|
85
|
+
INPUT
|
86
|
+
presxml = <<~OUTPUT
|
87
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="presentation">
|
88
|
+
<bibdata type="standard">
|
89
|
+
<title language="en" format="text/plain">Document title</title>
|
90
|
+
<language>en</language>
|
91
|
+
<script>Latn</script>
|
92
|
+
<status>
|
93
|
+
<stage>published</stage>
|
94
|
+
</status>
|
95
|
+
<copyright>
|
96
|
+
<from>2020</from>
|
97
|
+
</copyright>
|
98
|
+
<ext>
|
99
|
+
<doctype>article</doctype>
|
100
|
+
</ext>
|
101
|
+
</bibdata>
|
102
|
+
<local_bibdata type='standard'>
|
103
|
+
<title language='en' format='text/plain'>Document title</title>
|
104
|
+
<language>en</language>
|
105
|
+
<script>Latn</script>
|
106
|
+
<status>
|
107
|
+
<stage>published</stage>
|
108
|
+
</status>
|
109
|
+
<copyright>
|
110
|
+
<from>2020</from>
|
111
|
+
</copyright>
|
112
|
+
<ext>
|
113
|
+
<doctype>article</doctype>
|
114
|
+
</ext>
|
115
|
+
</local_bibdata>
|
116
|
+
<sections>
|
117
|
+
<clause id="A" inline-header="false" obligation="normative">
|
118
|
+
<title depth="1">1.<tab/>Change Clause</title>
|
119
|
+
<p id="C">
|
120
|
+
<em>
|
121
|
+
This table contains information on polygon cells which are not
|
122
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
123
|
+
with:
|
124
|
+
</em>
|
125
|
+
</p>
|
126
|
+
<quote id="D">
|
127
|
+
<table id="E" number="2">
|
128
|
+
<name>Table 2 — Edges of triangle and quadrilateral cells</name>
|
129
|
+
<tbody>
|
130
|
+
<tr>
|
131
|
+
<th colspan="2" valign="middle" align="center">triangle</th>
|
132
|
+
<th colspan="2" valign="middle" align="center">quadrilateral</th>
|
133
|
+
</tr>
|
134
|
+
<tr>
|
135
|
+
<td valign="middle" align="center">edge</td>
|
136
|
+
<td valign="middle" align="center">vertices</td>
|
137
|
+
<td valign="middle" align="center">edge</td>
|
138
|
+
<td valign="middle" align="center">vertices</td>
|
139
|
+
</tr>
|
140
|
+
<tr>
|
141
|
+
<td valign="middle" align="center">1</td>
|
142
|
+
<td valign="middle" align="center">1, 2</td>
|
143
|
+
<td valign="middle" align="center">1</td>
|
144
|
+
<td valign="middle" align="center">1, 2</td>
|
145
|
+
</tr>
|
146
|
+
<tr>
|
147
|
+
<td valign="middle" align="center">2</td>
|
148
|
+
<td valign="middle" align="center">2, 3</td>
|
149
|
+
<td valign="middle" align="center">2</td>
|
150
|
+
<td valign="middle" align="center">2, 3</td>
|
151
|
+
</tr>
|
152
|
+
<tr>
|
153
|
+
<td valign="middle" align="center">3</td>
|
154
|
+
<td valign="middle" align="center">3, 1</td>
|
155
|
+
<td valign="middle" align="center">3</td>
|
156
|
+
<td valign="middle" align="center">3, 4</td>
|
157
|
+
</tr>
|
158
|
+
<tr>
|
159
|
+
<td valign="top" align="left"/>
|
160
|
+
<td valign="top" align="left"/>
|
161
|
+
<td valign="middle" align="center">4</td>
|
162
|
+
<td valign="middle" align="center">4, 1</td>
|
163
|
+
</tr>
|
164
|
+
</tbody>
|
165
|
+
</table>
|
166
|
+
<figure id="H" unnumbered="true"><name>Figure</name></figure>
|
167
|
+
<example id="F" number="7"><name>EXAMPLE 7</name>
|
168
|
+
<p id="G">This is not generalised further.</p>
|
169
|
+
</example>
|
170
|
+
</quote>
|
171
|
+
</clause>
|
172
|
+
</sections>
|
173
|
+
</standard-document>
|
174
|
+
OUTPUT
|
175
|
+
html = <<~OUTPUT
|
176
|
+
<html lang='en'>
|
177
|
+
<head/>
|
178
|
+
<body lang='en'>
|
179
|
+
<div class='title-section'>
|
180
|
+
<p> </p>
|
181
|
+
</div>
|
182
|
+
<br/>
|
183
|
+
<div class='prefatory-section'>
|
184
|
+
<p> </p>
|
185
|
+
</div>
|
186
|
+
<br/>
|
187
|
+
<div class='main-section'>
|
188
|
+
<p class='zzSTDTitle1'>Document title</p>
|
189
|
+
<div id='A'>
|
190
|
+
<h1>1.  Change Clause</h1>
|
191
|
+
<p id='C'>
|
192
|
+
<i>
|
193
|
+
This table contains information on polygon cells which are not
|
194
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
195
|
+
with:
|
196
|
+
</i>
|
197
|
+
</p>
|
198
|
+
<div class='Quote' id="D">
|
199
|
+
<p class='TableTitle' style='text-align:center;'>Table 2 — Edges of triangle and quadrilateral cells</p>
|
200
|
+
<table id='E' class='MsoISOTable' style='border-width:1px;border-spacing:0;'>
|
201
|
+
<tbody>
|
202
|
+
<tr>
|
203
|
+
<th colspan='2' style='font-weight:bold;text-align:center;vertical-align:middle;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;' scope='row'>triangle</th>
|
204
|
+
<th colspan='2' style='font-weight:bold;text-align:center;vertical-align:middle;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;' scope='row'>quadrilateral</th>
|
205
|
+
</tr>
|
206
|
+
<tr>
|
207
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>edge</td>
|
208
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>vertices</td>
|
209
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>edge</td>
|
210
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>vertices</td>
|
211
|
+
</tr>
|
212
|
+
<tr>
|
213
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1</td>
|
214
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1, 2</td>
|
215
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1</td>
|
216
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>1, 2</td>
|
217
|
+
</tr>
|
218
|
+
<tr>
|
219
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2</td>
|
220
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2, 3</td>
|
221
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2</td>
|
222
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>2, 3</td>
|
223
|
+
</tr>
|
224
|
+
<tr>
|
225
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3</td>
|
226
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3, 1</td>
|
227
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3</td>
|
228
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.0pt;'>3, 4</td>
|
229
|
+
</tr>
|
230
|
+
<tr>
|
231
|
+
<td style='text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;'/>
|
232
|
+
<td style='text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;'/>
|
233
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.5pt;'>4</td>
|
234
|
+
<td style='text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.5pt;'>4, 1</td>
|
235
|
+
</tr>
|
236
|
+
</tbody>
|
237
|
+
</table>
|
238
|
+
<div id='H' class='figure'>
|
239
|
+
<p class='FigureTitle' style='text-align:center;'>Figure</p>
|
240
|
+
</div>
|
241
|
+
<div id='F' class='example'>
|
242
|
+
<p class='example-title'>EXAMPLE 7</p>
|
243
|
+
<p id='G'>This is not generalised further.</p>
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
</div>
|
248
|
+
</body>
|
249
|
+
</html>
|
250
|
+
OUTPUT
|
251
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
252
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
253
|
+
end
|
254
|
+
|
4
255
|
it "processes unlabelled notes (Presentation XML)" do
|
5
256
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
257
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -12,7 +263,7 @@ RSpec.describe IsoDoc do
|
|
12
263
|
</iso-standard>
|
13
264
|
INPUT
|
14
265
|
<?xml version='1.0'?>
|
15
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
266
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
16
267
|
<preface>
|
17
268
|
<foreword>
|
18
269
|
<note id='A' keep-with-next='true' keep-lines-together='true'>
|
@@ -115,7 +366,7 @@ OUTPUT
|
|
115
366
|
</iso-standard>
|
116
367
|
INPUT
|
117
368
|
<?xml version='1.0'?>
|
118
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
369
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
119
370
|
<preface>
|
120
371
|
<foreword>
|
121
372
|
<note id='note1'>
|
@@ -403,7 +654,7 @@ B</pre>
|
|
403
654
|
</iso-standard>
|
404
655
|
INPUT
|
405
656
|
<?xml version='1.0'?>
|
406
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
657
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
407
658
|
<preface><foreword>
|
408
659
|
<figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
|
409
660
|
<name>Figure 1 — Split-it-right <em>sample</em> divider<fn reference="1"><p>X</p></fn></name>
|
@@ -703,7 +954,7 @@ OUTPUT
|
|
703
954
|
</iso-standard>
|
704
955
|
INPUT
|
705
956
|
<?xml version='1.0'?>
|
706
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
957
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
707
958
|
<preface>
|
708
959
|
<foreword>
|
709
960
|
<example id='samplecode' keep-with-next='true' keep-lines-together='true'>
|
@@ -819,7 +1070,7 @@ OUTPUT
|
|
819
1070
|
</iso-standard>
|
820
1071
|
INPUT
|
821
1072
|
<?xml version='1.0'?>
|
822
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1073
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
823
1074
|
<preface>
|
824
1075
|
<foreword>
|
825
1076
|
<example id='samplecode'>
|
@@ -855,7 +1106,7 @@ Que?
|
|
855
1106
|
</iso-standard>
|
856
1107
|
INPUT
|
857
1108
|
<?xml version='1.0'?>
|
858
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1109
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
859
1110
|
<preface>
|
860
1111
|
<foreword>
|
861
1112
|
<sourcecode lang='ruby' id='samplecode'>
|
@@ -1093,7 +1344,7 @@ Que?
|
|
1093
1344
|
</iso-standard>
|
1094
1345
|
INPUT
|
1095
1346
|
<?xml version='1.0'?>
|
1096
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1347
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1097
1348
|
<preface>
|
1098
1349
|
<foreword>
|
1099
1350
|
<formula id='_be9158af-7e93-4ee2-90c5-26d31c181934' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
|
@@ -1346,7 +1597,7 @@ it "processes blockquotes (Presentation XML)" do
|
|
1346
1597
|
</iso-standard>
|
1347
1598
|
INPUT
|
1348
1599
|
<?xml version='1.0'?>
|
1349
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1600
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1350
1601
|
<preface>
|
1351
1602
|
<foreword>
|
1352
1603
|
<quote id='_044bd364-c832-4b78-8fea-92242402a1d1'>
|
@@ -1485,7 +1736,7 @@ it "processes blockquotes (Presentation XML)" do
|
|
1485
1736
|
</iso-standard>
|
1486
1737
|
INPUT
|
1487
1738
|
<?xml version='1.0'?>
|
1488
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1739
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1489
1740
|
<preface>
|
1490
1741
|
<foreword>
|
1491
1742
|
<permission id='_' keep-with-next='true' keep-lines-together='true'>
|
@@ -1845,7 +2096,7 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
|
|
1845
2096
|
</iso-standard>
|
1846
2097
|
INPUT
|
1847
2098
|
<?xml version='1.0'?>
|
1848
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
2099
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1849
2100
|
<preface>
|
1850
2101
|
<foreword>
|
1851
2102
|
<requirement id='A' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
|
@@ -2045,11 +2296,15 @@ end
|
|
2045
2296
|
</iso-standard>
|
2046
2297
|
INPUT
|
2047
2298
|
<?xml version='1.0'?>
|
2048
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
2299
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2049
2300
|
<bibdata>
|
2050
2301
|
<language>fr</language>
|
2051
2302
|
<script>Latn</script>
|
2052
2303
|
</bibdata>
|
2304
|
+
<local_bibdata>
|
2305
|
+
<language>fr</language>
|
2306
|
+
<script>Latn</script>
|
2307
|
+
</local_bibdata>
|
2053
2308
|
<preface>
|
2054
2309
|
<foreword>
|
2055
2310
|
<requirement id='A' unnumbered='true'>
|
@@ -2114,6 +2369,10 @@ end
|
|
2114
2369
|
<language>fr</language>
|
2115
2370
|
<script>Latn</script>
|
2116
2371
|
</bibdata>
|
2372
|
+
<local_bibdata>
|
2373
|
+
<language>fr</language>
|
2374
|
+
<script>Latn</script>
|
2375
|
+
</local_bibdata>
|
2117
2376
|
<preface><foreword>
|
2118
2377
|
<requirement id="A" unnumbered="true">
|
2119
2378
|
<name>Exigence</name>
|
@@ -2276,7 +2535,7 @@ end
|
|
2276
2535
|
</iso-standard>
|
2277
2536
|
INPUT
|
2278
2537
|
<?xml version='1.0'?>
|
2279
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
2538
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2280
2539
|
<preface>
|
2281
2540
|
<foreword>
|
2282
2541
|
<recommendation id='_' obligation='shall,could' keep-with-next='true' keep-lines-together='true'>
|
@@ -2440,10 +2699,13 @@ end
|
|
2440
2699
|
</preface></itu-standard>
|
2441
2700
|
INPUT
|
2442
2701
|
<?xml version='1.0'?>
|
2443
|
-
<itu-standard xmlns='http://riboseinc.com/isoxml'>
|
2702
|
+
<itu-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2444
2703
|
<bibdata>
|
2445
2704
|
<language>en</language>
|
2446
2705
|
</bibdata>
|
2706
|
+
<local_bibdata>
|
2707
|
+
<language>en</language>
|
2708
|
+
</local_bibdata>
|
2447
2709
|
<preface>
|
2448
2710
|
<foreword>
|
2449
2711
|
<figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
|
@@ -2472,6 +2734,9 @@ end
|
|
2472
2734
|
<bibdata>
|
2473
2735
|
<language>en</language>
|
2474
2736
|
</bibdata>
|
2737
|
+
<local_bibdata>
|
2738
|
+
<language>en</language>
|
2739
|
+
</local_bibdata>
|
2475
2740
|
<preface>
|
2476
2741
|
<foreword>
|
2477
2742
|
<figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
|
@@ -2514,6 +2779,9 @@ OUTPUT
|
|
2514
2779
|
<bibdata>
|
2515
2780
|
<language>en</language>
|
2516
2781
|
</bibdata>
|
2782
|
+
<local_bibdata>
|
2783
|
+
<language>en</language>
|
2784
|
+
</local_bibdata>
|
2517
2785
|
<preface>
|
2518
2786
|
<foreword>
|
2519
2787
|
<figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
|