Skip to content

Instantly share code, notes, and snippets.

@Kazuma
Created September 21, 2012 07:38
Show Gist options
  • Save Kazuma/3760217 to your computer and use it in GitHub Desktop.
Save Kazuma/3760217 to your computer and use it in GitHub Desktop.
m2p - Convert to PDF from Markdown.
#!/bin/sh
#
# m2p
#
# Convert to PDF from Markdown.
#
# Example:
# $ m2p foo.md
# Config
marpet=`which marpet`
wkhtmltopdf=`which wkhtmltopdf`
temp_html=`mktemp /tmp/${markdown}.XXXXX.html`
# Generate PDF
markdown=$1
pdf=${markdown%%.*}.pdf
$marpet $markdown > $temp_html
$wkhtmltopdf $temp_html $pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment