jekyll-scholar 5.2.0 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/features/bibtex.feature +2 -1
- data/features/cite_details.feature +57 -0
- data/lib/jekyll/scholar/defaults.rb +1 -0
- data/lib/jekyll/scholar/utilities.rb +2 -6
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b11b64e0ba6bf6199e8b4e5e4b489a9d3c1989e
|
4
|
+
data.tar.gz: b5a415beb5298354fd23ec44edb977e25184b291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/features/bibtex.feature
CHANGED
@@ -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
|
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:
|
@@ -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-[
|
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
|
-
|
181
|
+
config['use_raw_bibtex_entry']
|
186
182
|
end
|
187
183
|
|
188
184
|
def repository?
|