13 lines
387 B
Lua
13 lines
387 B
Lua
function CodeBlock(block)
|
|
if block.classes[1] == "moon" or block.classes[1] == "moonscript" then
|
|
local fname = os.tmpname()
|
|
local handle = io.open(fname, "w")
|
|
handle:write(block.text)
|
|
handle:close()
|
|
|
|
local p = io.popen(string.format("pygmentize -f html -l moonscript.py %s -x", fname))
|
|
local out = p:read("*a")
|
|
return pandoc.RawBlock("html", out)
|
|
end
|
|
end
|