Commit 119587ff authored by Carlos Pérez-Penichet's avatar Carlos Pérez-Penichet
Browse files

Added option to select style in bibliography tag

Added an option (-s/--style) to allow to select
the style in every invocation of the bibliography
tag individually.
parent c03334bc
...@@ -32,9 +32,13 @@ module Jekyll ...@@ -32,9 +32,13 @@ module Jekyll
opts.on('-t', '--text TEXT') do |text| opts.on('-t', '--text TEXT') do |text|
@text = text @text = text
end end
opts.on('-s', '--style STYLE') do |style|
@style = style
end end
argv = arguments.split(/(\B-[cfqpt]|\B--(?:cited|file|query|prefix|text))/) argv = arguments.split(/(\B-[cfqpts]|\B--(?:cited|file|query|prefix|text|style|))/)
parser.parse parser.parse
end end
...@@ -88,12 +92,16 @@ module Jekyll ...@@ -88,12 +92,16 @@ module Jekyll
entry = entry.convert(*bibtex_filters) unless bibtex_filters.empty? entry = entry.convert(*bibtex_filters) unless bibtex_filters.empty?
reference = CiteProc.process entry.to_citeproc, reference = CiteProc.process entry.to_citeproc,
:style => config['style'], :locale => config['locale'], :format => 'html' :style => style, :locale => config['locale'], :format => 'html'
content_tag reference_tagname, reference, content_tag reference_tagname, reference,
:id => [prefix, entry.key].compact.join('-') :id => [prefix, entry.key].compact.join('-')
end end
def style
@style || config['style']
def missing_reference def missing_reference
config['missing_reference'] config['missing_reference']
end end
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