Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Systematic way to convert multiple markdown files to html

obtained from atom/markdown-preview#289

Yep, have a look at or markdown-it

It now depends, whether you want to merge the HTMl files or not:

# Single output files
for f in *.md ; do pandoc ${f} -f markdown -t html -s -o ${f}.html  ; done
# One output file
pandoc *.md -f markdown -t -s html -o merged.html

There are other ways to do it recursively according to

You can run this in the parent directory in the terminal

find ./ -iname "*.md" -type f -exec sh -c 'pandoc "${0}" -o "${}.pdf"' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment