Write Pandoc lua-filter in MoonScript and compile to Lua on build
This commit is contained in:
11
pygments.moon
Normal file
11
pygments.moon
Normal 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
|
||||
Reference in New Issue
Block a user