Skip to content

Commit

Permalink
pseudo citation number
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmsnr committed Dec 10, 2020
1 parent e1593af commit fdd3ed3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/review/book/bibliography.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,27 @@ def format(format)
end

def ref(key)
@citeproc.render(:citation, id: key)
cited = @citeproc.render(:citation, id: key)

# FIXME: need to apply CSL style
if cited == ''
idx = 1
@citeproc.bibliography.ids.each do |i|
if i == key
cited = "[#{idx}]"
break
end
idx += 1
end
end

cited
end

def list
@citeproc.bibliography.join
end

end
end
end

0 comments on commit fdd3ed3

Please sign in to comment.