Last active
June 20, 2023 06:20
-
-
Save davisford/01b4eea0f1ddfb858d89 to your computer and use it in GitHub Desktop.
Convert Markdown to PDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install markdown htmldoc | |
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Doesn't seem to work well on my end for codeblocks. Pandoc solved this for me.