relaton-render 1.0.4 → 1.0.5
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b834b958e0a0c893b641087a171141972d18626cd01c66bce85e29a898d4fa40
|
|
4
|
+
data.tar.gz: 44b06318fdd7c00cca50fb0b309a84faaa26f914bade814f2a4389998076e7a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd66e65e6a282d5926701f28965bcb6e857acc4fb675936effd18e7c40b957c9ec645522bdbea2ff50f7f12b5db44bddb1a3d66b1ca986b113b9cba38bd0a8fc
|
|
7
|
+
data.tar.gz: ad226183da8ff58d03f8b8cc75e9795b20a503f5c73adb6df6210f5c95382da1992a51d86a19acd526c38977d010437bc64171943704ce15f8c7586af9558af1
|
|
@@ -82,11 +82,13 @@ module Relaton
|
|
|
82
82
|
@r.i18n.select(hash).get.dig("stage", status) || status
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
+
# date => disambiguated_date, the disambiguation happens in citations/
|
|
85
86
|
def date_fields_format(hash)
|
|
86
|
-
[%i(date date), %i(
|
|
87
|
+
[%i(date date), %i(disambiguated_date date),
|
|
88
|
+
%i(date_updated date_updated),
|
|
87
89
|
%i(date_accessed date_accessed)].each do |k|
|
|
88
90
|
hash[k[0]] = dateformat(hash[k[1]], hash, k)
|
|
89
|
-
k[
|
|
91
|
+
k[1] == :date &&
|
|
90
92
|
!%w(standard webresource website).include?(hash[:type]) and
|
|
91
93
|
hash[k[0]] ||= @r.i18n.select(nil).get["no_date"]
|
|
92
94
|
end
|
|
@@ -135,20 +135,29 @@ module Relaton
|
|
|
135
135
|
def suffix_date(ret)
|
|
136
136
|
ret.each do |k, v|
|
|
137
137
|
v.each do |k1, v1|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
suffix_date1(ret, k, k1)
|
|
138
|
+
s = v1.reject { |b| b[:date].nil? }.size
|
|
139
|
+
s.zero? || k.nil? and next
|
|
140
|
+
suffix_date1(ret, k, k1, s)
|
|
141
|
+
copy_date_fields(ret, k, k1)
|
|
141
142
|
end
|
|
142
143
|
end
|
|
143
144
|
ret
|
|
144
145
|
end
|
|
145
146
|
|
|
146
|
-
def suffix_date1(ret, key1, key2)
|
|
147
|
-
|
|
147
|
+
def suffix_date1(ret, key1, key2, size)
|
|
148
|
+
size > 1 or return
|
|
148
149
|
ret[key1][key2].each_with_index do |b, i|
|
|
149
150
|
b[:date].nil? and next
|
|
150
|
-
b[:date]
|
|
151
|
+
b[:disambiguated_date] = b[:date] + ("a".ord + i).chr.to_s
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def copy_date_fields(ret, key1, key2)
|
|
156
|
+
ret[key1][key2].each do |b|
|
|
157
|
+
b[:date].nil? and next
|
|
151
158
|
b[:data][:date] = b[:date]
|
|
159
|
+
b[:disambiguated_date] ||= b[:date]
|
|
160
|
+
b[:data][:disambiguated_date] = b[:disambiguated_date]
|
|
152
161
|
end
|
|
153
162
|
end
|
|
154
163
|
|
|
@@ -157,7 +166,8 @@ module Relaton
|
|
|
157
166
|
v.each_value do |v1|
|
|
158
167
|
v1.each do |b|
|
|
159
168
|
m[b[:id]] = { author: @i18n.select(b[:data]).l10n(b[:author]),
|
|
160
|
-
date: b[:
|
|
169
|
+
date: b[:disambiguated_date] || b[:date],
|
|
170
|
+
citation: {},
|
|
161
171
|
data: b[:data], type: b[:type] }
|
|
162
172
|
end
|
|
163
173
|
end
|
|
@@ -37,10 +37,10 @@ language: en
|
|
|
37
37
|
script: Latn
|
|
38
38
|
|
|
39
39
|
citetemplate:
|
|
40
|
-
author_date: "{{ author }} {{
|
|
41
|
-
author_date_br: "{{ author }} ({{
|
|
40
|
+
author_date: "{{ author }} {{ disambiguated_date}}"
|
|
41
|
+
author_date_br: "{{ author }} ({{ disambiguated_date}})"
|
|
42
42
|
author: "{{ author }}"
|
|
43
|
-
date: "{{
|
|
43
|
+
date: "{{ disambiguated_date }}"
|
|
44
44
|
reference_tag: "{{ biblio_tag }}"
|
|
45
45
|
title: "{{ title }}"
|
|
46
46
|
title_reference_tag: "{{ title }} {{ biblio_tag }}"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-render
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|