blacklight-citeproc 0.0.2 → 0.0.3
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: c52e615bdce424fbfec115950ac82e38649f018158159940da6e9fcd873c2104
|
4
|
+
data.tar.gz: 57570370748113f270490e00b5c52e71c53362fba0c43e9ddfb767955a511f7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba1daf9478ce409440babf3a88433ebf1318eabc57c970278d68eb1bc7a26eb99d89db8a8e8a29e733139a7dfffc61330270e0fd63a651a67d9641829115b5eb
|
7
|
+
data.tar.gz: d5b51b51495d1289035fb7d4e12c8e4d43a2cfcdf927c3ed3471aef3a6ea476b156ed60c7b470f43a30d3d2facc4919a5c5814051dde92f7367b8acf41ad9885
|
@@ -11,7 +11,7 @@ module Blacklight::Citeproc
|
|
11
11
|
|
12
12
|
def initialize
|
13
13
|
@processors = []
|
14
|
-
@
|
14
|
+
@bibliographies = []
|
15
15
|
|
16
16
|
throw BadConfigError, 'Catalog controller needs a config.citeproc section' unless blacklight_config.citeproc
|
17
17
|
@config = blacklight_config.citeproc
|
@@ -33,5 +33,26 @@ module Blacklight::Citeproc
|
|
33
33
|
render layout: false
|
34
34
|
end
|
35
35
|
|
36
|
+
def print_multiple ids
|
37
|
+
_, documents = search_service.fetch(ids)
|
38
|
+
bibtex = ::BibTeX::Bibliography.new
|
39
|
+
documents.each do |document|
|
40
|
+
bibtex << document.export_as(:bibtex)
|
41
|
+
end
|
42
|
+
|
43
|
+
@processors.each do |processor|
|
44
|
+
processor.import bibtex.to_citeproc
|
45
|
+
bibliography = processor.render(:bibliography)
|
46
|
+
@citations << {citation: bibliography.html_safe, label: processor.options[:style]}
|
47
|
+
end
|
48
|
+
render :print_single, layout: false
|
49
|
+
end
|
50
|
+
|
51
|
+
def print_bookmarks
|
52
|
+
bookmarks = token_or_current_or_guest_user.bookmarks
|
53
|
+
bookmark_ids = bookmarks.collect { |b| b.document_id.to_s }
|
54
|
+
print_multiple bookmark_ids
|
55
|
+
end
|
56
|
+
|
36
57
|
end
|
37
58
|
end
|
data/blacklight-citeproc.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_dependency "bibtex-ruby", "
|
24
|
+
spec.add_dependency "bibtex-ruby", ">= 4.4.6"
|
25
25
|
spec.add_dependency "citeproc-ruby", "~> 1.1"
|
26
26
|
spec.add_dependency "csl-styles", "~> 1.0.1.9"
|
27
27
|
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-citeproc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jane Sandberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bibtex-ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.4.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.4.6
|
27
27
|
- !ruby/object:Gem::Dependency
|