Skip to content
Snippets Groups Projects
Unverified Commit 7dd9f0bf authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

doi volume + locale

parent 7d08c110
No related branches found
No related tags found
No related merge requests found
module WithCitations
extend ActiveSupport::Concern
def citation_apa(website: nil)
citation_for("apa", website: website)
def citation_apa(website: nil, locale: nil)
citation_for("apa", website: website, locale: locale)
end
def citation_iso690(website: nil)
citation_for("iso690-author-date-fr-no-abstract", website: website)
def citation_iso690(website: nil, locale: nil)
citation_for("iso690-author-date-fr-no-abstract", website: website, locale: locale)
end
def citation_mla(website: nil)
citation_for("modern-language-association", website: website)
def citation_mla(website: nil, locale: nil)
citation_for("modern-language-association", website: website, locale: locale)
end
protected
def citation_for(style, website: nil)
def citation_for(style, website: nil, locale: nil)
citeproc = to_citeproc(website: website)
processor = CiteProc::Processor.new style: style, format: 'text'
processor = CiteProc::Processor.new style: style, format: 'text', locale: locale
processor.import([citeproc])
processor.render(:bibliography, id: citeproc["id"]).first
end
......
......@@ -113,8 +113,10 @@ class Research::Journal::Paper < ApplicationRecord
{ "family" => person.last_name, "given" => person.first_name }
},
"URL" => website.url + Communication::Website::Permalink.for_object(self, website).computed_path,
"DOI" => doi.present? ? doi : nil,
"container-title" => journal.title,
"publisher" => university.name,
"volume" => volume&.number,
# "publisher" => university.name,
"keywords" => keywords,
"pdf" => pdf.attached? ? pdf.url : nil,
"month-numeric" => published_at.present? ? published_at.month.to_s : nil,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment