Skip to content

Instantly share code, notes, and snippets.

@wonjun27
Forked from davisford/markdown-to-pdf.txt
Created October 24, 2015 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wonjun27/1aa6f2a61d0ac44b7b42 to your computer and use it in GitHub Desktop.
Save wonjun27/1aa6f2a61d0ac44b7b42 to your computer and use it in GitHub Desktop.
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
if (( $# != 2 ))
then
echo "Usage: md2pdf <input.md> <output.pdf>"
exit 1
fi
markdown $1 | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment