是否有外部(插件)包装pandoc http://johnmacfarlane.net/pandoc/文档转换器?我想通过pandoc运行LiveCode字段的内容,并将结果返回到LiveCode变量/字段中。 pandoc的一个突出用途是将markdown转换为HTML。也许在LiveCode中实现了这样的转换器?
降价实施列表:https://github.com/markdown/markdown.github.com/wiki/Implementations
答案 0 :(得分:1)
从你的问题中不清楚你是否真的只需要降价到HTML。如果这就是您所需的全部内容,请查看https://github.com/montegoulding/mergMarkdown
答案 1 :(得分:0)
Trevor DeVore在https://gist.github.com/trevordevore/5090459有一个降价库的GitHub存储库
由于pandoc是命令行实用程序,您应该可以通过以下方式调用它:
shell("pandoc -f markdown -t html yourinputfile")
如果你想把它包装成一个函数,应该可以做一些像
这样的事情function markDown2HTML pMarkDown pFromFormat pToFormat
put specialFolderPath("temporary") & "/pandocConvert" & the seconds into tTmpFile
put pMarkdown into URL "file:" & tTempFile
put shell("pandoc -f" && pFromFormat && "-t" && pToFormat" && tTempFile) into tHTML
delete file tTempFile
return tHTML
end markDown2HTML
注意:这是我脑海中写的,未经过实际的pandoc安装测试。