). Blank lines -- indicate paragraph boundaries (empty comment lines count as blank -- lines). -- -- * Within a paragraph, the following markup is supported: -- -- _word_ : italics -- *word* : boldface -- ``...text...`` : code (monospaced) -- -- * Lines beginning with multiple "#" become headers ("##" -> H3, "###" -> -- H2, "####" -> H1). Yes this is backwards from atx format, but THIS is -- the right way. :-) -- -- * Other lines are grouped into lit blocks:
/ "..c.."" (!"``" .)* "``"->"
"
/ x
& d", markExp:match("_b_ *c* ``x`` & d"))
expect('txt', markExp:match("[txt](x)"))
local markDefs = {
ls = ls,
parg = function (c) return "
" end,
lit = function (c) return "\n"
for _,e in ipairs(t) do
local eo = e[1]:gsub("%$%$","$")
s = s .. "
"
end,
mark = mark
}
local fileExp = re.compile(fileRE, markDefs)
local template = [[
]]
local function makedown(txt)
return template:gsub("<(%w+)>", {
MARK = table.concat(fileExp:match(txt), "\n\n"),
})
end
------------------------------------------------------------------------
local narg = 0
local function nextArg()
narg = narg + 1
return arg[narg]
end
local files = {}
local nameOut
for a in nextArg do
if a == "--templ" then
ftempl = nextArg()
elseif a == "-o" then
nameOut = nextArg()
else
table.insert(files,a)
end
end
if files[2] or not files[1] then
print("usage: "..arg[0].." \n"
s = s .. ""..e[2].." \n"
end
return s.."→ "
s = s .. "\""..eo.."\"