I wanted to make PR to add functionality to run additional filter after the recursive transclusion.
-- recursive transclusion
contents = pandoc.walk_block(
pandoc.Div(contents),
{ Header = update_last_level, CodeBlock = transclude }
).content
-- apply all filters if any
if filters then
for i,f in ipairs(filters) do
doc = pandoc.Pandoc(contents, metadata)
contents = utils.run_json_filter(doc, "pandoc").blocks
end
end
I wanted to make PR to add functionality to run additional filter after the recursive transclusion.
But I got stuck since it needs a more general
run_filter
function to run all sort of filters: See https://github.com/jgm/pandoc/issues/6830.Can this be done, or is there another approach around.
Application: I want some filters to be run which affect the transclusion of
include-files.lua
. Namely replacing variables inside the include blocks