jekyll-scholar 5.4.1 → 5.5.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 +5 -0
- data/features/details.feature +1 -1
- data/lib/jekyll/scholar/generators/details.rb +1 -1
- data/lib/jekyll/scholar/utilities.rb +15 -4
- 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: 8e87d0e6fcb91e60fdbd782fda327d0c6be06eae
|
4
|
+
data.tar.gz: 812005cac2d21455d371b1bb1674abc825aa6a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2050f5a46c83b8ef0321f5113ce343b56167bdd4bc2a1b765f401bcc23da5095e1e83ef57bf189d77d3dcb54148c69762907d01bfdd174475850b79189b6d503
|
7
|
+
data.tar.gz: a40c832f357c6489c83f74da9dfbf0bc9b1b4986a04c1cce612695021aa4435d3d11ef047a19eb09c4f7a8d74f9159f1ddf0e8fefac7187dc512402554a2e220
|
data/README.md
CHANGED
@@ -384,6 +384,11 @@ a specific page. As an example, the tag
|
|
384
384
|
will attempt to read the key `ruby` from file `/home/foo/bar.bib`. It will not
|
385
385
|
fallback to the default BibTeX file.
|
386
386
|
|
387
|
+
#### Citation pointing to another page in your site
|
388
|
+
In some cases, you might want your citation to link to another page on your cite (ex. a separate works cited page). As a solution, Jekyll-Scholar provides the `--relative` tag. For example, if you wanted the link to point to an ID in a bibliography.html page, you would use:
|
389
|
+
|
390
|
+
{% cite ruby --relative bibliography.html %}
|
391
|
+
|
387
392
|
#### Multiple bibliographies within one document (like [multibib.sty](http://www.ctan.org/pkg/multibib))
|
388
393
|
|
389
394
|
When you have multiple `{% bibliography %}` sections in one file,
|
data/features/details.feature
CHANGED
@@ -3,7 +3,7 @@ Feature: Details
|
|
3
3
|
I want to publish my BibTeX bibliography on my blog
|
4
4
|
And I want Jekyll to generate detail pages for all the entries in my bibliography
|
5
5
|
|
6
|
-
@generators
|
6
|
+
@generators
|
7
7
|
Scenario: A bibliography with a single entry
|
8
8
|
Given I have a scholar configuration with:
|
9
9
|
| key | value |
|
@@ -17,7 +17,10 @@ module Jekyll
|
|
17
17
|
# #site readers
|
18
18
|
module Utilities
|
19
19
|
|
20
|
-
|
20
|
+
|
21
|
+
attr_reader :config, :site, :context, :prefix, :text, :offset, :max, :relative
|
22
|
+
|
23
|
+
|
21
24
|
|
22
25
|
def split_arguments(arguments)
|
23
26
|
|
@@ -52,12 +55,16 @@ module Jekyll
|
|
52
55
|
|
53
56
|
opts.on('-q', '--query QUERY') do |query|
|
54
57
|
@query = query
|
55
|
-
end
|
58
|
+
end
|
56
59
|
|
57
60
|
opts.on('-p', '--prefix PREFIX') do |prefix|
|
58
61
|
@prefix = prefix
|
59
62
|
end
|
60
63
|
|
64
|
+
opts.on('-r', '--relative RELATIVE') do |relative|
|
65
|
+
@relative = relative
|
66
|
+
end
|
67
|
+
|
61
68
|
opts.on('-t', '--text TEXT') do |text|
|
62
69
|
@text = text
|
63
70
|
end
|
@@ -83,7 +90,7 @@ module Jekyll
|
|
83
90
|
end
|
84
91
|
end
|
85
92
|
|
86
|
-
argv = arguments.split(/(\B-[
|
93
|
+
argv = arguments.split(/(\B-[cCfqrptTslomA]|\B--(?:cited(_in_order)?|file|query|relative|prefix|text|style|template|locator|offset|max|suppress_author|))/)
|
87
94
|
|
88
95
|
parser.parse argv.map(&:strip).reject(&:empty?)
|
89
96
|
end
|
@@ -567,6 +574,10 @@ module Jekyll
|
|
567
574
|
(context['citation_numbers'] ||= {})[key] ||= cited_keys.length
|
568
575
|
end
|
569
576
|
|
577
|
+
def link_target_for key
|
578
|
+
"#{relative}##{[prefix, key].compact.join('-')}"
|
579
|
+
end
|
580
|
+
|
570
581
|
def cite(keys)
|
571
582
|
items = keys.map do |key|
|
572
583
|
if bibliography.key?(key)
|
@@ -577,7 +588,7 @@ module Jekyll
|
|
577
588
|
end
|
578
589
|
end
|
579
590
|
|
580
|
-
link_to
|
591
|
+
link_to link_target_for(keys[0]), render_citation(items)
|
581
592
|
end
|
582
593
|
|
583
594
|
def cite_details(key, text)
|
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.5.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: 2016-01-
|
11
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|