Commit 915226f2 authored by Sylvester Keil's avatar Sylvester Keil

Merge branch 'master' of https://github.com/elotroalex/jekyll-scholar into p137

parents c80e4a0f 1390162a
......@@ -25,18 +25,18 @@ Or add it to your `Gemfile`:
gem 'jekyll-scholar'
### Github Pages
Note that it is not possible to use this plugin with the
Note that it is not possible to use this plugin with the
[default Github pages workflow](https://help.github.com/articles/using-jekyll-with-pages/).
Github does not allow any but a few select plugins to run for security reasons,
and Jekyll-Scholar is not among them.
Github does not allow any but a few select plugins to run for security reasons,
and Jekyll-Scholar is not among them.
You will have to generate your site locally and push the results to the `master` resp. `gh-pages`
branch of your site repository.
You can keep sources, configuration and plugins in a separate branch; see e.g.
[here](http://davidensinger.com/2013/07/automating-jekyll-deployment-to-github-pages-with-rake/)
for details.
Usage
-----
......@@ -72,7 +72,7 @@ default configuration is as follows:
replace_strings: true
join_strings: true
use_raw_bibtex_entry: false
bibtex_filters:
- superscript
......@@ -394,9 +394,13 @@ will attempt to read the key `ruby` from file `/home/foo/bar.bib`. It will not
fallback to the default BibTeX file.
#### Citation pointing to another page in your site
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:
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, add a relative path to your scholar configurations:
~~~ yaml
scholar:
relative: "/relative/path/file.html"
~~~
{% cite ruby --relative bibliography.html %}
#### Multiple bibliographies within one document (like [multibib.sty](http://www.ctan.org/pkg/multibib))
......
......@@ -18,7 +18,7 @@ module Jekyll
module Utilities
attr_reader :config, :site, :context, :prefix, :text, :offset, :max, :relative
attr_reader :config, :site, :context, :prefix, :text, :offset, :max
......@@ -61,10 +61,6 @@ module Jekyll
@prefix = prefix
end
opts.on('-r', '--relative RELATIVE') do |relative|
@relative = relative.to_s.strip
end
opts.on('-t', '--text TEXT') do |text|
@text = text
end
......@@ -102,7 +98,7 @@ module Jekyll
end
end
argv = arguments.split(/(\B-[cCfqrptTsgGOlomA]|\B--(?:cited(_in_order)?|file|query|relative|prefix|text|style|group_(?:by|order)|type_order|template|locator|offset|max|suppress_author|))/)
argv = arguments.split(/(\B-[cCfqptTsgGOlomA]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|group_(?:by|order)|type_order|template|locator|offset|max|suppress_author|))/)
parser.parse argv.map(&:strip).reject(&:empty?)
end
......@@ -400,6 +396,10 @@ module Jekyll
File.join site.source, source
end
def relative
config['relative']
end
def reference_tag(entry, index = nil)
return missing_reference unless entry
......@@ -560,7 +560,7 @@ module Jekyll
def renderer(force = false)
return @renderer if @renderer && !force
@renderer = CiteProc::Ruby::Renderer.new :format => 'html',
:style => style, :locale => config['locale']
end
......@@ -598,8 +598,8 @@ module Jekyll
(context['citation_numbers'] ||= {})[key] ||= cited_keys.length
end
def link_target_for key
"#{base_url}#{relative}##{[prefix, key].compact.join('-')}"
def link_target_for(key)
"#{relative}##{[prefix, key].compact.join('-')}"
end
def cite(keys)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment