#!/bin/dash
if type mdview > /dev/null; then
	FILE="$(readlink -f "$1")"
	DIR="${FILE%/*}"
	FILE="${FILE##*/}"
	TITLE="${FILE%.*}"
	thisHOME="$FILE"

	case "$FILE" in
	 README*)
	  TITLE=${1%.*}
	  ;;
	esac

	exec mdview "$DIR"/"$FILE" "$thisHOME" "$TITLE" 
else
	exec defaulttexteditor "$1"
fi
