pandoc: Unknown reader: gfm
Asked Answered
P

2

8

I'm trying to use pandoc (version 1.19.2.4) on Ubuntu 18.04 to render github flavoured markdown with:

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

This gives the error pandoc: Unknown reader: gfm.

I guess I need to verify/install gfm, but its not clear how to do this.

How do I fix this error? How do I use pandoc to generate github flavoured markdown?

Phallicism answered 22/5, 2019 at 8:7 Comment(1)
I was also able to get some results with pandoc 1.19.2.4 using -f markdown_github. However, as the pandoc documentation notes, that reader is deprecated. For example, it uses the same line breaks as the input Markdown file!Disposed
S
7

You are using an old version of pandoc, you'll need pandoc 2.0 or later. Either update Ubuntu to a sufficiently new version, or download a version from the latest release page.

Surmise answered 22/5, 2019 at 10:21 Comment(0)
B
1

You need NEW PANDOC.

I wrote a script, that will get and install new pandoc from official github repo.

Step #1 - Download:

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

Step #2 - Install .deb file (via dpkg -i command):

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

That's it.

Bickering answered 10/4, 2020 at 11:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.