jekyll-scholar 5.1.0 → 5.2.0
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/features/bibtex.feature +23 -0
- data/features/cited_only.feature +0 -1
- data/features/details.feature +1 -1
- data/lib/jekyll/scholar/utilities.rb +24 -5
- 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: 51a8804331ef6c1a5a8cc4a0ca30182a62075c02
|
4
|
+
data.tar.gz: a40d1e5b874a5ca3daa7a35c2380d960c390b16c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b6a78238c288a6676b486964f68a407e97b5b3effeff523728e466a9a57e93f5f6abcfb379a1e2263d8d3e54186461bc5f8c1977f4de84d4a3b576c00bb95b
|
7
|
+
data.tar.gz: c1306f57b0e70d6b4d823826e58f5655681f1e66c06c54012b103b75ed9f6b9b0ed3c7c2bc085f39fa6b5013af438c926319ce22382df51547db0ec2a731d4fb
|
data/features/bibtex.feature
CHANGED
@@ -270,3 +270,26 @@ Feature: BibTeX
|
|
270
270
|
Then the _site directory should exist
|
271
271
|
And the "_site/scholar.html" file should exist
|
272
272
|
And I should see "<i>The Ruby Programming Language</i>. O’Reilly Media, 2008" in "_site/scholar.html"
|
273
|
+
|
274
|
+
@tags @bibliography @config @template
|
275
|
+
Scenario: Raw bibtex template
|
276
|
+
Given I have a scholar configuration with:
|
277
|
+
| key | value |
|
278
|
+
| bibliography_template | "{{entry.bibtex}}" |
|
279
|
+
And I have a "_bibliography" directory
|
280
|
+
And I have a file "_bibliography/references.bib":
|
281
|
+
"""
|
282
|
+
@book{ruby,
|
283
|
+
title = {The Ruby Programming Language}
|
284
|
+
}
|
285
|
+
"""
|
286
|
+
And I have a page "scholar.html":
|
287
|
+
"""
|
288
|
+
---
|
289
|
+
---
|
290
|
+
{% bibliography -f references --raw_bibtex %}
|
291
|
+
"""
|
292
|
+
When I run jekyll
|
293
|
+
Then the _site directory should exist
|
294
|
+
And the "_site/scholar.html" file should exist
|
295
|
+
And I should see "{%raw%}@book" in "_site/scholar.html"
|
data/features/cited_only.feature
CHANGED
@@ -70,7 +70,6 @@ Feature: Cited-only Bibliographies
|
|
70
70
|
And I should not see "<i>The Ruby Programming Language</i>" in "_site/scholar.html"
|
71
71
|
And I should not see "<i>Smalltalk Best Practice Patterns</i>" in "_site/scholar.html"
|
72
72
|
|
73
|
-
@wip
|
74
73
|
Scenario: Cited items with prefix
|
75
74
|
Given I have a scholar configuration with:
|
76
75
|
| key | value |
|
data/features/details.feature
CHANGED
@@ -209,7 +209,7 @@ Feature: Details
|
|
209
209
|
And the "_site/bibliography/august.html" file should exist
|
210
210
|
And I should see "month = aug" in "_site/bibliography/august.html"
|
211
211
|
|
212
|
-
@generators @parse_months
|
212
|
+
@generators @parse_months
|
213
213
|
Scenario: Month parsing can be turned off
|
214
214
|
Given I have a scholar configuration with:
|
215
215
|
| key | value |
|
@@ -80,9 +80,13 @@ module Jekyll
|
|
80
80
|
opts.on('-T', '--template TEMPLATE') do |template|
|
81
81
|
@bibliography_template = template
|
82
82
|
end
|
83
|
+
|
84
|
+
opts.on('-R', '--raw_bibtex') do |raw_bibtex|
|
85
|
+
@raw_bibtex = raw_bibtex
|
86
|
+
end
|
83
87
|
end
|
84
88
|
|
85
|
-
argv = arguments.split(/(\B-[
|
89
|
+
argv = arguments.split(/(\B-[cCfqptTslomAR]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|raw_bibtex|))/)
|
86
90
|
|
87
91
|
parser.parse argv.map(&:strip).reject(&:empty?)
|
88
92
|
end
|
@@ -177,6 +181,10 @@ module Jekyll
|
|
177
181
|
!!@suppress_author
|
178
182
|
end
|
179
183
|
|
184
|
+
def raw_bibtex?
|
185
|
+
!!@raw_bibtex
|
186
|
+
end
|
187
|
+
|
180
188
|
def repository?
|
181
189
|
!config['repository'].nil? && !config['repository'].empty?
|
182
190
|
end
|
@@ -287,10 +295,17 @@ module Jekyll
|
|
287
295
|
return missing_reference unless entry
|
288
296
|
|
289
297
|
liquid_template.render(
|
290
|
-
reference_data(entry,index)
|
291
|
-
|
292
|
-
|
293
|
-
|
298
|
+
reference_data(entry,index)
|
299
|
+
.merge(site.site_payload)
|
300
|
+
.merge({
|
301
|
+
'index' => index,
|
302
|
+
'details' => details_link_for(entry)
|
303
|
+
}),
|
304
|
+
{
|
305
|
+
:registers => { :site => site },
|
306
|
+
:filters => [Jekyll::Filters]
|
307
|
+
}
|
308
|
+
)
|
294
309
|
end
|
295
310
|
|
296
311
|
def reference_data(entry, index = nil)
|
@@ -322,6 +337,10 @@ module Jekyll
|
|
322
337
|
e['bibtex'] = tmp.to_s
|
323
338
|
end
|
324
339
|
|
340
|
+
if raw_bibtex?
|
341
|
+
e['bibtex'] = "{%raw%}#{e['bibtex']}{%endraw%}"
|
342
|
+
end
|
343
|
+
|
325
344
|
entry.fields.each do |key, value|
|
326
345
|
value = value.convert(*bibtex_filters) unless bibtex_filters.empty?
|
327
346
|
e[key.to_s] = value.to_s
|
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: 5.
|
4
|
+
version: 5.2.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:
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|