Can someone help me to write a lua filter that runs over all div in a html page, extracts the one with class "bibliographie" and insert the processed bibliography (content of index.bib) ?
I've tried that, but I'm nowhere near where I want to be. Many thanks in advance !
part of YAML :
bibliography: index.bib
part of template.html :
<div class="bibliographie">
<h2 class="sources-def-bib-title">Bibliographie</h2>
</div>
and my lua script :
function Pandoc(doc)
local hblocks = {}
for i,el in pairs(doc.blocks) do
if (el.t == "Div" and el.classes[1] == "bibliographie") then
table.insert(meta.bibliography, value)
end
end
return pandoc.Pandoc(hblocks, doc.meta)
end
EDIT
we are developing an R package and here are the pandoc_args we used :
pandoc_args <- c(pandoc_metadata_arg("lang", "fr"), pandoc_args)
# use the non-breaking space pandoc lua filter
pandoc_args <- c(nbsp_filter_pandoc_args(), pandoc_args)
# hyphenations
pandoc_args <- c(pandoc_metadata_arg("hyphenopoly"), pandoc_args)