jekyll-scholar 5.1.0 → 5.2.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
  SHA1:
3
- metadata.gz: b89b319b1a74b70f0621b549f836794043944bd2
4
- data.tar.gz: 1ba365670b11446bd29302f562c7469bb350ff29
3
+ metadata.gz: 51a8804331ef6c1a5a8cc4a0ca30182a62075c02
4
+ data.tar.gz: a40d1e5b874a5ca3daa7a35c2380d960c390b16c
5
5
  SHA512:
6
- metadata.gz: b82a59ebcac27fc92d7f718249c3a3abc1af3dfc385ed499bd714adab3c48fccbbd761860da5dc9202cb7b7290d181302017a76afcb6eca7eedfe933e3d5cabc
7
- data.tar.gz: 36ce4960c6df747fb20102f79351d5103aa6052f0d773f9b56aac78edcd2218ae441d54e17daa929a6050f2ae696f868b3f9830b0eae6b9be8d8a8c77f36e381
6
+ metadata.gz: f3b6a78238c288a6676b486964f68a407e97b5b3effeff523728e466a9a57e93f5f6abcfb379a1e2263d8d3e54186461bc5f8c1977f4de84d4a3b576c00bb95b
7
+ data.tar.gz: c1306f57b0e70d6b4d823826e58f5655681f1e66c06c54012b103b75ed9f6b9b0ed3c7c2bc085f39fa6b5013af438c926319ce22382df51547db0ec2a731d4fb
@@ -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"
@@ -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 |
@@ -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 @wip
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-[cCfqptTslomA]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|))/)
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).merge({
291
- 'index' => index,
292
- 'details' => details_link_for(entry)
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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '5.1.0'.freeze
3
+ VERSION = '5.2.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: 5.1.0
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: 2015-11-05 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll