relaton-render 3.0.0.pre.alpha.32 → 3.0.0.pre.alpha.33
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/docs/citation-style-pack.adoc +1 -1
- data/lib/relaton/render/iso690/rules.rb +82 -0
- data/lib/relaton/render/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f60dbd78e23c39885f24c3228ee357e87403531f06e9383337648f5f958e512
|
|
4
|
+
data.tar.gz: 66e522c7127639c738ff30874836094655948746a259a92829f29a578526fdad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 516518c28ea8a160ff658c8e1b4459ccfba92084c39cddb9358f617433a749253d904baf568feecb04ecc392923f7d2cc88550a6527d1fc5aa643134065d4f3d
|
|
7
|
+
data.tar.gz: cc3bbbb3475890477b3a6d3a7960791a8eebba0a6b1234c5f751d47a1a9d4047badf1743bc3e51b031791fb51842e222723a555acef218b0e1f9ad0c92a579d2
|
|
@@ -291,7 +291,7 @@ is a rule to promote:
|
|
|
291
291
|
|
|
292
292
|
|`ItuIdentifier` |`identifier: itu`
|
|
293
293
|
|`NistIdentifier`, `NistCreator`, `NistDate`, `SerialDate`, `NistSeries`, `NistComponentPart`, `NistPublisher`, `Draft` |the NIST author-year rule set
|
|
294
|
-
|`IeeeIdentifier`, `IeeeComponentPart`, `IeeeAccess`, `IeeeMedium`
|
|
294
|
+
|`IeeeIdentifier`, `IeeeComponentPart`, `IeeeAccess`, `IeeeMedium` |**[impl]** promoted: `ieee_identifier`, `ieee_component_part`, `ieee_access`, `ieee_medium`
|
|
295
295
|
|`BipmCreator`, `BipmComponentPart`, `BipmProduction`, `BipmExtent`, `BipmMedium`, `BipmEdition`, `BipmVolume` |the BIPM rule set
|
|
296
296
|
|`IhoEdition`, `IhoCreator` |affiliation-composite creators
|
|
297
297
|
|`JisComponentPart`, `JisSeries`, `JisExtent` |the JIS host-citation rules
|
|
@@ -15,8 +15,90 @@ module Relaton
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
# The IEEE-SA identifiers: DOI and ISBN carry their kind label
|
|
19
|
+
# with a colon ("DOI: https://doi.org/…")
|
|
20
|
+
class IeeeIdentifier < Elements::Identifier
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def render_id(docidentifier)
|
|
24
|
+
return "#{docidentifier.type}: #{docidentifier.content}" if
|
|
25
|
+
%w[DOI ISBN].include?(docidentifier.type)
|
|
26
|
+
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# The IEEE component part: "in Pellegrini, A. D., and P. K.
|
|
32
|
+
# Smith (eds.): <em>host</em>, production" — the names first,
|
|
33
|
+
# the eds marker in the close paren, the host title after the
|
|
34
|
+
# colon, the production after a comma
|
|
35
|
+
class IeeeComponentPart < Elements::ComponentPart
|
|
36
|
+
def render
|
|
37
|
+
h = host or return ""
|
|
38
|
+
out = +"in #{host_person_names(h)} (#{eds_label(h)}): "
|
|
39
|
+
out += host_title.to_s
|
|
40
|
+
production = Elements::Production
|
|
41
|
+
.new(h, style: @style, i18n: @i18n).render.to_s
|
|
42
|
+
out += ", #{production}" unless production.empty?
|
|
43
|
+
out
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def host_editors(h)
|
|
49
|
+
Array(h.contributor).select { |c| has_role?(c, "editor") }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def eds_label(h)
|
|
53
|
+
@i18n.label(host_editors(h).one? ? "ed" : "eds")
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# The IEEE host form: the first editor inverted, subsequent
|
|
57
|
+
# editors direct
|
|
58
|
+
def host_person_names(h)
|
|
59
|
+
host_editors(h).each_with_index.map { |c, i|
|
|
60
|
+
person = c.person or next ""
|
|
61
|
+
|
|
62
|
+
if i.zero?
|
|
63
|
+
[person_surname(person), person_given(person)]
|
|
64
|
+
.reject(&:empty?).join(", ")
|
|
65
|
+
else
|
|
66
|
+
[person_given(person), person_surname(person)]
|
|
67
|
+
.reject(&:empty?).join(" ")
|
|
68
|
+
end
|
|
69
|
+
}.reject(&:empty?).then { |names| join_names(names) }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# The IEEE access date, bare and unbracketed
|
|
74
|
+
# ("accessed September 3, 2019")
|
|
75
|
+
class IeeeAccess < Elements::Access
|
|
76
|
+
def render
|
|
77
|
+
"#{@i18n.label('viewed')} #{date_text}"
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# The IEEE medium, capitalized and carrying its own trailing
|
|
82
|
+
# comma ("Dataset,", "Preprint,")
|
|
83
|
+
class IeeeMedium < Elements::Medium
|
|
84
|
+
private
|
|
85
|
+
|
|
86
|
+
def medium
|
|
87
|
+
m = @model.medium or return ""
|
|
88
|
+
text = m.carrier.to_s
|
|
89
|
+
text = m.genre.to_s if text.empty?
|
|
90
|
+
text = [m.form.to_s, m.size.to_s].reject(&:empty?)
|
|
91
|
+
.join(", ") if text.empty?
|
|
92
|
+
text.empty? ? "" : "#{text.sub(/^\w/) { |c| c.upcase }},"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
18
96
|
REGISTRY = {
|
|
19
97
|
"status_bare" => BareStatus,
|
|
98
|
+
"ieee_identifier" => IeeeIdentifier,
|
|
99
|
+
"ieee_component_part" => IeeeComponentPart,
|
|
100
|
+
"ieee_access" => IeeeAccess,
|
|
101
|
+
"ieee_medium" => IeeeMedium,
|
|
20
102
|
}.freeze
|
|
21
103
|
|
|
22
104
|
class << self
|