Page 1 of 1

Bash: convert Markdown to HTML

Posted: Mon Oct 10, 2016 4:46 pm
by peter_b
The following one-liner in GNU/Linux BASH, makes use of the "markdown" command to convert all "*.txt" files in the current folder to HTML in the subfolder "html/":

Code: Select all

for f in *.txt; do markdown $f > html/$(basename "$f" '.txt').html; done
Have fun! :)