mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-29 19:56:43 +00:00
The implicitly defined global filter (i.e. all element filtering
functions defined in the global lua environment) is used if no filter is
returned from a lua script. This allows to just write top-level
functions in order to define a lua filter. E.g
function Emph(elem) return pandoc.Strong(elem.content) end
7 lines
192 B
Lua
7 lines
192 B
Lua
function Doc (doc)
|
|
local meta = {}
|
|
local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" }
|
|
local blocks = { pandoc.Para(hello) }
|
|
return pandoc.Doc(blocks, meta)
|
|
end
|