#!/bin/sh

echo "Converting to PDF…"

for file in *.md */*.md
do
  echo " converting $file"
  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