Add script to generate pdfs from MD using pandoc.
viewmd() now openes said generated pdf file if it exists.
This commit is contained in:
parent
7efe56c4b6
commit
f62839bc3b
@ -78,6 +78,21 @@ viewmd()
|
|||||||
{
|
{
|
||||||
[ -z $1 ] && return
|
[ -z $1 ] && return
|
||||||
[ ! -f $1 ] && return
|
[ ! -f $1 ] && return
|
||||||
|
pdfname=$(basename $1 .md).pdf
|
||||||
|
echo $pdfname
|
||||||
|
if [ -f $pdfname ]; then
|
||||||
|
zathura $pdfname & disown
|
||||||
|
else
|
||||||
pandoc -t pdf $1 | zathura - & disown
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user