metanorma 2.0.9 → 2.0.10
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/metanorma/collection/xrefprocess/xrefprocess.rb +13 -3
- data/lib/metanorma/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: 1e681e7a6dd2a2a79b02bbd1e49d7d1761708caed6dab61f6288153a939468b4
|
|
4
|
+
data.tar.gz: 10bfbb27b1851e2b44fe916e46e673b2cf2155d7b8298f21ca65a54e29ef075b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10ec3b71b64829a8e536f97ad7b93a8ee3d3a9d86d2ad984bfc2dce6a1cfd4f1220681171dbca2d76889aed5de475d61b70640d1fd33affb1a970afe63982a83
|
|
7
|
+
data.tar.gz: f477977ce41ff242b590f3a1a9a01a768bf8882de35f18077bd92467989da37af60760536d7e7f37cfe09ae3c3444b26200b2e028abd8787e9fd298fc2959545
|
|
@@ -106,11 +106,20 @@ module Metanorma
|
|
|
106
106
|
end
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
+
def select_citation_uri(bib, lang)
|
|
110
|
+
bib or return
|
|
111
|
+
url = bib.at(ns("./uri[@type = 'citation']" \
|
|
112
|
+
"[@language = '#{lang}']")) ||
|
|
113
|
+
bib.at(ns("./uri[@type = 'citation']"))
|
|
114
|
+
url&.text
|
|
115
|
+
end
|
|
116
|
+
|
|
109
117
|
def eref_to_internal_eref(section, xml, key)
|
|
110
|
-
bibitems, indirect, bibids =
|
|
118
|
+
bibitems, indirect, bibids, lang =
|
|
119
|
+
eref_to_internal_eref_prep(section, xml)
|
|
111
120
|
eref_to_internal_eref_select(section, xml, bibitems)
|
|
112
121
|
.each_with_object([]) do |x, m|
|
|
113
|
-
url = bibitems[x]
|
|
122
|
+
url = select_citation_uri(bibitems[x], lang)
|
|
114
123
|
bibids[x]&.each do |e|
|
|
115
124
|
e.at(ns("./localityStack | ./locality")) and next
|
|
116
125
|
id = eref_to_internal_eref1(e, key, url, indirect) and m << id
|
|
@@ -124,7 +133,8 @@ module Metanorma
|
|
|
124
133
|
indirect = ::Metanorma::Collection::Util::gather_bibitems(xml)
|
|
125
134
|
.select { |_, v| indirect_bib?(v) }
|
|
126
135
|
bibitemids = ::Metanorma::Collection::Util::gather_bibitemids(section)
|
|
127
|
-
|
|
136
|
+
lang = xml.at(ns("//bibdata/language"))&.text || "en"
|
|
137
|
+
[bibitems, indirect, bibitemids, lang]
|
|
128
138
|
end
|
|
129
139
|
|
|
130
140
|
def eref_to_internal_eref1(elem, key, url, indirect)
|
data/lib/metanorma/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.10
|
|
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-12-
|
|
11
|
+
date: 2024-12-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|