1

I want to convert a Word document to Markdown, so I can use the result with Jekyll.

This works partially:

pandoc "in.docx" -f docx -t markdown -o "out.md"

However, pandoc doesn't generate a (YAML) Front Matter block, and I can't find a command line option to do this. Is this possible at all, or is it only available for Latex or other formats?

doekman
  • 18,750
  • 20
  • 65
  • 86

1 Answers1

1

In principle, the --standalone/-s flag should generate the YAML frontmatter. However, docx documents often don't contain machine readable metadata, and pandoc only tries to extract some basic data from the main text -- with varying success. So it's possible that there will no YAML block even when pandoc is called with -s.

tarleb
  • 19,863
  • 4
  • 51
  • 80
  • 1
    If the docx file contains metadata but pandoc doesn't handle it, please consider to open an issue at https://github.com/jgm/pandoc/issues – tarleb Apr 21 '21 at 12:14