metanorma-iso 2.3.4 → 2.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html2doc/lists.rb +9 -7
- data/lib/isodoc/iso/base_convert.rb +42 -10
- data/lib/isodoc/iso/html/style-human.css +4 -0
- data/lib/isodoc/iso/html/style-human.scss +6 -0
- data/lib/isodoc/iso/html/style-iso.css +4 -0
- data/lib/isodoc/iso/html/style-iso.scss +7 -0
- data/lib/isodoc/iso/html/wordstyle-dis.css +16 -0
- data/lib/isodoc/iso/html/wordstyle-dis.scss +14 -0
- data/lib/isodoc/iso/html/wordstyle.css +16 -0
- data/lib/isodoc/iso/html/wordstyle.scss +14 -0
- data/lib/isodoc/iso/html_convert.rb +12 -0
- data/lib/isodoc/iso/iso.amendment.xsl +147 -52
- data/lib/isodoc/iso/iso.international-standard.xsl +147 -52
- data/lib/isodoc/iso/presentation_bibdata.rb +1 -1
- data/lib/isodoc/iso/presentation_xml_convert.rb +5 -0
- data/lib/isodoc/iso/word_cleanup.rb +12 -2
- data/lib/isodoc/iso/word_convert.rb +44 -9
- data/lib/isodoc/iso/xref.rb +22 -4
- data/lib/metanorma/iso/base.rb +5 -0
- data/lib/metanorma/iso/biblio.rng +11 -1
- data/lib/metanorma/iso/cleanup.rb +0 -10
- data/lib/metanorma/iso/front_id.rb +8 -4
- data/lib/metanorma/iso/isodoc.rng +10 -0
- data/lib/metanorma/iso/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0a1965b8adf5207ea4a7c1d65561a0c8762b2b9f939aefb88594bb5995441ad
|
4
|
+
data.tar.gz: 4388b4df33214b2fe2ec7823951a711dd13dfe4d6d426dfd4455c098f7996060
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ee61e3f2e61001ce759bbf13b274d63191595549e31189a8fcda25b8d6edad351df426aaa77b6187adb99ca742d39be6b8ad883a7336e3029ed80fedd25397b
|
7
|
+
data.tar.gz: 13b953974daeeaf1f88696a36f752218bdb9034a653d2f13404d9667ee1a91ef58f466ac58a84ffa9acb379f90231499249c9a178e05b4e1fff90eec1a21b953
|
data/lib/html2doc/lists.rb
CHANGED
@@ -35,7 +35,7 @@ class Html2Doc
|
|
35
35
|
!x.text.strip.empty?
|
36
36
|
end
|
37
37
|
|
38
|
-
prev = first_p.xpath("./preceding-sibling::* | "\
|
38
|
+
prev = first_p.xpath("./preceding-sibling::* | " \
|
39
39
|
"./preceding-sibling::text()[normalize-space()]")
|
40
40
|
# bullet, tab, paragraph: ignore bullet, tab
|
41
41
|
if prev.empty? then para.replace(para.children)
|
@@ -76,7 +76,7 @@ class Html2Doc
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def unnest_list_paras(docxml)
|
79
|
-
docxml.xpath("//p[@class = 'ListContinue1' or @class = 'ListNumber1']"\
|
79
|
+
docxml.xpath("//p[@class = 'ListContinue1' or @class = 'ListNumber1']" \
|
80
80
|
"[.//p]").each do |p|
|
81
81
|
p.at("./p") and
|
82
82
|
list2para_unnest_para(p, p.at("./p"),
|
@@ -89,7 +89,7 @@ class Html2Doc
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def indent_lists(docxml)
|
92
|
-
docxml.xpath("//div[@class = 'Note' or @class = 'Example' or "\
|
92
|
+
docxml.xpath("//div[@class = 'Note' or @class = 'Example' or " \
|
93
93
|
"@class = 'Quote']").each do |d|
|
94
94
|
d.xpath(".//p").each do |p|
|
95
95
|
indent_lists1(p)
|
@@ -124,7 +124,7 @@ class Html2Doc
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def list_add_tail(list, liststyles, listtype, level)
|
127
|
-
list.xpath(".//ul[not(ancestor::li/ancestor::*/@id = '#{list['id']}')] | "\
|
127
|
+
list.xpath(".//ul[not(ancestor::li/ancestor::*/@id = '#{list['id']}')] | " \
|
128
128
|
".//ol[not(ancestor::li/ancestor::*/@id = '#{list['id']}')]")
|
129
129
|
.each do |li|
|
130
130
|
list_add1(li.parent, liststyles, listtype, level - 1)
|
@@ -137,8 +137,10 @@ class Html2Doc
|
|
137
137
|
idx += 1
|
138
138
|
ol = elem.xpath("./ancestor::ol")&.last
|
139
139
|
label = listlabel(listtype, idx, ol ? ol["type"] : nil)
|
140
|
-
elem.
|
141
|
-
|
140
|
+
unless elem.at("./ancestor::div[@class = 'index']") # indexsect
|
141
|
+
elem.children.first.previous =
|
142
|
+
"#{label}<span style='mso-tab-count:1'> </span>"
|
143
|
+
end
|
142
144
|
elem["level"] = level
|
143
145
|
idx
|
144
146
|
end
|
@@ -162,7 +164,7 @@ class Html2Doc
|
|
162
164
|
|
163
165
|
def cleanup(docxml)
|
164
166
|
super
|
165
|
-
docxml.xpath("//div[@class = 'Quote' or @class = 'Example' or "\
|
167
|
+
docxml.xpath("//div[@class = 'Quote' or @class = 'Example' or " \
|
166
168
|
"@class = 'Note']").each do |d|
|
167
169
|
d.delete("class")
|
168
170
|
end
|
@@ -31,7 +31,7 @@ module IsoDoc
|
|
31
31
|
def example_span_label(_node, div, name)
|
32
32
|
return if name.nil?
|
33
33
|
|
34
|
-
div.span
|
34
|
+
div.span class: "example_label" do |p|
|
35
35
|
name.children.each { |n| parse(n, p) }
|
36
36
|
end
|
37
37
|
end
|
@@ -64,7 +64,7 @@ module IsoDoc
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def example_parse(node, out)
|
67
|
-
out.div
|
67
|
+
out.div id: node["id"], class: "example" do |div|
|
68
68
|
if node_begins_with_para(node)
|
69
69
|
example_p_parse(node, div)
|
70
70
|
else
|
@@ -92,7 +92,7 @@ module IsoDoc
|
|
92
92
|
dlist.at(ns("./dd"))&.elements&.size == 1 &&
|
93
93
|
dlist.at(ns("./dd/p"))
|
94
94
|
|
95
|
-
out.span
|
95
|
+
out.span class: "zzMoveToFollowing" do |s|
|
96
96
|
s << "#{@i18n.where} "
|
97
97
|
dlist.at(ns("./dt")).children.each { |n| parse(n, s) }
|
98
98
|
s << " "
|
@@ -103,7 +103,7 @@ module IsoDoc
|
|
103
103
|
def admonition_parse(node, out)
|
104
104
|
type = node["type"]
|
105
105
|
name = admonition_name(node, type)
|
106
|
-
out.div
|
106
|
+
out.div id: node["id"], class: admonition_class(node) do |div|
|
107
107
|
if node.first_element_child.name == "p"
|
108
108
|
admonition_p_parse(node, div, name)
|
109
109
|
else
|
@@ -139,7 +139,7 @@ module IsoDoc
|
|
139
139
|
end
|
140
140
|
|
141
141
|
def figure_name_parse(_node, div, name)
|
142
|
-
div.p
|
142
|
+
div.p class: "FigureTitle", style: "text-align:center;" do |p|
|
143
143
|
name&.children&.each { |n| parse(n, p) }
|
144
144
|
end
|
145
145
|
end
|
@@ -149,16 +149,13 @@ module IsoDoc
|
|
149
149
|
middle_admonitions(isoxml, out)
|
150
150
|
i = scope isoxml, out, 0
|
151
151
|
i = norm_ref isoxml, out, i
|
152
|
-
# i = terms_defs isoxml, out, i
|
153
|
-
# symbols_abbrevs isoxml, out, i
|
154
152
|
clause_etc isoxml, out, i
|
155
153
|
annex isoxml, out
|
156
154
|
bibliography isoxml, out
|
157
|
-
indexsect isoxml, out
|
158
155
|
end
|
159
156
|
|
160
157
|
def clause_etc(isoxml, out, num)
|
161
|
-
isoxml.xpath(ns("//sections/clause[not(@type = 'scope')] | "\
|
158
|
+
isoxml.xpath(ns("//sections/clause[not(@type = 'scope')] | " \
|
162
159
|
"//sections/terms | //sections/definitions"))
|
163
160
|
.each do |f|
|
164
161
|
clause_etc1(f, out, num)
|
@@ -180,7 +177,6 @@ module IsoDoc
|
|
180
177
|
|
181
178
|
def indexsect(isoxml, out)
|
182
179
|
isoxml.xpath(ns("//indexsect")).each do |i|
|
183
|
-
page_break(out)
|
184
180
|
clause_parse(i, out)
|
185
181
|
end
|
186
182
|
end
|
@@ -194,6 +190,42 @@ module IsoDoc
|
|
194
190
|
ret[:sdo] = std_docid_semantic(ret[:sdo])
|
195
191
|
ret
|
196
192
|
end
|
193
|
+
|
194
|
+
def table_parse(node, out)
|
195
|
+
@in_table = true
|
196
|
+
table_title_parse(node, out)
|
197
|
+
measurement_units(node, out)
|
198
|
+
out.table **table_attrs(node) do |t|
|
199
|
+
table_parse_core(node, t)
|
200
|
+
(dl = node.at(ns("./dl"))) && parse(dl, out)
|
201
|
+
node.xpath(ns("./note[not(@type = 'units')]"))
|
202
|
+
.each { |n| parse(n, out) }
|
203
|
+
end
|
204
|
+
@in_table = false
|
205
|
+
end
|
206
|
+
|
207
|
+
def figure_parse1(node, out)
|
208
|
+
measurement_units(node, out)
|
209
|
+
out.div **figure_attrs(node) do |div|
|
210
|
+
node.children.each do |n|
|
211
|
+
figure_key(out) if n.name == "dl"
|
212
|
+
next if n.name == "note" && n["type"] == "units"
|
213
|
+
|
214
|
+
parse(n, div) unless n.name == "name"
|
215
|
+
end
|
216
|
+
figure_name_parse(node, div, node.at(ns("./name")))
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
def measurement_units(node, out)
|
221
|
+
node.xpath(ns("./note[@type = 'units']")).each do |n|
|
222
|
+
out.div align: "right" do |p|
|
223
|
+
p.b do |b|
|
224
|
+
n.children.each { |e| parse(e, b) }
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
197
229
|
end
|
198
230
|
end
|
199
231
|
end
|
@@ -2015,6 +2015,22 @@ div.WordSection3 {
|
|
2015
2015
|
div.colophon {
|
2016
2016
|
page: WordSection4; }
|
2017
2017
|
|
2018
|
+
@page WordSection5 {
|
2019
|
+
size: 595.3pt 841.9pt;
|
2020
|
+
margin: 39.7pt 53.85pt 1.0cm 53.85pt;
|
2021
|
+
mso-header-margin: 35.45pt;
|
2022
|
+
mso-footer-margin: 14.2pt;
|
2023
|
+
mso-page-numbers: 1;
|
2024
|
+
mso-columns: 2 even 36.0pt;
|
2025
|
+
mso-even-header: url("file:///C:/Doc/FILENAME_files/header.html") eh2;
|
2026
|
+
mso-header: url("file:///C:/Doc/FILENAME_files/header.html") h2;
|
2027
|
+
mso-even-footer: url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
2028
|
+
mso-footer: url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
2029
|
+
mso-paper-source: 0; }
|
2030
|
+
|
2031
|
+
div.index {
|
2032
|
+
page: WordSection5; }
|
2033
|
+
|
2018
2034
|
/* List Definitions */
|
2019
2035
|
@list l11 {
|
2020
2036
|
mso-list-id: 145051656;
|
@@ -1902,6 +1902,20 @@ div.WordSection3
|
|
1902
1902
|
mso-paper-source:0;}
|
1903
1903
|
div.colophon
|
1904
1904
|
{page:WordSection4;}
|
1905
|
+
@page WordSection5
|
1906
|
+
{size:595.3pt 841.9pt;
|
1907
|
+
margin:39.7pt 53.85pt 1.0cm 53.85pt;
|
1908
|
+
mso-header-margin:35.45pt;
|
1909
|
+
mso-footer-margin:14.2pt;
|
1910
|
+
mso-page-numbers:1;
|
1911
|
+
mso-columns:2 even 36.0pt;
|
1912
|
+
mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
|
1913
|
+
mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
|
1914
|
+
mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
1915
|
+
mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
1916
|
+
mso-paper-source:0;}
|
1917
|
+
div.index
|
1918
|
+
{page:WordSection5;}
|
1905
1919
|
|
1906
1920
|
/* List Definitions */
|
1907
1921
|
@list l11
|
@@ -1457,6 +1457,22 @@ div.WordSection3 {
|
|
1457
1457
|
div.colophon {
|
1458
1458
|
page: WordSection4; }
|
1459
1459
|
|
1460
|
+
@page WordSection5 {
|
1461
|
+
size: 595.3pt 841.9pt;
|
1462
|
+
margin: 39.7pt 53.85pt 1.0cm 53.85pt;
|
1463
|
+
mso-header-margin: 35.45pt;
|
1464
|
+
mso-footer-margin: 14.2pt;
|
1465
|
+
mso-page-numbers: 1;
|
1466
|
+
mso-columns: 2 even 36.0pt;
|
1467
|
+
mso-even-header: url("file:///C:/Doc/FILENAME_files/header.html") eh2;
|
1468
|
+
mso-header: url("file:///C:/Doc/FILENAME_files/header.html") h2;
|
1469
|
+
mso-even-footer: url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
1470
|
+
mso-footer: url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
1471
|
+
mso-paper-source: 0; }
|
1472
|
+
|
1473
|
+
div.index {
|
1474
|
+
page: WordSection5; }
|
1475
|
+
|
1460
1476
|
/* List Definitions */
|
1461
1477
|
@list l0 {
|
1462
1478
|
mso-list-id: 145051656;
|
@@ -1372,6 +1372,20 @@ div.WordSection3
|
|
1372
1372
|
mso-paper-source:0;}
|
1373
1373
|
div.colophon
|
1374
1374
|
{page:WordSection4;}
|
1375
|
+
@page WordSection5
|
1376
|
+
{size:595.3pt 841.9pt;
|
1377
|
+
margin:39.7pt 53.85pt 1.0cm 53.85pt;
|
1378
|
+
mso-header-margin:35.45pt;
|
1379
|
+
mso-footer-margin:14.2pt;
|
1380
|
+
mso-page-numbers:1;
|
1381
|
+
mso-columns:2 even 36.0pt;
|
1382
|
+
mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
|
1383
|
+
mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
|
1384
|
+
mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
1385
|
+
mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f4;
|
1386
|
+
mso-paper-source:0;}
|
1387
|
+
div.index
|
1388
|
+
{page:WordSection5;}
|
1375
1389
|
|
1376
1390
|
/* List Definitions */
|
1377
1391
|
@list l0
|
@@ -80,6 +80,18 @@ module IsoDoc
|
|
80
80
|
docxml
|
81
81
|
end
|
82
82
|
|
83
|
+
def middle(isoxml, out)
|
84
|
+
middle_title(isoxml, out)
|
85
|
+
middle_admonitions(isoxml, out)
|
86
|
+
i = scope isoxml, out, 0
|
87
|
+
i = norm_ref isoxml, out, i
|
88
|
+
clause_etc isoxml, out, i
|
89
|
+
annex isoxml, out
|
90
|
+
bibliography isoxml, out
|
91
|
+
indexsect isoxml, out
|
92
|
+
end
|
93
|
+
|
94
|
+
|
83
95
|
def html_toc1(ulist)
|
84
96
|
u2 = nil
|
85
97
|
ulist.xpath("./li").each do |l|
|