X-Git-Url: https://apps.delaporte.us/gitweb/minion.git/blobdiff_plain/b0a99650ee7c8239d28805550e0ff503f65db624..0a5652a2bb4c1a8add2e26b3580154a3c9d61606:/bin/mp?ds=inline diff --git a/bin/mp b/bin/mp index 823f3b4..98bd418 100755 --- a/bin/mp +++ b/bin/mp @@ -1,12 +1,22 @@ -#!/usr/bin/bash +#!/bin/bash +# mp - minion print +# Like `ml / minion list`, but gets the markdown file ready to print +# Will act on a maximum of four files. +# Creates .md.html files. +# Opends files in your $BROWSER or assumes firefox year=`date +%Y` files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md") +if [ -z ${BROWSER} ]; then + echo "BROWSER unset, defaulting to Firefox" + export BROWSER=firefox +fi + counter=0 for file in $files; do # echo $file - mdtohtml $file > $file.html - firefox $file.html + mdtohtml $file $file.html + $BROWSER $file.html counter=$((counter + 1)) if [ $counter -gt 4 ]; then echo "Aborting after 4 files."