relaton-render 3.0.0.pre.alpha.19 → 3.0.0.pre.alpha.21

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: 14efa687d6e0316dd88f104203593084e6eefc7e16f7d7f42729f2c4c8e79ffb
4
- data.tar.gz: ef2d1156dba8ad76bec04286e4748d05940692bb74ca5d7b2eb1a368425caa47
3
+ metadata.gz: bfc55ca6da22673e6173486336211c48510588218d75e08672e8b3cfc09308cd
4
+ data.tar.gz: 0a338c96b9ec80bbd6b345c86d6fa15a9b14810db27729104f1386391f46de69
5
5
  SHA512:
6
- metadata.gz: eed19567e724a4103caca36f279df1dd559e7b9f1b495e51ee082c35b06b39b2440de8603815f443a9f29f36a962c59237814bdfa627e6f4812b9a4132268223
7
- data.tar.gz: b67866542a100599e55a2107889b2a5a5f994113a62e40dde8a32e2e7da5fbc5f4cc38e03c55a3edb16bb1f3b934587490b9f21551aaaf708291da5435f347b9
6
+ metadata.gz: 4d172ba4dd2697389d3372a37eaf460d7673ab7a2ba693e8365f8777f241c8dc19df5b2dc9082563aaeeb08866634318dccfbed54d61a378b341ee0c7b88e954
7
+ data.tar.gz: c0258407ac4ca2672164299ffe50b4ea671498dced9f653b06eb818e448e824e405b77e321a4e756f17710aba74a7f2892d69dfea3d7e6e216f84e23c6e6b190
@@ -84,11 +84,22 @@ module Relaton
84
84
  sep = @style.scheme.name_form.initials_separator.to_s
85
85
  return reinitials(localized(person.name&.formatted_initials)) if
86
86
  parts.empty?
87
- return parts.map(&method(:initial)).join(sep) if initials?
87
+ return given_with_first_full(parts, sep) if initials?
88
88
 
89
89
  parts.join(" ")
90
90
  end
91
91
 
92
+ # The document-history name form: the first forename cites in
93
+ # full, the rest as initials ("Milena S.")
94
+ def given_with_first_full(parts, sep)
95
+ initials = parts.map { |p| initial(p) }
96
+ return initials.join(sep) unless
97
+ @style.scheme.name_form.subsequent_initials
98
+
99
+ rest = parts.drop(1).map { |p| initial(p) }.join(sep)
100
+ rest.empty? ? parts.first : "#{parts.first}#{sep}#{rest}"
101
+ end
102
+
92
103
  # Declared initials are a list in string form; rejoin them with
93
104
  # the style's separator
94
105
  def reinitials(raw)
@@ -130,7 +130,9 @@ module Relaton
130
130
  end
131
131
 
132
132
  # The declared creator fallback for items with no personal
133
- # creators: the publisher's abbreviation or full name
133
+ # creators: the publishers' abbreviation or full name — all
134
+ # publishers cite, joined per the style's list style ("ISO and
135
+ # IEC")
134
136
  def fallback_name
135
137
  orgs = contributors("publisher")
136
138
  name = case name_form.creator_fallback
@@ -145,7 +147,7 @@ module Relaton
145
147
  else
146
148
  []
147
149
  end
148
- name.reject(&:empty?).first.to_s
150
+ join_names(name.reject(&:empty?))
149
151
  end
150
152
 
151
153
  def names
@@ -38,6 +38,9 @@ module Relaton
38
38
  attribute :surname_upcase, :boolean, default: -> { true }
39
39
  # Initials are a list; this separates them ("J. K." vs "J.K.")
40
40
  attribute :initials_separator, :string, default: " "
41
+ # The first forename cites in full, the rest as initials
42
+ # ("Milena S."; document-history name forms)
43
+ attribute :subsequent_initials, :boolean, default: -> { false }
41
44
  # The direct-order surname casing after the first creator:
42
45
  # the name-date convention upcases
43
46
  attribute :subsequent_surname_upcase, :boolean,
@@ -69,6 +72,7 @@ module Relaton
69
72
  map "initialsPeriod", to: :initials_period
70
73
  map "surnameUpcase", to: :surname_upcase
71
74
  map "initialsSeparator", to: :initials_separator
75
+ map "subsequentInitials", to: :subsequent_initials
72
76
  map "subsequentSurnameUpcase", to: :subsequent_surname_upcase
73
77
  map "etalCount", to: :etal_count
74
78
  map "etalDisplay", to: :etal_display
@@ -9,6 +9,9 @@ scheme:
9
9
  nameForm:
10
10
  initials: false
11
11
  givenNameFirst: false
12
+ # ISO 690 marks an editor list's role ("(éd.)") also when the list
13
+ # holds a single editor; flavors opt out per their own style
14
+ loneEditorMarked: true
12
15
  templates:
13
16
  titleOpen: "_"
14
17
  titleClose: "_"
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Render
3
- VERSION = "3.0.0.pre.alpha.19".freeze
3
+ VERSION = "3.0.0.pre.alpha.21".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-render
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.alpha.19
4
+ version: 3.0.0.pre.alpha.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.