Markdown to docx, including complex template

后端 未结 4 979
温柔的废话
温柔的废话 2020-12-22 17:01

I have automated my build to convert Markdown files to DOCX files using Pandoc. I have even used a reference document for the final document\'s styling. The command I use is

4条回答
  •  感动是毒
    2020-12-22 17:54

    UPDATE: this feature is incomplete

    I used it on some complex templates, and found it mapped the fonts, company logos, etc very well. But going .docx -> .docx, I had to manually apply Heading styles to the chapter / section breaks. The font was correct, but the sectioning wasn't. I'll try .md -> .docx next.


    This feature is now available in Pandoc, as described here:

    Markdown to docx, including complex template

    From the link above:

    pandoc  input --reference-docx=my-reference.docx -o out.docx
    

    where my-reference.docx (n.b. not a .dotx) can be:

    • the current folder OR
    • a folder which is defined by --data-dir OR
    • the system default folder for data-dir which is
      • $HOME/.pandoc on UNIX-like systems
      • C:\Documents And Settings\USERNAME\Application Data\pandoc on Windows XP you should not use any more
      • C:\Users\USERNAME\AppData\Roaming\pandoc on Windows Vista or later.

提交回复
热议问题