git.iko.soy/typeable/pandoc
on 2.7.2 help sign in
typeable/pandoc/tools/update-readme.lua
22 lines 616 B history raw
1-- update README.md based on MANUAL.txt
2-- inserts contents of input-formats and output-formats
4local f = assert(io.open("MANUAL.txt", "r"))
5local manual = f:read("*all")
6mdoc = pandoc.read(manual, "markdown")
7f:close()
8result = {}
10function Div(elem)
11 local ident = elem.identifier or ""
12 local get = function(el)
13 if el.identifier == ident then
14 result = el
15 end
16 end
17 if ident == 'input-formats' or ident == 'output-formats' then
18 pandoc.walk_block(pandoc.Div(mdoc.blocks), { Div = get })
19 return result
20 end
21end