local html = require'garkup.html'
local T = html.T
local prose = require'garkup.prose'
local function highlight(code, lang)
-- you'd better not already be using that file
local infile = assert(io.open("/tmp/highlighter_input","w"))
assert(infile:write(code))
local outhandle = assert(io.popen("highlight -f -S "..lang.." --inline-css --enclose-pre 0
end
function State.toplevel(self)
while self:remaining() do
mode_paragraphs(self)
end
return self.output
end
local function garkup(...)
local S = State.new(...)
return S:toplevel(), S
end
-- print(garkup(io.read"a")
return garkup