isodoc 0.5.5 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +46 -0
- data/LICENSE +25 -0
- data/README.adoc +1 -1
- data/Rakefile +6 -0
- data/isodoc.gemspec +1 -0
- data/lib/isodoc.rb +4 -95
- data/lib/isodoc/cleanup.rb +14 -10
- data/lib/isodoc/{notes.rb → comments.rb} +0 -73
- data/lib/isodoc/convert.rb +97 -0
- data/lib/isodoc/footnotes.rb +74 -0
- data/lib/isodoc/html.rb +41 -4
- data/lib/isodoc/i18n-en.yaml +1 -0
- data/lib/isodoc/i18n-fr.yaml +1 -0
- data/lib/isodoc/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/i18n.rb +1 -0
- data/lib/isodoc/inline.rb +4 -12
- data/lib/isodoc/iso2wordhtml.rb +26 -13
- data/lib/isodoc/metadata.rb +23 -10
- data/lib/isodoc/references.rb +20 -22
- data/lib/isodoc/section.rb +4 -3
- data/lib/isodoc/table.rb +0 -2
- data/lib/isodoc/terms.rb +2 -13
- data/lib/isodoc/utils.rb +24 -3
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/wordconvert/comments.rb +155 -0
- data/lib/isodoc/wordconvert/convert.rb +31 -0
- data/lib/isodoc/wordconvert/footnotes.rb +80 -0
- data/lib/isodoc/wordconvert/wordconvertmodule.rb +212 -0
- data/lib/isodoc/xref_gen.rb +50 -79
- data/lib/isodoc/xref_sect_gen.rb +82 -0
- data/spec/assets/header.html +7 -0
- data/spec/assets/html.css +2 -0
- data/spec/assets/htmlcover.html +4 -0
- data/spec/assets/htmlintro.html +5 -0
- data/spec/assets/i18n.yaml +2 -0
- data/spec/assets/iso.xml +8 -0
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/std.css +2 -0
- data/spec/assets/word.css +2 -0
- data/spec/assets/wordcover.html +3 -0
- data/spec/assets/wordintro.html +4 -0
- data/spec/isodoc/blocks_spec.rb +130 -47
- data/spec/isodoc/cleanup_spec.rb +693 -0
- data/spec/isodoc/footnotes_spec.rb +282 -0
- data/spec/isodoc/i18n_spec.rb +662 -0
- data/spec/isodoc/inline_spec.rb +344 -0
- data/spec/isodoc/lists_spec.rb +81 -18
- data/spec/isodoc/metadata_spec.rb +141 -0
- data/spec/isodoc/postproc_spec.rb +444 -0
- data/spec/isodoc/ref_spec.rb +158 -0
- data/spec/isodoc/section_spec.rb +275 -112
- data/spec/isodoc/table_spec.rb +146 -8
- data/spec/isodoc/terms_spec.rb +118 -0
- data/spec/isodoc/xref_spec.rb +490 -114
- metadata +46 -4
- data/lib/isodoc/postprocessing.rb +0 -176
data/lib/isodoc/xref_gen.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "roman-numerals"
|
2
|
+
|
1
3
|
module IsoDoc
|
2
4
|
class Convert
|
3
5
|
@anchors = {}
|
@@ -6,39 +8,6 @@ module IsoDoc
|
|
6
8
|
@anchors
|
7
9
|
end
|
8
10
|
|
9
|
-
def back_anchor_names(docxml)
|
10
|
-
docxml.xpath(ns("//annex")).each_with_index do |c, i|
|
11
|
-
annex_names(c, (65 + i).chr.to_s)
|
12
|
-
end
|
13
|
-
docxml.xpath(ns("//bibitem")).each do |ref|
|
14
|
-
reference_names(ref)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def initial_anchor_names(d)
|
19
|
-
introduction_names(d.at(ns("//introduction")))
|
20
|
-
section_names(d.at(ns("//clause[title = 'Scope']")), "1", 1)
|
21
|
-
section_names(d.at(ns(
|
22
|
-
"//references[title = 'Normative References']")), "2", 1)
|
23
|
-
section_names(d.at(ns("//sections/terms")), "3", 1)
|
24
|
-
middle_section_asset_names(d)
|
25
|
-
end
|
26
|
-
|
27
|
-
def middle_section_asset_names(d)
|
28
|
-
middle_sections = "//clause[title = 'Scope'] | "\
|
29
|
-
"//foreword | //introduction | "\
|
30
|
-
"//references[title = 'Normative References'] | //sections/terms | "\
|
31
|
-
"//sections/symbols-abbrevs | //clause[parent::sections]"
|
32
|
-
sequential_asset_names(d.xpath(ns(middle_sections)))
|
33
|
-
end
|
34
|
-
|
35
|
-
def clause_names(docxml, sect_num)
|
36
|
-
q = "//clause[parent::sections][not(xmlns:title = 'Scope')]"
|
37
|
-
docxml.xpath(ns(q)).each_with_index do |c, i|
|
38
|
-
section_names(c, (i + sect_num).to_s, 1)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
11
|
def termnote_label(n)
|
43
12
|
@termnote_lbl.gsub(/%/, n.to_s)
|
44
13
|
end
|
@@ -54,6 +23,17 @@ module IsoDoc
|
|
54
23
|
end
|
55
24
|
end
|
56
25
|
|
26
|
+
def termexample_anchor_names(docxml)
|
27
|
+
docxml.xpath(ns("//term[termexample]")).each do |t|
|
28
|
+
t.xpath(ns("./termexample")).each_with_index do |n, i|
|
29
|
+
@anchors[n["id"]] =
|
30
|
+
{ label: (i + 1).to_s,
|
31
|
+
xref: l10n("#{@anchors[t['id']][:xref]}, "\
|
32
|
+
"#{@note_xref_lbl} #{i + 1}") }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
57
37
|
SECTIONS_XPATH =
|
58
38
|
"//foreword | //introduction | //sections/terms | //annex | "\
|
59
39
|
"//sections/clause | //references[not(ancestor::references)]".freeze
|
@@ -90,6 +70,41 @@ module IsoDoc
|
|
90
70
|
end
|
91
71
|
end
|
92
72
|
|
73
|
+
def list_anchor_names(sections)
|
74
|
+
sections.each do |s|
|
75
|
+
notes = s.xpath(ns(".//ol")) - s.xpath(ns(".//subsection//ol")) -
|
76
|
+
s.xpath(ns(".//ol//ol"))
|
77
|
+
notes.each_with_index do |n, i|
|
78
|
+
idx = notes.size == 1 ? "" : " #{i + 1}"
|
79
|
+
@anchors[n["id"]] = anchor_struct(idx, s, @list_lbl)
|
80
|
+
list_item_anchor_names(n, @anchors[n["id"]], 1, "", notes.size != 1)
|
81
|
+
end
|
82
|
+
list_anchor_names(s.xpath(ns("./subsection")))
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def listlabel(depth, i)
|
87
|
+
return i.to_s if [2, 7].include? depth
|
88
|
+
return (96 + i).chr.to_s if [1, 6].include? depth
|
89
|
+
return (64 + i).chr.to_s if [4, 9].include? depth
|
90
|
+
return RomanNumerals.to_roman(i).downcase if [3, 8].include? depth
|
91
|
+
return RomanNumerals.to_roman(i).upcase if [5, 10].include? depth
|
92
|
+
return i.to_s
|
93
|
+
end
|
94
|
+
|
95
|
+
def list_item_anchor_names(list, list_anchor, depth, prev_label, refer_list)
|
96
|
+
list.xpath(ns("./li")).each_with_index do |li, i|
|
97
|
+
label = listlabel(depth, i + 1)
|
98
|
+
label = "#{prev_label}.#{label}" unless prev_label.empty?
|
99
|
+
label = "#{list_anchor[:xref]} #{label}" if refer_list
|
100
|
+
li["id"] && @anchors[li["id"]] = { xref: "#{label})",
|
101
|
+
container: list_anchor[:container] }
|
102
|
+
li.xpath(ns("./ol")).each do |ol|
|
103
|
+
list_item_anchor_names(ol, list_anchor, depth + 1, label, false)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
93
108
|
def middle_anchor_names(docxml)
|
94
109
|
symbols_abbrevs = docxml.at(ns("//sections/symbols-abbrevs"))
|
95
110
|
sect_num = 4
|
@@ -99,6 +114,7 @@ module IsoDoc
|
|
99
114
|
end
|
100
115
|
clause_names(docxml, sect_num)
|
101
116
|
termnote_anchor_names(docxml)
|
117
|
+
termexample_anchor_names(docxml)
|
102
118
|
end
|
103
119
|
|
104
120
|
# extract names for all anchors, xref and label
|
@@ -111,6 +127,7 @@ module IsoDoc
|
|
111
127
|
"//figure")))
|
112
128
|
note_anchor_names(docxml.xpath(ns(SECTIONS_XPATH)))
|
113
129
|
example_anchor_names(docxml.xpath(ns(SECTIONS_XPATH)))
|
130
|
+
list_anchor_names(docxml.xpath(ns(SECTIONS_XPATH)))
|
114
131
|
end
|
115
132
|
|
116
133
|
def sequential_figure_names(clause)
|
@@ -167,51 +184,5 @@ module IsoDoc
|
|
167
184
|
@anchors[t["id"]] = anchor_struct("#{num}.#{i + 1}", t, @formula_lbl)
|
168
185
|
end
|
169
186
|
end
|
170
|
-
|
171
|
-
def introduction_names(clause)
|
172
|
-
return if clause.nil?
|
173
|
-
clause.xpath(ns("./subsection")).each_with_index do |c, i|
|
174
|
-
section_names1(c, "0.#{i + 1}", 2)
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
def section_names(clause, num, lvl)
|
179
|
-
return if clause.nil?
|
180
|
-
@anchors[clause["id"]] =
|
181
|
-
{ label: num, xref: l10n("#{@clause_lbl} #{num}"), level: lvl }
|
182
|
-
clause.xpath(ns("./subsection | ./term | ./terms | ./symbols-abbrevs")).
|
183
|
-
each_with_index do |c, i|
|
184
|
-
section_names1(c, "#{num}.#{i + 1}", lvl + 1)
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
def section_names1(clause, num, level)
|
189
|
-
@anchors[clause["id"]] =
|
190
|
-
{ label: num, level: level, xref: num }
|
191
|
-
# subclauses are not prefixed with "Clause"
|
192
|
-
clause.xpath(ns("./subsection | ./terms | ./term | ./symbols-abbrevs")).
|
193
|
-
each_with_index do |c, i|
|
194
|
-
section_names1(c, "#{num}.#{i + 1}", level + 1)
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
|
-
def annex_names(clause, num)
|
199
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
200
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
201
|
-
label = l10n("<b>#{@annex_lbl} #{num}</b><br/>#{obl}")
|
202
|
-
@anchors[clause["id"]] =
|
203
|
-
{ label: label, xref: "#{@annex_lbl} #{num}", level: 1 }
|
204
|
-
clause.xpath(ns("./subsection")).each_with_index do |c, i|
|
205
|
-
annex_names1(c, "#{num}.#{i + 1}", 2)
|
206
|
-
end
|
207
|
-
hierarchical_asset_names(clause, num)
|
208
|
-
end
|
209
|
-
|
210
|
-
def annex_names1(clause, num, level)
|
211
|
-
@anchors[clause["id"]] = { label: num, xref: num, level: level }
|
212
|
-
clause.xpath(ns(".//subsection")).each_with_index do |c, i|
|
213
|
-
annex_names1(c, "#{num}.#{i + 1}", level + 1)
|
214
|
-
end
|
215
|
-
end
|
216
187
|
end
|
217
188
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
class Convert
|
3
|
+
def back_anchor_names(docxml)
|
4
|
+
docxml.xpath(ns("//annex")).each_with_index do |c, i|
|
5
|
+
annex_names(c, (65 + i).chr.to_s)
|
6
|
+
end
|
7
|
+
docxml.xpath(ns("//bibitem")).each do |ref|
|
8
|
+
reference_names(ref)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def initial_anchor_names(d)
|
13
|
+
introduction_names(d.at(ns("//introduction")))
|
14
|
+
section_names(d.at(ns("//clause[title = 'Scope']")), "1", 1)
|
15
|
+
section_names(d.at(ns(
|
16
|
+
"//references[title = 'Normative References']")), "2", 1)
|
17
|
+
section_names(d.at(ns("//sections/terms")), "3", 1)
|
18
|
+
middle_section_asset_names(d)
|
19
|
+
end
|
20
|
+
|
21
|
+
def middle_section_asset_names(d)
|
22
|
+
middle_sections = "//clause[title = 'Scope'] | "\
|
23
|
+
"//foreword | //introduction | "\
|
24
|
+
"//references[title = 'Normative References'] | //sections/terms | "\
|
25
|
+
"//sections/symbols-abbrevs | //clause[parent::sections]"
|
26
|
+
sequential_asset_names(d.xpath(ns(middle_sections)))
|
27
|
+
end
|
28
|
+
|
29
|
+
def clause_names(docxml, sect_num)
|
30
|
+
q = "//clause[parent::sections][not(xmlns:title = 'Scope')]"
|
31
|
+
docxml.xpath(ns(q)).each_with_index do |c, i|
|
32
|
+
section_names(c, (i + sect_num).to_s, 1)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def introduction_names(clause)
|
37
|
+
return if clause.nil?
|
38
|
+
clause.xpath(ns("./subsection")).each_with_index do |c, i|
|
39
|
+
section_names1(c, "0.#{i + 1}", 2)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def section_names(clause, num, lvl)
|
44
|
+
return if clause.nil?
|
45
|
+
@anchors[clause["id"]] =
|
46
|
+
{ label: num, xref: l10n("#{@clause_lbl} #{num}"), level: lvl }
|
47
|
+
clause.xpath(ns("./subsection | ./term | ./terms | ./symbols-abbrevs")).
|
48
|
+
each_with_index do |c, i|
|
49
|
+
section_names1(c, "#{num}.#{i + 1}", lvl + 1)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def section_names1(clause, num, level)
|
54
|
+
@anchors[clause["id"]] =
|
55
|
+
{ label: num, level: level, xref: num }
|
56
|
+
# subclauses are not prefixed with "Clause"
|
57
|
+
clause.xpath(ns("./subsection | ./terms | ./term | ./symbols-abbrevs")).
|
58
|
+
each_with_index do |c, i|
|
59
|
+
section_names1(c, "#{num}.#{i + 1}", level + 1)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def annex_names(clause, num)
|
64
|
+
obl = l10n("(#{@inform_annex_lbl})")
|
65
|
+
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
66
|
+
label = l10n("<b>#{@annex_lbl} #{num}</b><br/>#{obl}")
|
67
|
+
@anchors[clause["id"]] =
|
68
|
+
{ label: label, xref: "#{@annex_lbl} #{num}", level: 1 }
|
69
|
+
clause.xpath(ns("./subsection")).each_with_index do |c, i|
|
70
|
+
annex_names1(c, "#{num}.#{i + 1}", 2)
|
71
|
+
end
|
72
|
+
hierarchical_asset_names(clause, num)
|
73
|
+
end
|
74
|
+
|
75
|
+
def annex_names1(clause, num, level)
|
76
|
+
@anchors[clause["id"]] = { label: num, xref: num, level: level }
|
77
|
+
clause.xpath(ns(".//subsection")).each_with_index do |c, i|
|
78
|
+
annex_names1(c, "#{num}.#{i + 1}", level + 1)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/spec/assets/iso.xml
ADDED
Binary file
|
data/spec/assets/std.css
ADDED
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -18,18 +18,18 @@ RSpec.describe IsoDoc do
|
|
18
18
|
<div class="WordSection1">
|
19
19
|
<p> </p>
|
20
20
|
</div>
|
21
|
-
<br
|
21
|
+
<br/>
|
22
22
|
<div class="WordSection2">
|
23
|
-
<br
|
23
|
+
<br/>
|
24
24
|
<div>
|
25
25
|
<h1 class="ForewordTitle">Foreword</h1>
|
26
26
|
<div id="" class="Note">
|
27
|
-
<p class="Note">NOTE
|
27
|
+
<p class="Note">NOTE  These results are based on a study carried out on three different types of kernel.</p>
|
28
28
|
</div>
|
29
29
|
</div>
|
30
30
|
<p> </p>
|
31
31
|
</div>
|
32
|
-
<br
|
32
|
+
<br/>
|
33
33
|
<div class="WordSection3">
|
34
34
|
<p class="zzSTDTitle1"/>
|
35
35
|
</div>
|
@@ -45,6 +45,44 @@ RSpec.describe IsoDoc do
|
|
45
45
|
<foreword>
|
46
46
|
<note id="note1">
|
47
47
|
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
48
|
+
</note>
|
49
|
+
</foreword>
|
50
|
+
</iso-standard>
|
51
|
+
INPUT
|
52
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
53
|
+
<head>
|
54
|
+
<title>test</title>
|
55
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
56
|
+
<div class="WordSection1">
|
57
|
+
<p> </p>
|
58
|
+
</div>
|
59
|
+
<br/>
|
60
|
+
<div class="WordSection2">
|
61
|
+
<br/>
|
62
|
+
<div>
|
63
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
64
|
+
<div id="note1" class="Note">
|
65
|
+
<p class="Note">NOTE  These results are based on a study carried out on three different types of kernel.</p>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
<p> </p>
|
69
|
+
</div>
|
70
|
+
<br/>
|
71
|
+
<div class="WordSection3">
|
72
|
+
<p class="zzSTDTitle1"/>
|
73
|
+
</div>
|
74
|
+
</body>
|
75
|
+
</head>
|
76
|
+
</html>
|
77
|
+
OUTPUT
|
78
|
+
end
|
79
|
+
|
80
|
+
it "processes sequences of notes" do
|
81
|
+
expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
|
82
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
83
|
+
<foreword>
|
84
|
+
<note id="note1">
|
85
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
48
86
|
</note>
|
49
87
|
<note id="note2">
|
50
88
|
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
|
@@ -59,21 +97,21 @@ INPUT
|
|
59
97
|
<div class="WordSection1">
|
60
98
|
<p> </p>
|
61
99
|
</div>
|
62
|
-
<br
|
100
|
+
<br/>
|
63
101
|
<div class="WordSection2">
|
64
|
-
<br
|
102
|
+
<br/>
|
65
103
|
<div>
|
66
104
|
<h1 class="ForewordTitle">Foreword</h1>
|
67
105
|
<div id="note1" class="Note">
|
68
|
-
<p class="Note">NOTE 1
|
106
|
+
<p class="Note">NOTE 1  These results are based on a study carried out on three different types of kernel.</p>
|
69
107
|
</div>
|
70
108
|
<div id="note2" class="Note">
|
71
|
-
<p class="Note">NOTE 2
|
109
|
+
<p class="Note">NOTE 2  These results are based on a study carried out on three different types of kernel.</p>
|
72
110
|
</div>
|
73
111
|
</div>
|
74
112
|
<p> </p>
|
75
113
|
</div>
|
76
|
-
<br
|
114
|
+
<br/>
|
77
115
|
<div class="WordSection3">
|
78
116
|
<p class="zzSTDTitle1"/>
|
79
117
|
</div>
|
@@ -101,19 +139,19 @@ INPUT
|
|
101
139
|
<div class="WordSection1">
|
102
140
|
<p> </p>
|
103
141
|
</div>
|
104
|
-
<br
|
142
|
+
<br/>
|
105
143
|
<div class="WordSection2">
|
106
|
-
<br
|
144
|
+
<br/>
|
107
145
|
<div>
|
108
146
|
<h1 class="ForewordTitle">Foreword</h1>
|
109
147
|
<div id="" class="Note">
|
110
|
-
<p class="Note">NOTE
|
148
|
+
<p class="Note">NOTE  These results are based on a study carried out on three different types of kernel.</p>
|
111
149
|
<p class="Note" id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
|
112
150
|
</div>
|
113
151
|
</div>
|
114
152
|
<p> </p>
|
115
153
|
</div>
|
116
|
-
<br
|
154
|
+
<br/>
|
117
155
|
<div class="WordSection3">
|
118
156
|
<p class="zzSTDTitle1"/>
|
119
157
|
</div>
|
@@ -145,12 +183,12 @@ INPUT
|
|
145
183
|
<div class="WordSection1">
|
146
184
|
<p> </p>
|
147
185
|
</div>
|
148
|
-
<br
|
186
|
+
<br/>
|
149
187
|
<div class="WordSection2">
|
150
|
-
<br
|
188
|
+
<br/>
|
151
189
|
<div>
|
152
190
|
<h1 class="ForewordTitle">Foreword</h1>
|
153
|
-
<div id="" class="Note"><p class="Note">NOTE
|
191
|
+
<div id="" class="Note"><p class="Note">NOTE  </p>
|
154
192
|
<dl><dt><p class="Note">A</p></dt><dd><p class="Note">B</p></dd></dl>
|
155
193
|
<ul>
|
156
194
|
<li>C</li></ul>
|
@@ -158,7 +196,7 @@ INPUT
|
|
158
196
|
</div>
|
159
197
|
<p> </p>
|
160
198
|
</div>
|
161
|
-
<br
|
199
|
+
<br/>
|
162
200
|
<div class="WordSection3">
|
163
201
|
<p class="zzSTDTitle1"/>
|
164
202
|
</div>
|
@@ -191,9 +229,9 @@ INPUT
|
|
191
229
|
<div class="WordSection1">
|
192
230
|
<p> </p>
|
193
231
|
</div>
|
194
|
-
<br
|
232
|
+
<br/>
|
195
233
|
<div class="WordSection2">
|
196
|
-
<br
|
234
|
+
<br/>
|
197
235
|
<div>
|
198
236
|
<h1 class="ForewordTitle">Foreword</h1>
|
199
237
|
<div id="figureA-1" class="figure">
|
@@ -204,7 +242,7 @@ INPUT
|
|
204
242
|
</div>
|
205
243
|
<p> </p>
|
206
244
|
</div>
|
207
|
-
<br
|
245
|
+
<br/>
|
208
246
|
<div class="WordSection3">
|
209
247
|
<p class="zzSTDTitle1"/>
|
210
248
|
</div>
|
@@ -231,9 +269,9 @@ INPUT
|
|
231
269
|
<div class="WordSection1">
|
232
270
|
<p> </p>
|
233
271
|
</div>
|
234
|
-
<br
|
272
|
+
<br/>
|
235
273
|
<div class="WordSection2">
|
236
|
-
<br
|
274
|
+
<br/>
|
237
275
|
<div>
|
238
276
|
<h1 class="ForewordTitle">Foreword</h1>
|
239
277
|
<table id="samplecode" class="example">
|
@@ -247,7 +285,7 @@ INPUT
|
|
247
285
|
</div>
|
248
286
|
<p> </p>
|
249
287
|
</div>
|
250
|
-
<br
|
288
|
+
<br/>
|
251
289
|
<div class="WordSection3">
|
252
290
|
<p class="zzSTDTitle1"/>
|
253
291
|
</div>
|
@@ -278,9 +316,9 @@ INPUT
|
|
278
316
|
<div class="WordSection1">
|
279
317
|
<p> </p>
|
280
318
|
</div>
|
281
|
-
<br
|
319
|
+
<br/>
|
282
320
|
<div class="WordSection2">
|
283
|
-
<br
|
321
|
+
<br/>
|
284
322
|
<div>
|
285
323
|
<h1 class="ForewordTitle">Foreword</h1>
|
286
324
|
<table id="samplecode" class="example">
|
@@ -301,7 +339,7 @@ INPUT
|
|
301
339
|
</div>
|
302
340
|
<p> </p>
|
303
341
|
</div>
|
304
|
-
<br
|
342
|
+
<br/>
|
305
343
|
<div class="WordSection3">
|
306
344
|
<p class="zzSTDTitle1"/>
|
307
345
|
</div>
|
@@ -329,16 +367,16 @@ INPUT
|
|
329
367
|
<div class="WordSection1">
|
330
368
|
<p> </p>
|
331
369
|
</div>
|
332
|
-
<br
|
370
|
+
<br/>
|
333
371
|
<div class="WordSection2">
|
334
|
-
<br
|
372
|
+
<br/>
|
335
373
|
<div>
|
336
374
|
<h1 class="ForewordTitle">Foreword</h1>
|
337
375
|
<p id="samplecode" class="Sourcecode"><br/>    <br/>  puts x<br/><p class="FigureTitle" align="center"><b>Ruby code</b></p></p>
|
338
376
|
</div>
|
339
377
|
<p> </p>
|
340
378
|
</div>
|
341
|
-
<br
|
379
|
+
<br/>
|
342
380
|
<div class="WordSection3">
|
343
381
|
<p class="zzSTDTitle1"/>
|
344
382
|
</div>
|
@@ -370,9 +408,9 @@ INPUT
|
|
370
408
|
<div class="WordSection1">
|
371
409
|
<p> </p>
|
372
410
|
</div>
|
373
|
-
<br
|
411
|
+
<br/>
|
374
412
|
<div class="WordSection2">
|
375
|
-
<br
|
413
|
+
<br/>
|
376
414
|
<div>
|
377
415
|
<h1 class="ForewordTitle">Foreword</h1>
|
378
416
|
<p id="_" class="Sourcecode">puts "Hello, world."  <1><br/>   %w{a b c}.each do |x|<br/>     puts x  <2><br/>   end<span class="zzMoveToFollowing"><1> </span>
|
@@ -383,7 +421,7 @@ INPUT
|
|
383
421
|
</div>
|
384
422
|
<p> </p>
|
385
423
|
</div>
|
386
|
-
<br
|
424
|
+
<br/>
|
387
425
|
<div class="WordSection3">
|
388
426
|
<p class="zzSTDTitle1"/>
|
389
427
|
</div>
|
@@ -410,9 +448,9 @@ INPUT
|
|
410
448
|
<div class="WordSection1">
|
411
449
|
<p> </p>
|
412
450
|
</div>
|
413
|
-
<br
|
451
|
+
<br/>
|
414
452
|
<div class="WordSection2">
|
415
|
-
<br
|
453
|
+
<br/>
|
416
454
|
<div>
|
417
455
|
<h1 class="ForewordTitle">Foreword</h1>
|
418
456
|
<div class="Admonition"><title>CAUTION</title>
|
@@ -421,7 +459,7 @@ INPUT
|
|
421
459
|
</div>
|
422
460
|
<p> </p>
|
423
461
|
</div>
|
424
|
-
<br
|
462
|
+
<br/>
|
425
463
|
<div class="WordSection3">
|
426
464
|
<p class="zzSTDTitle1"/>
|
427
465
|
</div>
|
@@ -455,12 +493,12 @@ INPUT
|
|
455
493
|
<div class="WordSection1">
|
456
494
|
<p> </p>
|
457
495
|
</div>
|
458
|
-
<br
|
496
|
+
<br/>
|
459
497
|
<div class="WordSection2">
|
460
|
-
<br
|
498
|
+
<br/>
|
461
499
|
<div>
|
462
500
|
<h1 class="ForewordTitle">Foreword</h1>
|
463
|
-
<div id="_be9158af-7e93-4ee2-90c5-26d31c181934" class="formula"><span class="stem">(#(r = 1 %)#)</span
|
501
|
+
<div id="_be9158af-7e93-4ee2-90c5-26d31c181934" class="formula"><span class="stem">(#(r = 1 %)#)</span>  (1)</div>
|
464
502
|
<p>where</p>
|
465
503
|
<dl>
|
466
504
|
<dt>
|
@@ -473,7 +511,7 @@ INPUT
|
|
473
511
|
</div>
|
474
512
|
<p> </p>
|
475
513
|
</div>
|
476
|
-
<br
|
514
|
+
<br/>
|
477
515
|
<div class="WordSection3">
|
478
516
|
<p class="zzSTDTitle1"/>
|
479
517
|
</div>
|
@@ -489,7 +527,49 @@ INPUT
|
|
489
527
|
<foreword>
|
490
528
|
<p align="left" id="_08bfe952-d57f-4150-9c95-5d52098cc2a8">Vache Equipment<br/>
|
491
529
|
Fictitious<br/>
|
492
|
-
World
|
530
|
+
World</p>
|
531
|
+
<p align="justify">Justify</p>
|
532
|
+
</foreword>
|
533
|
+
</iso-standard>
|
534
|
+
INPUT
|
535
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
536
|
+
<head>
|
537
|
+
<title>test</title>
|
538
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
539
|
+
<div class="WordSection1">
|
540
|
+
<p> </p>
|
541
|
+
</div>
|
542
|
+
<br/>
|
543
|
+
<div class="WordSection2">
|
544
|
+
<br/>
|
545
|
+
<div>
|
546
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
547
|
+
<p id="_08bfe952-d57f-4150-9c95-5d52098cc2a8" align="left" style="text-align:left">Vache Equipment<br/>
|
548
|
+
Fictitious<br/>
|
549
|
+
World
|
550
|
+
</p>
|
551
|
+
<p style="text-align:justify">Justify</p>
|
552
|
+
</div>
|
553
|
+
<p> </p>
|
554
|
+
</div>
|
555
|
+
<br/>
|
556
|
+
<div class="WordSection3">
|
557
|
+
<p class="zzSTDTitle1"/>
|
558
|
+
</div>
|
559
|
+
</body>
|
560
|
+
</head>
|
561
|
+
</html>
|
562
|
+
OUTPUT
|
563
|
+
end
|
564
|
+
|
565
|
+
it "processes paragraph alignments (Word)" do
|
566
|
+
expect(IsoDoc::WordConvert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
|
567
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
568
|
+
<foreword>
|
569
|
+
<p align="left" id="_08bfe952-d57f-4150-9c95-5d52098cc2a8">Vache Equipment<br/>
|
570
|
+
Fictitious<br/>
|
571
|
+
World</p>
|
572
|
+
<p align="justify">Justify</p>
|
493
573
|
</foreword>
|
494
574
|
</iso-standard>
|
495
575
|
INPUT
|
@@ -502,13 +582,14 @@ World
|
|
502
582
|
</div>
|
503
583
|
<br clear="all" class="section"/>
|
504
584
|
<div class="WordSection2">
|
505
|
-
<br
|
585
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
506
586
|
<div>
|
507
587
|
<h1 class="ForewordTitle">Foreword</h1>
|
508
588
|
<p id="_08bfe952-d57f-4150-9c95-5d52098cc2a8" align="left" style="text-align:left">Vache Equipment<br/>
|
509
589
|
Fictitious<br/>
|
510
590
|
World
|
511
591
|
</p>
|
592
|
+
<p style="text-align:justify">Justify</p>
|
512
593
|
</div>
|
513
594
|
<p> </p>
|
514
595
|
</div>
|
@@ -522,6 +603,8 @@ World
|
|
522
603
|
OUTPUT
|
523
604
|
end
|
524
605
|
|
606
|
+
|
607
|
+
|
525
608
|
it "processes blockquotes" do
|
526
609
|
expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"
|
527
610
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -542,9 +625,9 @@ World
|
|
542
625
|
<div class="WordSection1">
|
543
626
|
<p> </p>
|
544
627
|
</div>
|
545
|
-
<br
|
628
|
+
<br/>
|
546
629
|
<div class="WordSection2">
|
547
|
-
<br
|
630
|
+
<br/>
|
548
631
|
<div>
|
549
632
|
<h1 class="ForewordTitle">Foreword</h1>
|
550
633
|
<div class="Quote" id="_044bd364-c832-4b78-8fea-92242402a1d1">
|
@@ -555,7 +638,7 @@ World
|
|
555
638
|
</div>
|
556
639
|
<p> </p>
|
557
640
|
</div>
|
558
|
-
<br
|
641
|
+
<br/>
|
559
642
|
<div class="WordSection3">
|
560
643
|
<p class="zzSTDTitle1"/>
|
561
644
|
</div>
|
@@ -585,14 +668,14 @@ World
|
|
585
668
|
<div class="WordSection1">
|
586
669
|
<p> </p>
|
587
670
|
</div>
|
588
|
-
<br
|
671
|
+
<br/>
|
589
672
|
<div class="WordSection2">
|
590
673
|
<p> </p>
|
591
674
|
</div>
|
592
|
-
<br
|
675
|
+
<br/>
|
593
676
|
<div class="WordSection3">
|
594
677
|
<p class="zzSTDTitle1"/>
|
595
|
-
<div><h1>3
|
678
|
+
<div><h1>3.  Terms and Definitions</h1><p>For the purposes of this document,
|
596
679
|
the following terms and definitions apply.</p>
|
597
680
|
<p>ISO and IEC maintain terminological databases for use in
|
598
681
|
standardization at the following addresses:</p>
|