diff --git a/.custom_bash_scripts b/.custom_bash_scripts index 2c81b3f..ab7f909 100644 --- a/.custom_bash_scripts +++ b/.custom_bash_scripts @@ -78,6 +78,21 @@ viewmd() { [ -z $1 ] && return [ ! -f $1 ] && return - pandoc -t pdf $1 | zathura - & disown + pdfname=$(basename $1 .md).pdf + echo $pdfname + if [ -f $pdfname ]; then + zathura $pdfname & disown + else + pandoc -t pdf $1 | zathura - & disown + fi } +# generate markdown files from markdown +makemd() +{ + [ -z $1 ] && return + [ ! -f $1 ] && return + pandoc -t pdf $1 -o $(basename $1 .md).pdf +} + +