-- massaging @see references in the markdown source. -- (for a more elegant way of doing this, see seesubst.lua in the examples -- directory.) function markdown (file,tmp) local f = io.open (tmp,'w') for line in io.lines (file) do line = line:gsub('@see [%a%.]+',function(s) s = s:gsub('@see ','') local mod,fun = s:match('(.-%..-)%.(.+)') if not mod then mod = s end local res = '[see '..s..'](modules/'..mod..'.html' if fun then return res..'#'..fun..')' else return res..')' end end) f:write(line,'\n') end f:close() --PASOP: 'lua' os.execute ('lua ../../markdown.lua -s doc.css -l '..tmp) os.remove (tmp) end markdown ('doc.txt','index.txt') markdown ('luash.txt','examples.txt')