first draft of installing programs

This commit is contained in:
2026-07-11 16:52:50 -05:00
commit ef7a763d4b
6 changed files with 255 additions and 0 deletions

51
utils/rndrmarkdown Normal file
View File

@@ -0,0 +1,51 @@
#!/bin/bash
outfile="output.pdf"
display=false
identity=false # keep same filename, but append '.pdf'
# -o flag with argument for output file (default output.pdf)
# -i flag (short for identity) to simply add '.pdf' to the filename
# -d flag to automatically display the output file after rendering
while getopts "o:id" opt; do
case ${opt} in
o)
outfile=$OPTARG
;;
i)
identity=true
;;
d)
display=true
;;
esac
done
# remove all processed args
shift $((OPTIND - 1))
if [[ $1 == '' ]] ; then
echo "fatal: please provide an input file"
echo "usage: rndrmarkdown [-d] [-o <outfile>] infile.md"
echo "usage: rndrmarkdown [-d] [-i] infile.md"
exit 1
fi
infile=$1
if [ $identity = true ]; then
outfile="$1.pdf"
fi
echo "in $infile out $outfile display $display"
pandoc -s \
-V linkcolor:blue \
-V fontfamily:courier \
-V fontsize=12pt \
-V geometry:margin=0.85in \
-o "$outfile" "$infile"
if [[ $display == true ]] ; then
echo "opening $outfile..."
xdg-open $outfile
fi