Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created November 27, 2010 16:27
Show Gist options
  • Select an option

  • Save matthewmccullough/718036 to your computer and use it in GitHub Desktop.

Select an option

Save matthewmccullough/718036 to your computer and use it in GitHub Desktop.
Convert a markdown file to an HTML file and give the same name but with HTML as the file extension.
#!/bin/bash
#Uses the brew or macports binaries of 'markdown'. Needs the 'markdown' executable on the $PATH.
INPUTFILE="$1"
OUTPUTFILE=`echo "$INPUTFILE" | sed "s/\.md/\.html/"`
echo Writing markdown file to \"$OUTPUTFILE\"
markdown.pl "$INPUTFILE" > "$OUTPUTFILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment