jekyll-scholar 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/features/bibtex.feature +26 -0
- data/lib/jekyll/scholar/utilities.rb +10 -2
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd97537f40b52ff26ec6564b5d22bea683991fb2
|
4
|
+
data.tar.gz: fdc05e3ae4767f19e44b89b730a1014abd5549de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 625084ad4b2d9cac4dfb56322da7e8c4732398ed94d07099262d1779ed9a60ecdf9334785db8b771d8c3fe2c521bbcf2399532699f3be01a358a431476b56dcd
|
7
|
+
data.tar.gz: ecef959d91c3552a1d452f067f0b215c42dcece7024cfc7369e638fdd606f7586473efe4537a1b304fc3a0d97229282d515971653a33ddb62c4870dc9fa43c5b
|
data/Gemfile
CHANGED
data/features/bibtex.feature
CHANGED
@@ -185,3 +185,29 @@ Feature: BibTeX
|
|
185
185
|
And the "_site/scholar.html" file should exist
|
186
186
|
And I should not see "ruby" in "_site/scholar.html"
|
187
187
|
And I should see "id=\"a-smalltalk\"" in "_site/scholar.html"
|
188
|
+
|
189
|
+
@tags @bibliography @style
|
190
|
+
Scenario: Simple Bibliography Loaded From Default Directory
|
191
|
+
Given I have a scholar configuration with:
|
192
|
+
| key | value |
|
193
|
+
| source | ./_bibliography |
|
194
|
+
And I have a "_bibliography" directory
|
195
|
+
And I have a file "_bibliography/references.bib":
|
196
|
+
"""
|
197
|
+
@book{ruby,
|
198
|
+
title = {The Ruby Programming Language},
|
199
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
200
|
+
year = {2008},
|
201
|
+
publisher = {O'Reilly Media}
|
202
|
+
}
|
203
|
+
"""
|
204
|
+
And I have a page "scholar.html":
|
205
|
+
"""
|
206
|
+
---
|
207
|
+
---
|
208
|
+
{% bibliography --style mla %}
|
209
|
+
"""
|
210
|
+
When I run jekyll
|
211
|
+
Then the _site directory should exist
|
212
|
+
And the "_site/scholar.html" file should exist
|
213
|
+
And I should see "<i>The Ruby Programming Language</i>. O’Reilly Media, 2008" in "_site/scholar.html"
|
@@ -32,9 +32,13 @@ module Jekyll
|
|
32
32
|
opts.on('-t', '--text TEXT') do |text|
|
33
33
|
@text = text
|
34
34
|
end
|
35
|
+
|
36
|
+
opts.on('-s', '--style STYLE') do |style|
|
37
|
+
@style = style
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
|
-
argv = arguments.split(/(\B-[
|
41
|
+
argv = arguments.split(/(\B-[cfqpts]|\B--(?:cited|file|query|prefix|text|style|))/)
|
38
42
|
|
39
43
|
parser.parse argv.map(&:strip).reject(&:empty?)
|
40
44
|
end
|
@@ -88,12 +92,16 @@ module Jekyll
|
|
88
92
|
|
89
93
|
entry = entry.convert(*bibtex_filters) unless bibtex_filters.empty?
|
90
94
|
reference = CiteProc.process entry.to_citeproc,
|
91
|
-
:style =>
|
95
|
+
:style => style, :locale => config['locale'], :format => 'html'
|
92
96
|
|
93
97
|
content_tag reference_tagname, reference,
|
94
98
|
:id => [prefix, entry.key].compact.join('-')
|
95
99
|
end
|
96
100
|
|
101
|
+
def style
|
102
|
+
@style || config['style']
|
103
|
+
end
|
104
|
+
|
97
105
|
def missing_reference
|
98
106
|
config['missing_reference']
|
99
107
|
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: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|