I think I may have figured it out

This commit is contained in:
2025-06-16 20:18:05 -07:00
parent d22283905a
commit 92a1650e75
6 changed files with 90 additions and 19 deletions

12
pygments.lua Normal file
View 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