Skip to content

Commit

Permalink
Return an explicit list of filters, and add a version field
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Sep 17, 2024
1 parent 19ad257 commit e39e7b6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions _extensions/diagram/diagram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ See copyright notice in file LICENSE.
-- The filter uses the Figure AST element, which was added in pandoc 3.
PANDOC_VERSION:must_be_at_least '3.0'

local version = pandoc.types.Version '1.1.0'

-- Report Lua warnings to stderr if the `warn` function is not plugged into
-- pandoc's logging system.
if not warn then
Expand Down Expand Up @@ -548,9 +550,15 @@ local function code_to_figure (conf)
end
end

function Pandoc (doc)
local conf = configure(doc.meta, FORMAT)
return doc:walk {
CodeBlock = code_to_figure(conf),
return {
version = version,

{
Pandoc = function (doc)
local conf = configure(doc.meta, FORMAT)
return doc:walk {
CodeBlock = code_to_figure(conf),
}
end
}
end
}

0 comments on commit e39e7b6

Please sign in to comment.