git.iko.soy/typeable/pandoc
on 2.0.2 help sign in
typeable/pandoc/tools/update-lua-docs.lua
32 lines 775 B history raw
1local in_module_section = false
3function pandoc_module_blocks()
4 local tmp_folder = os.tmpname()
5 os.remove(tmp_folder)
6 os.execute("mkdir -p " .. tmp_folder)
7 os.execute("ldoc -q -l tools -d " .. tmp_folder .. " data/pandoc.lua")
8 local module_file = io.open(tmp_folder .. "/index.html")
9 local module_html = module_file:read("*a")
10 local module_doc = pandoc.read(module_html, "html")
11 return module_doc.blocks
12end
14function Header (el)
15 if in_module_section then
16 if el.level == 1 then
17 in_module_section = false
18 return el
19 else
20 return {}
21 end
22 elseif el.identifier == "module-pandoc" then
23 in_module_section = true
24 return pandoc_module_blocks()
25 end
26end
28function Block (el)
29 if in_module_section then
30 return {}
31 end
32end