File: metatable-catch-all.lua

package info (click to toggle)
haskell-pandoc-lua-engine 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 732 kB
  • sloc: haskell: 4,518; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local num_inlines = 0

function catch_all(el)
  if el.tag and pandoc.Inline.constructor[el.tag] then
    num_inlines = num_inlines + 1
  end
end

function Pandoc(blocks, meta)
  return pandoc.Pandoc {
    pandoc.Para{pandoc.Str(num_inlines)}
  }
end

return {
  setmetatable(
    {Pandoc = Pandoc},
    {__index = function(_) return catch_all end}
  )
}