Created
April 2, 2021 12:45
-
-
Save marekkowalczyk/1e2b3062704f6afd5a98d39895798cdc to your computer and use it in GitHub Desktop.
Convert markdown to pdf with same filename and open the pdf
This file contains hidden or 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 | |
# Convert markdown to pdf with same filename and open the pdf | |
for file in "$@"; do | |
filename="${file%.*}" | |
extension="${file##*.}" | |
echo "$file" "->" "$filename".pdf | |
pandoc -f markdown -t pdf -o "$filename".pdf "$file" | |
open "$filename".pdf | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment