]> git.newer.systems - nvim.git/commitdiff
compiler main
authorTucker Johnson <tucker@newer.systems>
Fri, 22 Aug 2025 18:04:57 +0000 (14:04 -0400)
committerTucker Johnson <tucker@newer.systems>
Fri, 22 Aug 2025 18:04:57 +0000 (14:04 -0400)
scripts/compiler

index d86f4f48473af4bce200800b32772609243e52aa..932d2f45967d33cbc83623925d38ee512eae9dea 100755 (executable)
@@ -4,6 +4,7 @@ file="${1}"
 ext="${file##*.}"
 dir=${file%/*}
 base="${file%.*}"
+doubleExt="${base##*.}"
 
 cd "$dir" || exit 1
 
@@ -25,11 +26,10 @@ case "$ext" in
     h) sudo make install ;;
     java) javac -d classes "${file}" && java -cp classes "${base}" ;;
     m) octave "${file}" ;;
-    md) [ -x "$(command -v lowdown)" ] && \
-           lowdown --parse-no-intraemph "${file}" -Tms | groff -mpdfmark -ms -kept -T pdf > "${base}.pdf" || \
-           [ -x "$(command -v groffdown)" ] && \
-           groffdown -i "${file}" | groff -T pdf > "${base}.pdf" || \
-           pandoc -t ms --highlight-style="kate" -s -o "${base}.pdf" "${file}" ;;
+    md)
+        mstarget="$(getcomproot "${file}" || echo "${file}")"
+        cd "${mstarget%/*}"
+        preconv "${mstarget}" | soelim | refer -PS -e -p "$HOME/.local/share/groff/library.txt" | groff -U -ms -kept -dpaper=letter -T pdf > "${mstarget%.*}".pdf ;;
     org) emacs "${file}" --batch -u "${USER}" -f org-latex-export-to-pdf ;;
     py) python "${file}" ;;
     [rR]md) Rscript -e "rmarkdown::render('${file}', quiet=TRUE)" ;;