Skip to content

Commit

Permalink
@citation_formats can be overridden in local_env.yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
Genia Kazymova committed Jun 24, 2024
1 parent 33bc0ad commit d2dfa29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
9 changes: 5 additions & 4 deletions config/locales/trln_argon.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ en:

citation:
apa: "APA"
mla: "MLA"
chicago: "Chicago (Author-Date)"
harvard: "Harvard"
turabian: "Turabian"
modern-language-association: "MLA"
chicago-fullnote-bibliography: "Chicago (Author-Date)"
harvard-cite-them-right: "Harvard"
turabian-fullnote-bibliography: "Turabian"

19 changes: 1 addition & 18 deletions lib/trln_argon/solr_document/citation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,7 @@ def process_citations(bibliography, citation_hash)
processor = CiteProc::Processor.new(style: style, format: 'html')
processor.import(bibliography.to_citeproc)
citation = processor.render(:bibliography, id: bibliography.first.id).first
citation_hash[format_display_name(format)] = citation
end
end

def format_display_name(format)
case format
when 'apa'
'apa'
when 'modern-language-association'
'mla'
when 'chicago-fullnote-bibliography'
'chicago'
when 'harvard-cite-them-right'
'harvard'
when 'turabian-fullnote-bibliography'
'turabian'
else
format
citation_hash[format] = citation
end
end

Expand Down

0 comments on commit d2dfa29

Please sign in to comment.