isodoc 2.11.2 → 2.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/base_style/all.css +1 -1
- data/lib/isodoc/base_style/reset.css +1 -1
- data/lib/isodoc/base_style/reset.scss +1 -1
- data/lib/isodoc/presentation_function/bibdata.rb +4 -5
- data/lib/isodoc/presentation_function/block.rb +2 -1
- data/lib/isodoc/presentation_function/inline.rb +4 -1
- data/lib/isodoc/presentation_function/math.rb +2 -0
- data/lib/isodoc/presentation_function/metadata.rb +12 -4
- data/lib/isodoc/presentation_function/section.rb +4 -10
- data/lib/isodoc/presentation_function/terms.rb +0 -1
- data/lib/isodoc/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: 4228f130d19273b278dcf701d27c405d37a7843b053eed057b424af2d7399b09
|
4
|
+
data.tar.gz: 003b627868c9e53ae1eb6baf7f9cb71a06a3e3e0c09b6102cd5e1dc7c45faee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e865cfbe5a51e7a78a1562b7d88b7930a0eacf8db22e94c0e4ed0dc12f7c76b75975c98296a0f1624c82d729fdc03a5715f01237a14b68fa8b612a17f297a49
|
7
|
+
data.tar.gz: 533d41c63cf5955bc60f7223716cfea1151d959d0cdec32577154159c88abe4d9c0d81b2c8256fccc3e1b02d2e59dd8dcff613dee425f64ce417e390b77e3fe2
|
@@ -29,11 +29,10 @@ module IsoDoc
|
|
29
29
|
|
30
30
|
def bibdata_current(docxml)
|
31
31
|
a = docxml.at(ns("//bibdata")) or return
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
l.text == @script and l["current"] = "true"
|
32
|
+
{ language: @lang, script: @script, locale: @locale }.each do |k, v|
|
33
|
+
a.xpath(ns("./#{k}")).each do |l|
|
34
|
+
l.text == v and l["current"] = "true"
|
35
|
+
end
|
37
36
|
end
|
38
37
|
a
|
39
38
|
end
|
@@ -119,7 +119,8 @@ module IsoDoc
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def amend1(elem)
|
122
|
-
elem.xpath(ns("./autonumber"
|
122
|
+
elem.xpath(ns("./locality | ./localityStack | ./autonumber | " \
|
123
|
+
"./classification | ./contributor")).each(&:remove)
|
123
124
|
elem.xpath(ns("./newcontent")).each { |a| a.name = "quote" }
|
124
125
|
elem.xpath(ns("./description")).each { |a| a.replace(a.children) }
|
125
126
|
elem.replace(elem.children)
|
@@ -85,7 +85,10 @@ module IsoDoc
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def identifier(docxml)
|
88
|
-
docxml.xpath(ns("//identifier"))
|
88
|
+
(docxml.xpath(ns("//identifier")) -
|
89
|
+
docxml.xpath(ns("//bibdata/identifier")) -
|
90
|
+
docxml.xpath(ns("//bibitema/identifier")))
|
91
|
+
.each do |n|
|
89
92
|
n.name = "tt"
|
90
93
|
end
|
91
94
|
end
|
@@ -40,6 +40,8 @@ module IsoDoc
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def implicit_number_formatter(num, locale)
|
43
|
+
num.ancestors("formula").empty? or return
|
44
|
+
## by default, no formatting in formulas
|
43
45
|
fmt = { significant: num_totaldigits(num.text) }.compact
|
44
46
|
n = normalise_number(num.text)
|
45
47
|
@numfmt.localized_number(n, locale:, format: fmt,
|
@@ -5,6 +5,12 @@ module IsoDoc
|
|
5
5
|
fonts_metadata(docxml)
|
6
6
|
attachments_extract(docxml)
|
7
7
|
preprocess_xslt_insert(docxml)
|
8
|
+
localized_strings(docxml)
|
9
|
+
a = docxml.at(ns("//metanorma-extension")) or return
|
10
|
+
a.elements.empty? and a.remove
|
11
|
+
end
|
12
|
+
|
13
|
+
def localized_strings(docxml)
|
8
14
|
a = docxml.at(ns("//bibdata")) or return
|
9
15
|
a.next =
|
10
16
|
"<localized-strings>#{i8n_name(trim_hash(@i18n.get), '').join}" \
|
@@ -37,9 +43,11 @@ module IsoDoc
|
|
37
43
|
|
38
44
|
def extension_insert_pt(xml)
|
39
45
|
xml.at(ns("//metanorma-extension")) ||
|
40
|
-
xml.at(ns("//bibdata"))
|
46
|
+
xml.at(ns("//bibdata"))
|
47
|
+
&.after("<metanorma-extension> </metanorma-extension>")
|
41
48
|
&.next_element ||
|
42
|
-
xml.root.elements.first
|
49
|
+
xml.root.elements.first
|
50
|
+
.before("<metanorma-extension> </metanorma-extension>")
|
43
51
|
.previous_element
|
44
52
|
end
|
45
53
|
|
@@ -58,7 +66,7 @@ module IsoDoc
|
|
58
66
|
def fonts_metadata(xmldoc)
|
59
67
|
ins = presmeta_insert_pt(xmldoc)
|
60
68
|
@fontist_fonts and CSV.parse_line(@fontist_fonts, col_sep: ";")
|
61
|
-
.map(&:strip).
|
69
|
+
.map(&:strip).reverse_each do |f|
|
62
70
|
ins.next = presmeta("fonts", f)
|
63
71
|
end
|
64
72
|
@fontlicenseagreement and
|
@@ -67,7 +75,7 @@ module IsoDoc
|
|
67
75
|
|
68
76
|
def presmeta_insert_pt(xmldoc)
|
69
77
|
xmldoc.at(ns("//presentation-metadata")) ||
|
70
|
-
xmldoc
|
78
|
+
extension_insert_pt(xmldoc).children.last
|
71
79
|
end
|
72
80
|
|
73
81
|
def presmeta(name, value)
|
@@ -6,7 +6,6 @@ module IsoDoc
|
|
6
6
|
s = docxml.at(ns("//sections")) or return
|
7
7
|
t = @meta.get[:doctitle]
|
8
8
|
t.nil? || t.empty? and return
|
9
|
-
#s.children.first.previous =
|
10
9
|
s.add_first_child "<p class='zzSTDTitle1'>#{t}</p>"
|
11
10
|
end
|
12
11
|
|
@@ -16,7 +15,6 @@ module IsoDoc
|
|
16
15
|
.each do |f|
|
17
16
|
f.parent.name == "annex" &&
|
18
17
|
@xrefs.klass.single_term_clause?(f.parent) and next
|
19
|
-
|
20
18
|
clause1(f)
|
21
19
|
end
|
22
20
|
end
|
@@ -41,14 +39,13 @@ module IsoDoc
|
|
41
39
|
p = "//clause | //annex | //appendix | //introduction | //foreword | " \
|
42
40
|
"//preface/abstract | //acknowledgements | //terms | " \
|
43
41
|
"//definitions | //references | //colophon | //indexsect"
|
44
|
-
docxml.xpath(ns(p)).each
|
45
|
-
floattitle1(f)
|
46
|
-
end
|
42
|
+
docxml.xpath(ns(p)).each { |f| floattitle1(f) }
|
47
43
|
# top-level
|
48
44
|
docxml.xpath(ns("//sections | //preface | //colophon"))
|
49
45
|
.each { |f| floattitle1(f) }
|
50
46
|
end
|
51
47
|
|
48
|
+
# TODO not currently doing anything with the @depth attribute of floating-title
|
52
49
|
def floattitle1(elem)
|
53
50
|
elem.xpath(ns(".//floating-title")).each do |p|
|
54
51
|
p.name = "p"
|
@@ -67,9 +64,8 @@ module IsoDoc
|
|
67
64
|
|
68
65
|
def annex1(elem)
|
69
66
|
lbl = @xrefs.anchor(elem["id"], :label)
|
70
|
-
|
67
|
+
t = elem.at(ns("./title")) and
|
71
68
|
t.children = "<strong>#{to_xml(t.children)}</strong>"
|
72
|
-
end
|
73
69
|
unnumbered_clause?(elem) and return
|
74
70
|
prefix_name(elem, "<br/><br/>", lbl, "title")
|
75
71
|
end
|
@@ -129,7 +125,7 @@ module IsoDoc
|
|
129
125
|
%w(note admonition p).include?(p.name) or break m
|
130
126
|
m << p
|
131
127
|
end
|
132
|
-
out.reject { |c| c["displayorder"] }.
|
128
|
+
out.reject { |c| c["displayorder"] }.reverse_each do |c|
|
133
129
|
c["displayorder"] = idx
|
134
130
|
idx += 1
|
135
131
|
end
|
@@ -195,7 +191,6 @@ module IsoDoc
|
|
195
191
|
preface.elements.each do |x|
|
196
192
|
((x.name == "floating-title" || x.at(xpath)) &&
|
197
193
|
xpath != "./self::*[not(following-sibling::*)]") or prev = x
|
198
|
-
# after.include?(x.name) or next
|
199
194
|
x.at(xpath) or next
|
200
195
|
clause == prev and break
|
201
196
|
prev ||= preface.children.first
|
@@ -248,7 +243,6 @@ module IsoDoc
|
|
248
243
|
def toc_refs(docxml)
|
249
244
|
docxml.xpath(ns("//toc//xref[text()]")).each do |x|
|
250
245
|
lbl = @xrefs.anchor(x["target"], :label) or next
|
251
|
-
#x.children.first.previous = "#{lbl}<tab/>"
|
252
246
|
x.add_first_child "#{lbl}<tab/>"
|
253
247
|
end
|
254
248
|
end
|
data/lib/isodoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|