jekyll-scholar 6.5.1 → 6.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69721f8d8ba934874039c43bd0fab2ec7c5ab4dda4be6d0758e331c333466207
4
- data.tar.gz: 52a3b972483b9626789ff4cba5b4203d411e17cd659d0f2c3e74f8239da0d532
3
+ metadata.gz: 553c6ce018f518f25bb57bd76a547da001554588f947d158db5630ca3a863294
4
+ data.tar.gz: 8e18201f73e7157d096d84447c6fc526dbe6094b8bcf4f43a407d91b780ff3b9
5
5
  SHA512:
6
- metadata.gz: afe07db8a50178374c677d9a4252c4eda8f84e71b6c212d7382443ab5217614eafea901ec41fd5c3e28b7b6ca495f020980e2b8780c7c2a1e86d53ac672369ea
7
- data.tar.gz: f80f88409839f68ff4c3b06ba78f7a0df99a40e970711ec318a1053ae456bf60214e0209886424620030b874f4ca48d4d1600de6b96a4cc0f079876b12347df5
6
+ metadata.gz: 98d42799eb2356464ef26cef26cff2de39e1e3b39352ec4bb77e41c5a70dc9fe39dafc4ad8b4fc0a261c90530ea9bc5152e5b66468c3715f422910bf96061a89
7
+ data.tar.gz: '09f0301742a895a3cb8a1d09a604715bf79034cb08f55b946bf3733999700f69d4adc537befd01f376e9bd4d06bb26891f97ef290d1023acf4083c989ba08810'
@@ -3,8 +3,10 @@ sudo: false
3
3
  cache: bundler
4
4
  matrix:
5
5
  include:
6
- - rvm: 2.6
6
+ - rvm: 2.7
7
7
  env: WITH_COVERALLS=true
8
+ - rvm: 2.6
9
+ env: WITH_COVERALLS=false
8
10
  - rvm: 2.5
9
11
  env: WITH_COVERALLS=false
10
12
  - rvm: 2.4
data/Gemfile CHANGED
@@ -2,22 +2,22 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :development do
5
- gem 'test-unit'
5
+ gem 'cucumber'
6
6
  gem 'rake'
7
+ gem 'redcarpet'
7
8
  gem 'redgreen'
8
9
  gem 'shoulda'
9
- gem 'cucumber', '1.3.11'
10
- gem 'redcarpet'
10
+ gem 'test-unit'
11
11
  gem 'unicode_utils' if RUBY_VERSION < '2.4'
12
12
  end
13
13
 
14
14
  group :extra do
15
- gem 'listen'
15
+ gem 'listen'
16
16
  end
17
17
 
18
18
  group :coverage do
19
- gem 'simplecov', :require => false
20
19
  gem 'coveralls', :require => false
20
+ gem 'simplecov', :require => false
21
21
  end
22
22
 
23
23
  group :debug do
data/README.md CHANGED
@@ -501,6 +501,13 @@ can be set via the 'details_link' configuration option).
501
501
  Duis 'aute irure dolor in reprehenderit in voluptate' velit esse cillum
502
502
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
503
503
  proident {% cite_details key --text Click Here For More Details %}.
504
+
505
+ Alternatively, you can use the `details_link` tag to get just the URL to
506
+ a details page. This can be used to link to details pages in markdown the
507
+ same way you would link to a blog post with Jekyll's `link` tag.
508
+
509
+ [See our blog post]({% link _posts/2020-01-01-research-post.md %})
510
+ or [find more details]({% details_link key %}).
504
511
 
505
512
 
506
513
  ### Bibliography Filters
@@ -583,7 +583,7 @@ Feature: BibTeX
583
583
  """
584
584
  ---
585
585
  ---
586
- {% bibliography %}
586
+ {% bibliography --style apa-6th-edition %}
587
587
  """
588
588
  When I run jekyll
589
589
  Then the _site directory should exist
@@ -140,3 +140,31 @@ Feature: Citations
140
140
  Then the _site directory should exist
141
141
  And the "_site/scholar.html" file should exist
142
142
  And I should see "Click For More</a>" in "_site/scholar.html"
143
+
144
+ @tags @details_link
145
+ Scenario: A Simple Details Link
146
+ Given I have a scholar configuration with:
147
+ | key | value |
148
+ | source | ./_bibliography |
149
+ | bibliography | my_references |
150
+ And I have a "_bibliography" directory
151
+ And I have a file "_bibliography/my_references.bib":
152
+ """
153
+ @book{ruby,
154
+ title = {The Ruby Programming Language},
155
+ author = {Flanagan, David and Matsumoto, Yukihiro},
156
+ year = {2008},
157
+ publisher = {O'Reilly Media}
158
+ }
159
+ """
160
+ And I have a page "scholar.html":
161
+ """
162
+ ---
163
+ ---
164
+ {% details_link ruby %}
165
+ """
166
+ When I run jekyll
167
+ Then the _site directory should exist
168
+ And the "_site/scholar.html" file should exist
169
+ And I should see "/bibliography/ruby.html" in "_site/scholar.html"
170
+ And I should not see ""<a>"" in "_site/scholar.html"
@@ -161,7 +161,7 @@ Feature: BibTeX
161
161
  """
162
162
  ---
163
163
  ---
164
- {% bibliography %}
164
+ {% bibliography --style apa-6th-edition %}
165
165
  """
