Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to persuade Pandoc to read definition lists in GitHub Flavored Markdown?

I am trying to automate conversion of a GitHub Pages site to LateX in order to produce a PDF. The Kramdown parser used by GHP understands the following definition list syntax:

term1
: definition1
term2
: definition 2

so definition lists formatted this way in Markdown show up correctly on GHP. However, Pandoc's --from=gfm flag does not understand this syntax, since it's not officially part of the GFM spec. I have tried:

--from=gfm+definition_lists

but the definition_lists extension appears to be ignored with from=gfm. I have also tried:

--from=markdown+definition_lists+attribute_headers

but that doesn't appear to understand Kramdown-style attribute headers (which I need in order to specify section IDs, because legacy text). Is there a way to get Pandoc to deliver the definition list behavior of Jekyll+Kramdown and attribute headers? Thanks.

like image 558
Greg Wilson Avatar asked Aug 30 '25 16:08

Greg Wilson


1 Answers

Try -f markdown_github+definition_lists. markdown_github is pandoc's legacy gfm parser. gfm is the new one, which just wraps the C library and so doesn't accept all the extensions.

like image 85
John MacFarlane Avatar answered Sep 02 '25 07:09

John MacFarlane