diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-07-16 09:32:41 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-07-16 09:32:41 -0700 |
commit | 2a881541a04d3aef04dbfb313afbcce576780ee3 (patch) | |
tree | edb03aa1981b8806e0b7a487d69e8bc4334a5a8f /data | |
parent | 1bff443ac9b02139c00ebeafd8e5cc910d7bee9e (diff) | |
download | pandoc-2a881541a04d3aef04dbfb313afbcce576780ee3.tar.gz |
Made Citation information available in lua custom writer.
Diffstat (limited to 'data')
-rw-r--r-- | data/sample.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/data/sample.lua b/data/sample.lua index a0c3c29a2..486f300e3 100644 --- a/data/sample.lua +++ b/data/sample.lua @@ -181,8 +181,13 @@ function Span(s, attr) return "<span" .. attributes(attr) .. ">" .. s .. "</span>" end -function Cite(s) - return "<span class=\"cite\">" .. s .. "</span>" +function Cite(s, cs) + local ids = {} + for _,cit in ipairs(cs) do + table.insert(ids, cit.citationId) + end + return "<span class=\"cite\" data-citation-ids=\"" .. table.concat(ids, ",") .. + "\">" .. s .. "</span>" end function Plain(s) |