166
166
  When I run jekyll
167
167
  Then the _site directory should exist
@@ -192,7 +192,7 @@ Feature: BibTeX
192
192
  """
193
193
  ---
194
194
  ---
195
- {% bibliography %}
195
+ {% bibliography --style apa-6th-edition %}
196
196
  """
197
197
  When I run jekyll
198
198
  Then the _site directory should exist
@@ -6,16 +6,12 @@ rescue LoadError
6
6
  end
7
7
 
8
8
  begin
9
- if RUBY_VERSION > '2.0'
10
- require 'byebug'
11
- else
12
- require 'debugger'
13
- end
9
+ require 'byebug'
14
10
  rescue LoadError
15
11
  # ignore
16
12
  end
17
13
 
18
- require 'test/unit'
14
+ require 'minitest/test'
19
15
  require 'jekyll/scholar'
20
16
  require 'tmpdir'
21
17
 
@@ -32,7 +28,6 @@ def prepend_test_dir(options, key)
32
28
  end
33
29
 
34
30
  def run_jekyll(options = {})
35
-
36
31
  options = Jekyll.configuration(options)
37
32
 
38
33
  prepend_test_dir(options, 'source')
@@ -42,5 +37,4 @@ def run_jekyll(options = {})
42
37
  print options['destination'] + "\n"
43
38
  site = Jekyll::Site.new(options)
44
39
  site.process
45
-
46
40
  end
@@ -5,6 +5,8 @@ Before do
5
5
  end
6
6
 
7
7
  After do
8
- FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR)
8
+ if File.exist?(TEST_DIR)
9
+ FileUtils.rm_rf(TEST_DIR)
10
+ Dir.chdir(File.dirname(TEST_DIR))
11
+ end
9
12
  end
10
-
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  s.date = Time.now
24
24
 
25
25
  s.required_rubygems_version = '>= 1.3.6'
26
- s.rubyforge_project = s.name
27
26
 
28
27
  s.add_runtime_dependency('jekyll', '~> 4.0')
29
28
  s.add_runtime_dependency('citeproc-ruby', '~> 1.0')
@@ -17,6 +17,7 @@ require 'jekyll/scholar/tags/bibliography_count'
17
17
  require 'jekyll/scholar/tags/bibtex'
18
18
  require 'jekyll/scholar/tags/cite'
19
19
  require 'jekyll/scholar/tags/cite_details'
20
+ require 'jekyll/scholar/tags/details_link'
20
21
  require 'jekyll/scholar/tags/quote'
21
22
  require 'jekyll/scholar/tags/reference'
22
23
  require 'jekyll/scholar/generators/details'
@@ -0,0 +1,25 @@
1
+ module Jekyll
2
+ class Scholar
3
+
4
+ class DetailsLinkTag < Liquid::Tag
5
+ include Scholar::Utilities
6
+
7
+ def initialize(tag_name, arguments, tokens)
8
+ super
9
+
10
+ @config = Scholar.defaults.dup
11
+ @keys, arguments = split_arguments arguments
12
+
13
+ optparse(arguments)
14
+ end
15
+
16
+ def render(context)
17
+ set_context_to context
18
+ details_link keys[0]
19
+ end
20
+ end
21
+
22
+ end
23
+ end
24
+
25
+ Liquid::Template.register_tag('details_link', Jekyll::Scholar::DetailsLinkTag)
@@ -724,6 +724,14 @@ module Jekyll
724
724
  end
725
725
  end
726
726
 
727
+ def details_link(key)
728
+ if bibliography.key?(key)
729
+ details_link_for(bibliography[key])
730
+ else
731
+ raise Exception.new "Could not find entry for key '%s'" % key
732
+ end
733
+ end
734
+
727
735
  def content_tag(name, content_or_attributes, attributes = {})
728
736
  if content_or_attributes.is_a?(Hash)
729
737
  content, attributes = nil, content_or_attributes
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '6.5.1'.freeze
3
+ VERSION = '6.6.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scholar
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.5.1
4
+ version: 6.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-22 00:00:00.000000000 Z
11
+ date: 2020-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -125,6 +125,7 @@ files:
125
125
  - lib/jekyll/scholar/tags/bibtex.rb
126
126
  - lib/jekyll/scholar/tags/cite.rb
127
127
  - lib/jekyll/scholar/tags/cite_details.rb
128
+ - lib/jekyll/scholar/tags/details_link.rb
128
129
  - lib/jekyll/scholar/tags/quote.rb
129
130
  - lib/jekyll/scholar/tags/reference.rb
130
131
  - lib/jekyll/scholar/utilities.rb
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  - !ruby/object:Gem::Version
149
150
  version: 1.3.6
150
151
  requirements: []
151
- rubygems_version: 3.0.6
152
+ rubygems_version: 3.1.2
152
153
  signing_key:
153
154
  specification_version: 4
154
155
  summary: Jekyll extensions for the academic blogger.