Pandoc: Converting markdown to HTML, syntax highlighter

那年仲夏 提交于 2019-12-03 11:53:07

Answer from comments, please edit before giving negative rating.

Solution

Pandoc does syntax highlighting automatically. You don't need an external extension.

Just be sure to use the -s flag so you get a standalane HTML file with the CSS needed for highlighting. You can also use the --highlight-style option to adjust the coloring scheme.

Note: These comments assume you're using the latest pandoc, 1.9.4.2.

When I add the -s option, I get this error message: pandoc -m -t -s slidy 7-functional-design.md -o 7-functional-design.hpart. I get the same error message if I try adding --highlight-style=haddock instead.

You want -s -t slidy instead of -t -s slidy.

slidy is the argument for the -t option and needs to come right after it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!