Commit 2ac4bd3c authored by rmrf's avatar rmrf

Add support for automatic generation of bibtex button

parent 5a8ecc19
Pipeline #31427 failed with stages
in 40 seconds
......@@ -114,6 +114,10 @@ module Jekyll
reference.insert(reference.rindex('</div>'), code_url.to_s )
end
# Generate the bibtex button
tex_bib = "<div class=\"pure-button csl-bibtex\"><a href=\"" + bibtex_link_for(entry).to_s + "\">BIBTEX</a></div>"
reference.insert(reference.rindex('</div>'), tex_bib.to_s )
content_tag config['bibliography_item_tag'], reference
content_tag "li class=\"" + render_ref_img(entry) + "\"", reference
}.join("\n")
......
......@@ -137,8 +137,13 @@ module Jekyll
reference.insert(reference.rindex('</div>'), code_url.to_s )
end
end
# Generate the bibtex button for all pubs
tex_bib = "<div class=\"pure-button csl-bibtex\"><a href=\"" + bibtex_link_for(entry).to_s + "\">BIBTEX</a></div>"
reference.insert(reference.rindex('</div>'), tex_bib.to_s )
# Content tag is dependent on type of article.
content_tag "li class=\"" + render_ref_img(entry) + "\"", reference
end
......
......@@ -60,6 +60,12 @@ module Jekyll
File.join(base, url)
end
# Generate a BibTeX link.
def bibtex_link_for(entry, base = base_url)
url=entry.key + ".bib"
return base + url
end
def split_reference(reference)
puts "## " + reference.to_s
# puts "\n"
......
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