Search code examples
windowsconcatenationpandoc

How to concatenate multiple markdown files in a specific order in Windows


I can easily do this in LINUX using an includes.txt file:

pandoc -s $(cat includes.txt) -o index.html

where includes.txt contains:

file1.md
file3.md
file2.md

The problem is that I now have to do the equivalent in Windows and cannot figure out how to concatenate the Markdown files in the order specified in the includes.txt file and then pass this to Pandoc.

Any help is appreciated.


Solution

  • You could create a file defaults.yaml with the following content:

    input-files:
      - file1.md
      - file3.md
      - file2.md
    

    Then call pandoc with pandoc --defaults defaults.yaml ….