I think I may have figured it out
This commit is contained in:
12
pygments.lua
Normal file
12
pygments.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
function CodeBlock(block)
|
||||
if block.classes[1] == "moon" 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
|
||||
Reference in New Issue
Block a user