# HG changeset patch # User Chris Cannam # Date 1501865479 -3600 # Node ID aba122ac2d40ef48cba8bfe9574d5dfb8a01767e # Parent 06ca2df3d7ca0a2ce7d404fc3d05a549702c638a Attempt (currently failing) to fix up the bibliography plugin for current version of citeproc diff -r 06ca2df3d7ca -r aba122ac2d40 Gemfile --- a/Gemfile Fri Aug 04 15:43:03 2017 +0100 +++ b/Gemfile Fri Aug 04 17:51:19 2017 +0100 @@ -9,10 +9,6 @@ gem "mime-types" gem "awesome_nested_set", "2.1.6" -#cc -- CiteProc v1.0.0 broke our citations (CiteProc.process returns nil). -# Until I've managed to work out what's up and fix that... -gem "citeproc", "0.0.6" - # Optional gem for LDAP authentication group :ldap do gem "net-ldap", "~> 0.3.1" diff -r 06ca2df3d7ca -r aba122ac2d40 extra/soundsoftware/vagranttest/provision.d/000-apt.sh --- a/extra/soundsoftware/vagranttest/provision.d/000-apt.sh Fri Aug 04 15:43:03 2017 +0100 +++ b/extra/soundsoftware/vagranttest/provision.d/000-apt.sh Fri Aug 04 17:51:19 2017 +0100 @@ -4,6 +4,7 @@ apt-get update && \ apt-get install -y \ + ack-grep \ apache2 \ apache2-dev \ apt-utils \ diff -r 06ca2df3d7ca -r aba122ac2d40 plugins/redmine_bibliography/Gemfile --- a/plugins/redmine_bibliography/Gemfile Fri Aug 04 15:43:03 2017 +0100 +++ b/plugins/redmine_bibliography/Gemfile Fri Aug 04 17:51:19 2017 +0100 @@ -1,3 +1,5 @@ gem 'bibtex-ruby' gem 'nokogiri' -gem 'citeproc-ruby' \ No newline at end of file +gem 'citeproc' +gem 'citeproc-ruby' +gem 'csl-styles' diff -r 06ca2df3d7ca -r aba122ac2d40 plugins/redmine_bibliography/app/models/publication.rb --- a/plugins/redmine_bibliography/app/models/publication.rb Fri Aug 04 15:43:03 2017 +0100 +++ b/plugins/redmine_bibliography/app/models/publication.rb Fri Aug 04 17:51:19 2017 +0100 @@ -101,7 +101,17 @@ end if style == :ieee - CiteProc.process(bib.to_citeproc, :style => :ieee, :format => :html) + 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 }" } + 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) else bibtex = bib.to_s :include => :meta_content bibtex.strip!