#!/bin/bash # mpp - minion print to PDF # Like `ml / minion list`, but gets the markdown file ready to print # Will act on a maximum of four files. # Requires ~/Journal/journal.css for styling. # Creates .md.pdf files. year=`date +%Y` files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md") JOURNAL_CSS=$HOME/Journal/journal.css if [ ! -f $JOURNAL_CSS ]; then echo "Please create a CSS file at $JOURNAL_CSS and retry." exit 1 fi counter=0 for file in $files; do # echo $file md2pdf -i $file -o $file.pdf -c $JOURNAL_CSS counter=$((counter + 1)) if [ $counter -gt 4 ]; then echo "Aborting after 4 files." echo "The following files would have been processed..." echo $files exit 1 fi done