pandoc: 未知 reader: gfm

pandoc: Unknown reader: gfm

我正在尝试在 Ubuntu 18.04 上使用 pandoc(版本 1.19.2.4)来呈现 github 风味降价:

pandoc --from gfm --to html README.md

这给出了错误 pandoc: Unknown reader: gfm

我想我需要 verify/install gfm,但不清楚如何做到这一点。

如何修复此错误?如何使用 pandoc 生成 github 风味降价?

您使用的是旧版本的 pandoc,您需要 pandoc 2.0 或更高版本。将 Ubuntu 更新为 sufficiently new version, or download a version from the latest release page.

你需要NEW PANDOC

我写了一个脚本,它将 getinstall 来自官方 github repo 的新 pandoc。

步骤 #1 - 下载:

wget https://github.com/jgm/pandoc/releases -O /tmp/pandocPage.html
urlPart=`grep "\.deb" /tmp/pandocPage.html | head -n 1 | cut -d'/' -f2-7 | cut -d'"' -f1`
wget "https://github.com/$urlPart" -O mypandoc.deb
rm /tmp/pandocPage.html           # remove junk

步骤 #2 - 安装 .deb 文件(通过 dpkg -i 命令):

sudo dpkg -i /tmp/mypandoc.deb
rm /tmp/mypandoc.deb              # remove junk

就是这样。