jekyll-scholar 5.2.0 → 5.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51a8804331ef6c1a5a8cc4a0ca30182a62075c02
4
- data.tar.gz: a40d1e5b874a5ca3daa7a35c2380d960c390b16c
3
+ metadata.gz: 6b11b64e0ba6bf6199e8b4e5e4b489a9d3c1989e
4
+ data.tar.gz: b5a415beb5298354fd23ec44edb977e25184b291
5
5
  SHA512:
6
- metadata.gz: f3b6a78238c288a6676b486964f68a407e97b5b3effeff523728e466a9a57e93f5f6abcfb379a1e2263d8d3e54186461bc5f8c1977f4de84d4a3b576c00bb95b
7
- data.tar.gz: c1306f57b0e70d6b4d823826e58f5655681f1e66c06c54012b103b75ed9f6b9b0ed3c7c2bc085f39fa6b5013af438c926319ce22382df51547db0ec2a731d4fb
6
+ metadata.gz: 91eb085592522dbcd80b422b7606acf3ae1caaeacc49805ea2550c820c8470dd68da6de09e6c8c3d2ddbccb45f5cb8faba40946ee07fa065e4a40513b59c3170
7
+ data.tar.gz: 2e38431f81fddc4a582dc33a6c35321206e67ebe8e2ff7ea9da532026eaa1e8a66a9d092f1c719df3611e7114782611d9fb02b80775a590a18a8a678b9749670
data/README.md CHANGED
@@ -55,6 +55,8 @@ default configuration is as follows:
55
55
 
56
56
  replace_strings: true
57
57
  join_strings: true
58
+
59
+ use_raw_bibtex_entry: false
58
60
 
59
61
  details_dir: bibliography
60
62
  details_layout: bibtex.html
@@ -76,6 +78,10 @@ The `source` option indicates where your bibliographies are stored;
76
78
  `bibliography` is the name of your default bibliography. For best results,
77
79
  please ensure that your Bibliography is encoded as ASCII or UTF-8.
78
80
 
81
+ The `use_raw_bibtex_entry` option will disable parsing of Liquid tags that
82
+ are embedded in the Bibtex fields. This option provides a way to circumvent
83
+ the problem that the double braces functionality of BibTex is accidentally
84
+ parsed by Liquid, while it was intended to keep the exact capitalization style.
79
85
 
80
86
  ### Bibliographies
81
87
 
@@ -276,6 +276,7 @@ Feature: BibTeX
276
276
  Given I have a scholar configuration with:
277
277
  | key | value |
278
278
  | bibliography_template | "{{entry.bibtex}}" |
279
+ | use_raw_bibtex_entry | true |
279
280
  And I have a "_bibliography" directory
280
281
  And I have a file "_bibliography/references.bib":
281
282
  """
@@ -287,7 +288,7 @@ Feature: BibTeX
287
288
  """
288
289
  ---
289
290
  ---
290
- {% bibliography -f references --raw_bibtex %}
291
+ {% bibliography -f references %}
291
292
  """
292
293
  When I run jekyll
293
294
  Then the _site directory should exist
@@ -29,6 +29,63 @@ Feature: Citations
29
29
  And the "_site/scholar.html" file should exist
30
30
  And I should see "Details</a>" in "_site/scholar.html"
31
31
 
32
+ @tags @bibliography @config @template @cite_details
33
+ Scenario: Raw bibtex template in details page
34
+ Given I have a scholar configuration with:
35
+ | key | value |
36
+ | source | ./_bibliography |
37
+ | bibliography_template | {{entry.bibtex}} |
38
+ | details_layout | details.html |
39
+ | use_raw_bibtex_entry | true |
40
+ And I have a "_bibliography" directory
41
+ And I have a file "_bibliography/references.bib":
42
+ """
43
+ @book{a,
44
+ title = {{'b' | prepend: 'a'}}
45
+ }
46
+ """
47
+ And I have a "_layouts" directory
48
+ And I have a file "_layouts/details.html":
49
+ """
50
+ ---
51
+ ---
52
+ {{ page.entry.bibtex }}
53
+ """
54
+ When I run jekyll
55
+ Then the _site directory should exist
56
+
57
+ And the "_site/bibliography/a.html" file should exist
58
+ And I should see "{{'b' | prepend: 'a'}}" in "_site/bibliography/a.html"
59
+ And I should not see "ab" in "_site/bibliography/a.html"
60
+
61
+ @tags @bibliography @config @template @cite_details
62
+ Scenario: Raw bibtex template in details page
63
+ Given I have a scholar configuration with:
64
+ | key | value |
65
+ | source | ./_bibliography |
66
+ | bibliography_template | {{entry.bibtex}} |
67
+ | details_layout | details.html |
68
+ And I have a "_bibliography" directory
69
+ And I have a file "_bibliography/references.bib":
70
+ """
71
+ @book{a,
72
+ title = {{'b' | prepend: 'a'}}
73
+ }
74
+ """
75
+ And I have a "_layouts" directory
76
+ And I have a file "_layouts/details.html":
77
+ """
78
+ ---
79
+ ---
80
+ {{ page.entry.bibtex }}
81
+ """
82
+ When I run jekyll
83
+ Then the _site directory should exist
84
+
85
+ And the "_site/bibliography/a.html" file should exist
86
+ And I should not see "{{'b' | prepend: 'a'}}" in "_site/bibliography/a.html"
87
+ And I should see "ab" in "_site/bibliography/a.html"
88
+
32
89
  @tags @cite_details
33
90
  Scenario: A Simple Cite Details Link With A Text Argument
34
91
  Given I have a scholar configuration with:
@@ -23,6 +23,7 @@ module Jekyll
23
23
  'details_dir' => 'bibliography',
24
24
  'details_layout' => 'bibtex.html',
25
25
  'details_link' => 'Details',
26
+ 'use_raw_bibtex_entry' => false,
26
27
 
27
28
  'bibliography_class' => 'bibliography',
28
29
  'bibliography_template' => '{{reference}}',
@@ -80,13 +80,9 @@ 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
87
83
  end
88
84
 
89
- argv = arguments.split(/(\B-[cCfqptTslomAR]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|raw_bibtex|))/)
85
+ argv = arguments.split(/(\B-[cCfqptTslomA]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|))/)
90
86
 
91
87
  parser.parse argv.map(&:strip).reject(&:empty?)
92
88
  end
@@ -182,7 +178,7 @@ module Jekyll
182
178
  end
183
179
 
184
180
  def raw_bibtex?
185
- !!@raw_bibtex
181
+ config['use_raw_bibtex_entry']
186
182
  end
187
183
 
188
184
  def repository?
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '5.2.0'.freeze
3
+ VERSION = '5.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scholar
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil