Processing a single Markdown file to HTML:pandoc -f markdown -t html inputfile.mdAlthough I can use Pandoc like this to process individual Markdown files, I want to compile a list of selected Markdown files and process them to a single file.If I have some Markdown files:inputfile1.md, inputfile2.md, inputfile3.mdHow can I compile them and process them using Pandoc to a single output file?
How to compile a selection of Markdown documents
shell script;text processing;markdown
pandoc can take multiple input files. Just use:pandoc -s -o output.html input1.md input2.md input3.md-s tells pandoc to create a self-contained file (so it will contain <html></html> tags etc, rather than just generating a fragment). -o output.html specifies that output.html will be the output file. With the output file ending in .html, -t html is unnecessary - if you want to output to STDOUT, obviously keep it. After a little bit of testing, it seems that -f markdown isn't necessary even when using inputs without a file extension - either because it's the default markup that pandoc expects, or pandoc can detect what markup language is being used.You can, of course, use globs in order to type less:pandoc -s -o output.html input*.md