@@ -1,49 +0,0 @@
1−local in_module_section = false
2−
3−-- Generate tmp folder
4−local tmp_folder = os.tmpname()
5−os.remove(tmp_folder)
6−os.execute("mkdir -p " .. tmp_folder)
7−
8−function extend(list1, list2)
9− for i = 1, #list2 do
10− list1[#list1 + 1] = list2[i]
11− end
12−end
13−
14−function module_blocks(module_filenames)
15− local blocks = {}
16− for _, filename in pairs(module_filenames) do
17− os.execute("ldoc -q -l tools -d " .. tmp_folder .. " " .. filename)
18− local module_file = io.open(tmp_folder .. "/index.html")
19− local module_html = module_file:read("*a")
20− local module_doc = pandoc.read(module_html, "html")
21− extend(blocks, module_doc.blocks)
22− end
23− return blocks
24−end
25−
26−function Header (el)
27− if in_module_section then
28− if el.level == 1 or
29− -- special case for Module pandoc
30− (el.level == 2 and el.identifier == 'helper-functions') then
31− in_module_section = false
32− return el
33− else
34− return {}
35− end
36− elseif el.identifier == "module-pandoc" then
37− in_module_section = true
38− return module_blocks{'data/pandoc.lua'}
39− elseif el.identifier == "module-pandoc.list" then
40− in_module_section = true
41− return module_blocks{'data/pandoc.List.lua'}
42− end
43−end
44−
45−function Block (el)
46− if in_module_section then
47− return {}
48− end
49−end