Add script to generate pdfs from MD using pandoc.

viewmd() now openes said generated pdf file if it exists.
This commit is contained in:
sheldonmlee 2021-10-22 00:13:22 +08:00
parent 7efe56c4b6
commit f62839bc3b

View File

@ -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
}