changeset 1584:8b1dc5e31dbc dockerise

Fix citeproc rendering
author Chris Cannam
date Wed, 16 Aug 2017 16:57:51 +0100
parents 0dcd4f8c2b8a
children 37d4559a9fce
files plugins/redmine_bibliography/app/models/publication.rb
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/redmine_bibliography/app/models/publication.rb	Wed Aug 16 12:29:01 2017 +0100
+++ b/plugins/redmine_bibliography/app/models/publication.rb	Wed Aug 16 16:57:51 2017 +0100
@@ -101,17 +101,12 @@
     end
 
     if style == :ieee
-      citeproc = bib.to_citeproc
-      cite_id = citeproc["id"]
-      #!!! These warns should go once I've figured out why it's not rendering!
-      logger.warn { "rendering citation #{citeproc} with id #{ cite_id }" }
+      cite = bib.to_citeproc
+      cite_id = cite["id"]
       cp = CiteProc::Processor.new style: 'ieee', format: 'html'
-      cp.import citeproc
-      cp.render :bibliography, id: cite_id
-      logger.warn { "rendered" }
-      result
-
-#      CiteProc.process(bib.to_citeproc, :style => :ieee, :format => :html)
+      cp.import [cite]
+      texts = cp.render :bibliography, id: cite_id
+      texts[0]
     else
       bibtex = bib.to_s :include => :meta_content
       bibtex.strip!