isodoc 2.10.2 → 2.10.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 +10 -1
- data/lib/isodoc/base_style/reset.css +10 -1
- data/lib/isodoc/base_style/reset.scss +5 -3
- data/lib/isodoc/metadata.rb +2 -0
- data/lib/isodoc/presentation_function/math.rb +5 -5
- data/lib/isodoc/presentation_function/metadata.rb +17 -0
- data/lib/isodoc/presentation_function/refs.rb +3 -1
- data/lib/isodoc/presentation_xml_convert.rb +6 -3
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc-yaml/i18n-ja.yaml +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: d57eb699105f5f1b40c5b31cf51259a1bd60b458ac2b6ab0326beaa915c63750
|
4
|
+
data.tar.gz: 99b2d95988e2f1bb989f0779a60298c57fe08e69127bc07f063bd813403e5858
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5657c1f981918049eab6e6cd2d17d9d929309714025936dc27256f4ce0ec6b04b3c60a8bbd8839daec8eb322515425349cba06972ef888706ed44ea886cd8527
|
7
|
+
data.tar.gz: 1129bf0dbb9d6e31ef5a8fc50d2dd1f63aa70658c4ffdc60329c6e60fd6da3ffb7127fb32c99609ddd68da4b703f8712f0487820362081d1752d2ac983f5b079
|
@@ -1,3 +1,4 @@
|
|
1
|
+
@charset "UTF-8";
|
1
2
|
html, body, div, span, applet, object, iframe,
|
2
3
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
3
4
|
a, abbr, acronym, address, big, cite, code,
|
@@ -169,12 +170,15 @@ table.rouge-line-table pre {
|
|
169
170
|
overflow-x: visible;
|
170
171
|
font-size: 100%; }
|
171
172
|
|
173
|
+
/* header § links */
|
172
174
|
a.header {
|
173
175
|
color: inherit;
|
174
176
|
text-decoration: none; }
|
175
177
|
|
176
178
|
a.header:hover {
|
177
|
-
color: #a53221;
|
179
|
+
color: #a53221 !important;
|
180
|
+
background: inherit;
|
181
|
+
box-shadow: none; }
|
178
182
|
|
179
183
|
a.header:visited {
|
180
184
|
color: inherit;
|
@@ -197,6 +201,11 @@ a.anchor::before {
|
|
197
201
|
display: block;
|
198
202
|
padding-top: .1em; }
|
199
203
|
|
204
|
+
a.anchor:hover {
|
205
|
+
color: #a53221;
|
206
|
+
background: inherit;
|
207
|
+
box-shadow: none; }
|
208
|
+
|
200
209
|
h1 > a.anchor:hover,
|
201
210
|
h2 > a.anchor:hover,
|
202
211
|
h3 > a.anchor:hover,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
@charset "UTF-8";
|
1
2
|
html, body, div, span, applet, object, iframe,
|
2
3
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
3
4
|
a, abbr, acronym, address, big, cite, code,
|
@@ -169,12 +170,15 @@ table.rouge-line-table pre {
|
|
169
170
|
overflow-x: visible;
|
170
171
|
font-size: 100%; }
|
171
172
|
|
173
|
+
/* header § links */
|
172
174
|
a.header {
|
173
175
|
color: inherit;
|
174
176
|
text-decoration: none; }
|
175
177
|
|
176
178
|
a.header:hover {
|
177
|
-
color: #a53221;
|
179
|
+
color: #a53221 !important;
|
180
|
+
background: inherit;
|
181
|
+
box-shadow: none; }
|
178
182
|
|
179
183
|
a.header:visited {
|
180
184
|
color: inherit;
|
@@ -197,6 +201,11 @@ a.anchor::before {
|
|
197
201
|
display: block;
|
198
202
|
padding-top: .1em; }
|
199
203
|
|
204
|
+
a.anchor:hover {
|
205
|
+
color: #a53221;
|
206
|
+
background: inherit;
|
207
|
+
box-shadow: none; }
|
208
|
+
|
200
209
|
h1 > a.anchor:hover,
|
201
210
|
h2 > a.anchor:hover,
|
202
211
|
h3 > a.anchor:hover,
|
@@ -200,11 +200,13 @@ table.rouge-line-table pre {
|
|
200
200
|
font-size: 100%;
|
201
201
|
}
|
202
202
|
|
203
|
-
|
204
|
-
a.header
|
205
|
-
a.header:
|
203
|
+
/* header § links */
|
204
|
+
a.header{color:inherit;text-decoration:none;}
|
205
|
+
a.header:hover{color:#a53221 !important;background:inherit;box-shadow:none;}
|
206
|
+
a.header:visited{color:inherit;text-decoration:none;}
|
206
207
|
a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
|
207
208
|
a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
|
209
|
+
a.anchor:hover{color:#a53221;background:inherit;box-shadow:none;}
|
208
210
|
h1>a.anchor:hover,
|
209
211
|
h2>a.anchor:hover,
|
210
212
|
h3>a.anchor:hover,
|
data/lib/isodoc/metadata.rb
CHANGED
@@ -48,6 +48,8 @@ module IsoDoc
|
|
48
48
|
set(:doctype, status_print(b))
|
49
49
|
b1 = isoxml&.at(ns("//bibdata/ext/doctype#{currlang}"))&.text || b
|
50
50
|
set(:doctype_display, status_print(b1))
|
51
|
+
b = isoxml&.at(ns("//bibdata/ext/subdoctype#{NOLANG}"))&.text || return
|
52
|
+
set(:subdoctype, status_print(b))
|
51
53
|
end
|
52
54
|
|
53
55
|
def docstatus(xml, _out)
|
@@ -79,12 +79,12 @@ module IsoDoc
|
|
79
79
|
|
80
80
|
def parse_localize_number
|
81
81
|
@localizenumber or return {}
|
82
|
-
m = %r{(?<
|
82
|
+
m = %r{(?<grp>[^#])?(?<grpdig>#+0)(?<decpt>.)(?<frdig>#+)(?<frgrp>[^#])?}
|
83
83
|
.match(@localizenumber) or return {}
|
84
|
-
ret = { decimal: m[:
|
85
|
-
fraction_group_digits: m[:
|
86
|
-
group: m[:
|
87
|
-
fraction_group: m[:
|
84
|
+
ret = { decimal: m[:decpt], group_digits: m[:grpdig].size,
|
85
|
+
fraction_group_digits: m[:frdig].size,
|
86
|
+
group: m[:grp] || "",
|
87
|
+
fraction_group: m[:frgrp] || "" }.compact
|
88
88
|
%i(group fraction_group).each { |x| ret[x] == " " and ret[x] = "\u00A0" }
|
89
89
|
ret
|
90
90
|
end
|
@@ -3,6 +3,7 @@ module IsoDoc
|
|
3
3
|
def metadata(docxml)
|
4
4
|
toc_metadata(docxml)
|
5
5
|
fonts_metadata(docxml)
|
6
|
+
attachments_extract(docxml)
|
6
7
|
preprocess_xslt_insert(docxml)
|
7
8
|
a = docxml.at(ns("//bibdata")) or return
|
8
9
|
a.next =
|
@@ -10,6 +11,22 @@ module IsoDoc
|
|
10
11
|
"</localized-strings>"
|
11
12
|
end
|
12
13
|
|
14
|
+
def attachments_extract(docxml)
|
15
|
+
docxml.at(ns("//metanorma-extension/attachment")) or return
|
16
|
+
dir = File.join(@localdir, "_#{@outputfile}_attachments")
|
17
|
+
FileUtils.rm_rf(dir)
|
18
|
+
FileUtils.mkdir_p(dir)
|
19
|
+
docxml.xpath(ns("//metanorma-extension/attachment")).each do |a|
|
20
|
+
save_attachment(a, dir)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def save_attachment(attachment, dir)
|
25
|
+
n = File.join(dir, attachment["name"])
|
26
|
+
c = attachment.text.sub(%r{^data:[^;]+;(?:charset=[^;]+;)?base64,}, "")
|
27
|
+
File.open(n, "wb") { |f| f.write(Base64.strict_decode64(c)) }
|
28
|
+
end
|
29
|
+
|
13
30
|
def extension_insert(xml, path = [])
|
14
31
|
ins = extension_insert_pt(xml)
|
15
32
|
path.each do |n|
|
@@ -25,7 +25,9 @@ module IsoDoc
|
|
25
25
|
def hidden_items(docxml)
|
26
26
|
docxml.xpath(ns("//references[bibitem/@hidden = 'true']")).each do |x|
|
27
27
|
x.at(ns("./bibitem[not(@hidden = 'true')]")) and next
|
28
|
-
x.elements.map(&:name).any?
|
28
|
+
x.elements.map(&:name).any? do |n|
|
29
|
+
!%w(title bibitem).include?(n)
|
30
|
+
end and next
|
29
31
|
x["hidden"] = "true"
|
30
32
|
end
|
31
33
|
end
|
@@ -18,10 +18,13 @@ module IsoDoc
|
|
18
18
|
super
|
19
19
|
end
|
20
20
|
|
21
|
-
def convert1(docxml,
|
21
|
+
def convert1(docxml, filename, dir)
|
22
|
+
@outputdir = dir
|
23
|
+
@outputfile = filename
|
22
24
|
docid_prefixes(docxml) # feeds @xrefs.parse citation processing
|
23
25
|
@xrefs.parse docxml
|
24
|
-
|
26
|
+
@xrefs.klass.meta = @meta
|
27
|
+
@xrefs.klass.info docxml, nil
|
25
28
|
conversions(docxml)
|
26
29
|
docxml.root["type"] = "presentation"
|
27
30
|
docxml.to_xml.gsub("<", "<").gsub(">", ">")
|
@@ -120,7 +123,7 @@ module IsoDoc
|
|
120
123
|
def metanorma_extension_insert_pt(xml)
|
121
124
|
xml.at(ns("//metanorma-extension")) ||
|
122
125
|
xml.at(ns("//bibdata"))&.after("<metanorma-extension/>")
|
123
|
-
|
126
|
+
&.next_element ||
|
124
127
|
xml.root.elements.first.before("<metanorma-extension/>")
|
125
128
|
.previous_element
|
126
129
|
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.10.
|
4
|
+
version: 2.10.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-
|
11
|
+
date: 2024-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html2doc
|