Last active
November 25, 2019 16:47
-
-
Save jb55/0a953cc7be08978698a0f581deeff889 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
PANDOC="pandoc --variable urlcolor=cyan" | |
usage () { | |
printf "usage: pdfnow file.md OR <file.md pdfnow markdown\n" >&2 | |
exit 1 | |
} | |
[ $# -eq 0 ] && usage | |
if [ -t 0 ]; then | |
[ $# -eq 0 ] && usage | |
$PANDOC "$1" -o /tmp/out.pdf | |
else | |
[ $# -eq 0 ] && usage | |
ext="$1" | |
$PANDOC -f "$ext" -o /tmp/out.pdf | |
fi | |
zathura /tmp/out.pdf &>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment