isodoc 3.2.1 → 3.2.2
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/README.adoc +1 -1
- data/isodoc.gemspec +1 -5
- data/lib/isodoc/function/setup.rb +1 -0
- data/lib/isodoc/metadata.rb +15 -7
- data/lib/isodoc/metadata_contributor.rb +7 -2
- data/lib/isodoc/presentation_function/bibdata.rb +5 -5
- data/lib/isodoc/presentation_function/list.rb +8 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_gen_seq.rb +5 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1838af1ef3cfa443fb12a42021110e6fbd62939a9de84b341063bde18dd6f095
|
4
|
+
data.tar.gz: aa8889a0f7b2519aee981d9f7e9e244b52dd9c6d8afb9c3232259e74899a64e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 485a2e94c34ee1f1d00a8ea50e04dbb2dd8d1aafee5091478e3dec43b61f0a9585905af7cf1f9ae28db44c9c0427e674a4b2e358bbac89e74a2fc117d6e98f72
|
7
|
+
data.tar.gz: be94db4afe2a26d5afee70e2b9afe48cf091372e3606643914f1705bfece932536d6699e0792a9d9a3df70d1753726d67261e628e8b066436e6371da9bda6c1f
|
data/README.adoc
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
image:https://img.shields.io/gem/v/isodoc.svg["Gem Version", link="https://rubygems.org/gems/isodoc"]
|
4
4
|
image:https://github.com/metanorma/isodoc/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/isodoc/actions?query=workflow%3Arake"]
|
5
|
-
image:https://codeclimate.com/github/metanorma/isodoc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/isodoc"]
|
5
|
+
// image:https://codeclimate.com/github/metanorma/isodoc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/isodoc"]
|
6
6
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/isodoc.svg["Pull Requests", link="https://github.com/metanorma/isodoc/pulls"]
|
7
7
|
image:https://img.shields.io/github/commits-since/metanorma/isodoc/latest.svg["Commits since latest",link="https://github.com/metanorma/isodoc/releases"]
|
8
8
|
|
data/isodoc.gemspec
CHANGED
@@ -56,10 +56,6 @@ Gem::Specification.new do |spec|
|
|
56
56
|
spec.add_development_dependency "sassc-embedded", "~> 1"
|
57
57
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
58
58
|
spec.add_development_dependency "timecop", "~> 0.9"
|
59
|
-
spec.add_development_dependency "
|
60
|
-
# html2doc locks lutaml-model to ~ 0.7.0, but until testing of lutaml-model
|
61
|
-
# releases against dowmstream gems (notably Plurimath) is in place, locking at
|
62
|
-
# patch level
|
63
|
-
#spec.add_dependency "lutaml-model", "0.7.1"
|
59
|
+
spec.add_development_dependency "canon"
|
64
60
|
# spec.metadata["rubygems_mfa_required"] = "true"
|
65
61
|
end
|
data/lib/isodoc/metadata.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative "metadata_contributor"
|
|
3
3
|
|
4
4
|
module IsoDoc
|
5
5
|
class Metadata
|
6
|
-
attr_accessor :fonts_options, :labels
|
6
|
+
attr_accessor :fonts_options, :labels, :localdir
|
7
7
|
|
8
8
|
def ns(xpath)
|
9
9
|
Common::ns(xpath)
|
@@ -58,9 +58,8 @@ module IsoDoc
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def docstatus(xml, _out)
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
published_default(xml)
|
62
|
+
s = xml.at(ns("//bibdata/status/stage#{NOLANG}")) or return
|
64
63
|
s1 = xml.at(ns("//bibdata/status/stage#{currlang}")) || s
|
65
64
|
set(:stage, status_print(s.text))
|
66
65
|
s1 and set(:stage_display, status_print(s1.text))
|
@@ -70,10 +69,18 @@ module IsoDoc
|
|
70
69
|
set(:substage_display, i1)
|
71
70
|
(i2 = xml.at(ns("//bibdata/status/iteration"))&.text) and
|
72
71
|
set(:iteration, i2)
|
73
|
-
set(:unpublished, unpublished(s.text))
|
74
72
|
unpublished(s.text) && set(:stageabbr, stage_abbr(s.text))
|
75
73
|
end
|
76
74
|
|
75
|
+
def published_default(xml)
|
76
|
+
override = xml.at(ns("//semantic-metadata/stage-published"))&.text
|
77
|
+
default = override || "true"
|
78
|
+
ret = default == "false"
|
79
|
+
s = xml.at(ns("//bibdata/status/stage#{NOLANG}"))
|
80
|
+
override || !s or ret = unpublished(s.text)
|
81
|
+
set(:unpublished, ret)
|
82
|
+
end
|
83
|
+
|
77
84
|
def stage_abbr(docstatus)
|
78
85
|
status_print(docstatus).split(/ /).map { |s| s[0].upcase }.join
|
79
86
|
end
|
@@ -131,8 +138,7 @@ module IsoDoc
|
|
131
138
|
|
132
139
|
def title(isoxml, _out)
|
133
140
|
main = isoxml.at(ns("//bibdata/title[@language='#{@lang}']"))
|
134
|
-
&.children
|
135
|
-
set(:doctitle, main)
|
141
|
+
&.children and set(:doctitle, to_xml(main))
|
136
142
|
end
|
137
143
|
|
138
144
|
def subtitle(_isoxml, _out)
|
@@ -193,5 +199,7 @@ module IsoDoc
|
|
193
199
|
set(lbl, m << v.text)
|
194
200
|
end
|
195
201
|
end
|
202
|
+
|
203
|
+
include ::IsoDoc::ClassUtils
|
196
204
|
end
|
197
205
|
end
|
@@ -97,11 +97,16 @@ module IsoDoc
|
|
97
97
|
ret
|
98
98
|
end
|
99
99
|
|
100
|
+
def to_datauri(src)
|
101
|
+
/^data:/.match?(src) and return src
|
102
|
+
Vectory::Utils::datauri(src, @localdir)
|
103
|
+
end
|
104
|
+
|
100
105
|
def agency(xml)
|
101
106
|
agency, publisher, logos = agency1(xml)
|
102
107
|
set(:agency, agency)
|
103
108
|
set(:publisher, connectives_strip(@i18n.boolean_conj(publisher, "and")))
|
104
|
-
set(:copublisher_logos, logos)
|
109
|
+
set(:copublisher_logos, logos.map { |l| to_datauri(l) })
|
105
110
|
set(:copublisher_logo_attrs, copublisher_logo_attrs(xml))
|
106
111
|
agency_addr(xml)
|
107
112
|
end
|
@@ -135,7 +140,7 @@ module IsoDoc
|
|
135
140
|
set(k, v)
|
136
141
|
end
|
137
142
|
n = a.at(ns("./address/formattedAddress")) and
|
138
|
-
set(:pub_address, n.children
|
143
|
+
set(:pub_address, to_xml(n.children))
|
139
144
|
end
|
140
145
|
end
|
141
146
|
end
|
@@ -50,12 +50,12 @@ module IsoDoc
|
|
50
50
|
# translate dest_xpath in bibdata using lookup in hash
|
51
51
|
# source text is dest_xpath by default, can be alt_source_xpath if given
|
52
52
|
def hash_translate(bibdata, hash, dest_xpath, alt_source_xpath, lang)
|
53
|
-
x = bibdata.at(ns(dest_xpath)) or return
|
54
|
-
alt_source_xpath and doctype = bibdata.at(ns(alt_source_xpath))
|
55
|
-
doctype ||= x
|
56
53
|
hash.is_a? Hash or return
|
57
|
-
|
58
|
-
|
54
|
+
x = bibdata.xpath(ns(dest_xpath))
|
55
|
+
alt_source_xpath and alt_x = bibdata.at(ns(alt_source_xpath))&.text
|
56
|
+
x.each do |d|
|
57
|
+
v = hash[alt_x || d.text] and tag_translate(d, lang, v)
|
58
|
+
end
|
59
59
|
end
|
60
60
|
|
61
61
|
# does not allow %Spellout and %Ordinal in the ordinal expression
|
@@ -62,6 +62,12 @@ module IsoDoc
|
|
62
62
|
%w(—)
|
63
63
|
end
|
64
64
|
|
65
|
+
def ul_label_list_from_metadata(docxml)
|
66
|
+
list = docxml.xpath(ns("//presentation-metadata/ul-label-list"))
|
67
|
+
list.empty? and return nil
|
68
|
+
list.map(&:text)
|
69
|
+
end
|
70
|
+
|
65
71
|
def ul_label(elem)
|
66
72
|
val = ul_label_value(elem)
|
67
73
|
semx = "<semx element='autonum' source='#{elem['id']}'>#{val}</semx>"
|
@@ -71,7 +77,8 @@ module IsoDoc
|
|
71
77
|
|
72
78
|
def ul_label_value(elem)
|
73
79
|
depth = elem.ancestors("ul, ol").size
|
74
|
-
val =
|
80
|
+
val = ul_label_list_from_metadata(elem.document.root) ||
|
81
|
+
ul_label_list(elem)
|
75
82
|
val[(depth - 1) % val.size]
|
76
83
|
end
|
77
84
|
end
|
data/lib/isodoc/version.rb
CHANGED
@@ -30,10 +30,9 @@ module IsoDoc
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def sequential_figure_class_names(clause, container: false)
|
33
|
-
c = {}
|
34
33
|
j = 0
|
35
34
|
clause.xpath(ns(".//figure[@class][not(@class = 'pseudocode')]"))
|
36
|
-
.
|
35
|
+
.each_with_object({}) do |t, c|
|
37
36
|
c[t["class"]] ||= Counter.new
|
38
37
|
# labelled_ancestor(t, %w(figure)) and next
|
39
38
|
j = subfigure_increment(j, c[t["class"]], t)
|
@@ -50,7 +49,7 @@ module IsoDoc
|
|
50
49
|
|
51
50
|
def figure_anchor(elem, sublabel, label, klass, container: false)
|
52
51
|
if sublabel
|
53
|
-
|
52
|
+
label&.include?("<semx") or label = semx(elem.parent, label)
|
54
53
|
subfigure_anchor(elem, sublabel, label, klass, container: false)
|
55
54
|
else
|
56
55
|
@anchors[elem["id"]] = anchor_struct(
|
@@ -185,9 +184,8 @@ container: false)
|
|
185
184
|
end
|
186
185
|
|
187
186
|
def hierarchical_figure_class_names(clauses, num)
|
188
|
-
c = {}
|
189
187
|
j = 0
|
190
|
-
nodeSet(clauses).
|
188
|
+
nodeSet(clauses).each_with_object({}) do |clause, c|
|
191
189
|
clause.xpath(ns(".//figure[@class][not(@class = 'pseudocode')]"))
|
192
190
|
.noblank.each do |t|
|
193
191
|
# labelled_ancestor(t, %w(figure)) and next
|
@@ -207,7 +205,8 @@ container: false)
|
|
207
205
|
# labelled_ancestor(t) and next
|
208
206
|
@anchors[t["id"]] =
|
209
207
|
anchor_struct(hiersemx(clause, num, c.increment(t), t),
|
210
|
-
t, @labels["table"], "table",
|
208
|
+
t, @labels["table"], "table",
|
209
|
+
{ unnumb: t["unnumbered"], container: false })
|
211
210
|
end
|
212
211
|
end
|
213
212
|
end
|
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: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -333,7 +333,7 @@ dependencies:
|
|
333
333
|
- !ruby/object:Gem::Version
|
334
334
|
version: '0.9'
|
335
335
|
- !ruby/object:Gem::Dependency
|
336
|
-
name:
|
336
|
+
name: canon
|
337
337
|
requirement: !ruby/object:Gem::Requirement
|
338
338
|
requirements:
|
339
339
|
- - ">="
|