Write Pandoc lua-filter in MoonScript and compile to Lua on build

This commit is contained in:
2025-06-16 20:18:05 -07:00
parent 46aa6c829f
commit 895ef13d73
4 changed files with 32 additions and 16 deletions

11
pygments.moon Normal file
View File

@@ -0,0 +1,11 @@
CodeBlock: (block) ->
if block.classes[1] == "moon" or block.classes[1] == "moonscript"
fname = os.tmpname!
with io.open fname, "w"
\write block.text
\close!
p = io.popen ("pygmentize -f html -l moonscript.py %s -x")\format fname
out = p\read"*a"
pandoc.RawBlock "html", out