jekyll-scholar 3.0.0 → 3.0.1
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/README.md +4 -3
- data/features/string.feature +114 -0
- data/lib/jekyll/scholar/defaults.rb +1 -0
- data/lib/jekyll/scholar/utilities.rb +5 -0
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c8ccd2ac58af0bf1f408e492607526d4ecd8b5a
|
4
|
+
data.tar.gz: 6172bf565989e36b457cc3de16437a53fa02ecae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc5af627007cab164c6ea82c4628904b4819b6b55a08d1ac49723a9b5e1b895ac199e287b76535a67a5d78800188e697870d0a5fd3f01b521f43c7444c06749f
|
7
|
+
data.tar.gz: 568c21dd446843dfa6753713599b9bfd973a885b5f09fc1292cd2b3756e493bfdfa6add069f97889f648d7e103362adf0b60d6d7ef9153d5c304f05a4ae7af45
|
data/README.md
CHANGED
@@ -43,6 +43,7 @@ default configuration is as follows:
|
|
43
43
|
bibliography_template: "{{reference}}"
|
44
44
|
|
45
45
|
replace_strings: true
|
46
|
+
join_strings: true
|
46
47
|
|
47
48
|
details_dir: bibliography
|
48
49
|
details_layout: bibtex.html
|
@@ -260,13 +261,13 @@ You can cite multiple items in a single citation by referencing all ids
|
|
260
261
|
of the items you wish to quote separated by spaces. For example,
|
261
262
|
`{% cite ruby microscope %}` would produce a cite tag like:
|
262
263
|
|
263
|
-
<a href="#ruby">(Flanagan
|
264
|
+
<a href="#ruby">(Flanagan & Matsumoto 2008; Shaughnessy 2013)</a>
|
264
265
|
|
265
266
|
#### Page numbers and locators
|
266
267
|
|
267
268
|
If you would like to add page numbers to your citation, you can use the
|
268
269
|
`-l` or `--locator` option. For example, `{% cite ruby -l 23-5 %}` would
|
269
|
-
produce a citation like `(Matsumoto,
|
270
|
+
produce a citation like `(Matsumoto, 2008, pp. 23-5)`.
|
270
271
|
|
271
272
|
When quoting multiple items (see above) you can add multiple locators after
|
272
273
|
the list of ids. For example, `{% cite ruby microscope -l 2 -l 24 & 32 %}`.
|
@@ -462,7 +463,7 @@ License
|
|
462
463
|
|
463
464
|
Jekyll-Scholar is distributed under the same license as Jekyll.
|
464
465
|
|
465
|
-
Copyright (c) 2011-
|
466
|
+
Copyright (c) 2011-2014 [Sylvester Keil](http://sylvester.keil.or.at/)
|
466
467
|
|
467
468
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
468
469
|
of this software and associated documentation files (the 'Software'), to deal
|
@@ -0,0 +1,114 @@
|
|
1
|
+
Feature: String replacement
|
2
|
+
As a scholar who likes to blog
|
3
|
+
I want to publish my BibTeX bibliography on my blog
|
4
|
+
And make sure that strings are correctly substituted
|
5
|
+
|
6
|
+
@tags @string
|
7
|
+
Scenario: String replacement
|
8
|
+
Given I have a scholar configuration with:
|
9
|
+
| key | value |
|
10
|
+
| source | ./_bibliography |
|
11
|
+
And I have a "_bibliography" directory
|
12
|
+
And I have a file "_bibliography/references.bib":
|
13
|
+
"""
|
14
|
+
@string{ rubypl = "The Ruby Programming Language" }
|
15
|
+
@book{ruby,
|
16
|
+
title = rubypl,
|
17
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
18
|
+
year = {2008},
|
19
|
+
publisher = {O'Reilly Media}
|
20
|
+
}
|
21
|
+
"""
|
22
|
+
And I have a page "scholar.html":
|
23
|
+
"""
|
24
|
+
---
|
25
|
+
---
|
26
|
+
{% bibliography -f references %}
|
27
|
+
"""
|
28
|
+
When I run jekyll
|
29
|
+
Then the _site directory should exist
|
30
|
+
And the "_site/scholar.html" file should exist
|
31
|
+
And I should see "<i>The Ruby Programming Language</i>" in "_site/scholar.html"
|
32
|
+
|
33
|
+
@tags @string
|
34
|
+
Scenario: String replacement disabled
|
35
|
+
Given I have a scholar configuration with:
|
36
|
+
| key | value |
|
37
|
+
| source | ./_bibliography |
|
38
|
+
| replace_strings | false |
|
39
|
+
And I have a "_bibliography" directory
|
40
|
+
And I have a file "_bibliography/references.bib":
|
41
|
+
"""
|
42
|
+
@string{ rubypl = "The Ruby Programming Language" }
|
43
|
+
@book{ruby,
|
44
|
+
title = rubypl,
|
45
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
46
|
+
year = {2008},
|
47
|
+
publisher = {O'Reilly Media}
|
48
|
+
}
|
49
|
+
"""
|
50
|
+
And I have a page "scholar.html":
|
51
|
+
"""
|
52
|
+
---
|
53
|
+
---
|
54
|
+
{% bibliography -f references %}
|
55
|
+
"""
|
56
|
+
When I run jekyll
|
57
|
+
Then the _site directory should exist
|
58
|
+
And the "_site/scholar.html" file should exist
|
59
|
+
And I should see "<i>rubypl</i>" in "_site/scholar.html"
|
60
|
+
|
61
|
+
@tags @string
|
62
|
+
Scenario: Join strings
|
63
|
+
Given I have a scholar configuration with:
|
64
|
+
| key | value |
|
65
|
+
| source | ./_bibliography |
|
66
|
+
And I have a "_bibliography" directory
|
67
|
+
And I have a file "_bibliography/references.bib":
|
68
|
+
"""
|
69
|
+
@string{ ruby = "Ruby" }
|
70
|
+
@book{ruby,
|
71
|
+
title = "The " # ruby # " Programming Language",
|
72
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
73
|
+
year = {2008},
|
74
|
+
publisher = {O'Reilly Media}
|
75
|
+
}
|
76
|
+
"""
|
77
|
+
And I have a page "scholar.html":
|
78
|
+
"""
|
79
|
+
---
|
80
|
+
---
|
81
|
+
{% bibliography -f references %}
|
82
|
+
"""
|
83
|
+
When I run jekyll
|
84
|
+
Then the _site directory should exist
|
85
|
+
And the "_site/scholar.html" file should exist
|
86
|
+
And I should see "<i>The Ruby Programming Language</i>" in "_site/scholar.html"
|
87
|
+
|
88
|
+
@tags @string
|
89
|
+
Scenario: Join strings disabled
|
90
|
+
Given I have a scholar configuration with:
|
91
|
+
| key | value |
|
92
|
+
| source | ./_bibliography |
|
93
|
+
| join_strings | false |
|
94
|
+
And I have a "_bibliography" directory
|
95
|
+
And I have a file "_bibliography/references.bib":
|
96
|
+
"""
|
97
|
+
@string{ ruby = "Ruby" }
|
98
|
+
@book{ruby,
|
99
|
+
title = "The " # ruby # " Programming Language",
|
100
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
101
|
+
year = {2008},
|
102
|
+
publisher = {O'Reilly Media}
|
103
|
+
}
|
104
|
+
"""
|
105
|
+
And I have a page "scholar.html":
|
106
|
+
"""
|
107
|
+
---
|
108
|
+
---
|
109
|
+
{% bibliography -f references %}
|
110
|
+
"""
|
111
|
+
When I run jekyll
|
112
|
+
Then the _site directory should exist
|
113
|
+
And the "_site/scholar.html" file should exist
|
114
|
+
And I should see "<i>\"The \" # \"Ruby\" # \" Programming Language\"</i>" in "_site/scholar.html"
|
@@ -109,6 +109,7 @@ module Jekyll
|
|
109
109
|
bibtex_options
|
110
110
|
)
|
111
111
|
@bibliography.replace_strings if replace_strings?
|
112
|
+
@bibliography.join if join_strings? && replace_strings?
|
112
113
|
end
|
113
114
|
|
114
115
|
@bibliography
|
@@ -149,6 +150,10 @@ module Jekyll
|
|
149
150
|
config['replace_strings']
|
150
151
|
end
|
151
152
|
|
153
|
+
def join_strings?
|
154
|
+
config['join_strings']
|
155
|
+
end
|
156
|
+
|
152
157
|
def cited_only?
|
153
158
|
!!@cited
|
154
159
|
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: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- features/sorting.feature
|
97
97
|
- features/step_definitions/jekyll_steps.rb
|
98
98
|
- features/step_definitions/scholar_steps.rb
|
99
|
+
- features/string.feature
|
99
100
|
- features/support/env.rb
|
100
101
|
- features/support/hooks.rb
|
101
102
|
- jekyll-scholar.gemspec
|
@@ -147,6 +148,7 @@ test_files:
|
|
147
148
|
- features/sorting.feature
|
148
149
|
- features/step_definitions/jekyll_steps.rb
|
149
150
|
- features/step_definitions/scholar_steps.rb
|
151
|
+
- features/string.feature
|
150
152
|
- features/support/env.rb
|
151
153
|
- features/support/hooks.rb
|
152
154
|
has_rdoc:
|