Bash: convert Markdown to HTML

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 371
Joined: Tue Nov 12, 2013 2:05 am

Bash: convert Markdown to HTML

Post 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! :)
Post Reply