Commit 14b3fe22 authored by rmrf's avatar rmrf

fix option string argument for header

parent e5523526
...@@ -5,23 +5,24 @@ module Jekyll ...@@ -5,23 +5,24 @@ module Jekyll
include Scholar::Utilities include Scholar::Utilities
include ScholarExtras::Utilities include ScholarExtras::Utilities
attr_reader :type, :header, :arr_args
def initialize(tag_name, arguments, tokens) def initialize(tag_name, arguments, tokens)
super super
@config = Scholar.defaults.dup @config = Scholar.defaults.dup
@args = arguments.strip # Check for number of arguments.
puts "args:" @arr_args = arguments.strip.split(/\s+/)
puts @args.to_s @type= arr_args[0]
@header = arr_args[1]
end end
def render(context) def render(context)
set_context_to context set_context_to context
year_section = '' year_section = ''
opts = ['@' + @args,'@*[public!=no]'] opts = ['@' + @type,'@*[public!=no]']
# puts opts.to_s
#references = public_journal_entries.map do |entry|
references = get_entries(opts).map do |entry| references = get_entries(opts).map do |entry|
reference = '' reference = ''
ref = '' ref = ''
...@@ -54,25 +55,9 @@ module Jekyll ...@@ -54,25 +55,9 @@ module Jekyll
content_tag :br, reference content_tag :br, reference
end end
header = "<h1>" section_header = "<h1> #{@header} </h1>"
case @args
when 'book'
header << "Books"
when 'article'
header << "Journals"
when 'inproceedings'
header << "Refereed Conferences"
when 'techreport'
header << "Technical Reports"
when 'incollection'
header << "In Book Chapters"
end
header << "</h1>"
# puts header
references.insert(0,header) references.insert(0,section_header)
references.join("\n") references.join("\n")
end end
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