drive/scripts/md_to_pdf.sh

14 lines
329 B
Bash
Raw Permalink Normal View History

2020-10-11 20:04:51 +02:00
#!/bin/sh
2020-10-11 20:32:45 +02:00
echo "Converting to PDF…"
2020-10-11 20:04:51 +02:00
for file in *.md */*.md
2020-10-11 20:32:45 +02:00
do
2020-10-11 20:04:51 +02:00
echo " converting $file"
2020-10-11 20:32:45 +02:00
output_path=$(echo "$file" | sed '$s/\.md$/.pdf/')
echo " $output_path"
output_name=$(echo "$file" | sed '$s/\.md$/.pdf/')
echo " $output_name"
pandoc "$file" -f markdown -t pdf -o "$output_path" -s --data-dir=./
done