git.iko.soy/typeable/pandoc
on master help sign in
tools: delete Lua documentation helper cruft

The tools were useful to generate documentation from the Lua sources. However, most Lua functions are defined in Haskell, and the even documentation of functions written in Lua has been updated manually for quite a while now. The unused helper scripts, which have bit-rot to the point that they now produce broken links, are therefore removed.

commit9ffa8100d78dbb293e481c50f39e8781f19b0a5c authorAlbert Krewinkel <albert@zeitkraut.de> dateFri 13 Mar 2020, 14:11 (7 years ago) parent24da280
3 files changed−95
Makefile−8 tools/ldoc.ltp−38 tools/update-lua-docs.lua−49
Makefile−8
@@ -113,14 +113,6 @@ man/pandoc.1: MANUAL.txt man/pandoc.1.before man/pandoc.1.after
113113 --variable footer="pandoc $(version)" \
114114 -o $@
115115
116−doc/lua-filters.md: tools/ldoc.ltp data/pandoc.lua tools/update-lua-docs.lua
117− cp $@ $@.tmp
118− pandoc -t markdown --columns=64 --atx-headers \
119− -f markdown -t markdown --standalone\
120− --lua-filter tools/update-lua-docs.lua \
121− -o $@ $@.tmp
122− rm $@.tmp
123−
124116README.md: README.template MANUAL.txt tools/update-readme.lua
125117 pandoc --lua-filter tools/update-readme.lua --reference-links \
126118 --reference-location=section -t gfm $< -o $@
tools/ldoc.ltpdeleted−38
@@ -1,38 +0,0 @@
1−# local iter = ldoc.modules.iter
2−# local M = ldoc.markup
3−
4−<h1>Module $(module.name)</h1>
5−
6−<p>$(M(module.summary))</p>
7−
8−# for kind, items in module.kinds() do
9−
10−<h2>$(kind)</h2>
11− <dl>
12−# for item in items() do ldoc.item = item -- provides context for M()
13− <dt><span id="$(item.name)"><code>$(ldoc.display_name(item))</code></span></dt>
14− <dd>
15− <p>$(item.summary)</p>
16−# if item.params and #item.params > 0 then
17− $(module.kinds:type_of(item).subnames):
18− <dl>
19−# for p in iter(item.params) do
20− <dt><code>$(p)</code>:</dt>
21− <dd>$(M(item.params.map[p]))</dd>
22−# end -- for
23− </dl>
24−# end -- if params
25−# if item.ret then
26− <p>Returns: $(item.ret[1])</p>
27−# end -- if returns
28−# if item.usage then
29− <p>Usage:</p>
30− <pre><code>$(item.usage[1])</code></pre>
31−# end -- if usage
32−# if item.see then
33− See also: <a href="#$(item.see[1].label)">$(item.see[1].label)</a>
34−
35−# end -- if see
36−# end -- for items
37− </dl>
38−# end -- for kinds
tools/update-lua-docs.luadeleted−49
@@ -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