#!/bin/bash if [[ "$1" == "" ]] then echo "Dateiname.md als Parameter fehlt" exit fi rumpf="${1%.*}" ext="${1##*.}" echo $rumpf . $ext [[ "$ext" == @(md|txt|markdown) ]] || (printf "Falsche, oder keine Erweiterung!\nMuss md oder txt sein\n"; exit;) pandoc -s -o "${rumpf}.html" "${1}" --toc --toc-depth=2 -H ~/Pfad/zu/doku.css -A ~/Pfad/zu/footer.txt firefox "${rumpf}.html" & chromium --headless --disable-gpu \ --run-all-compositor-stages-before-draw --print-to-pdf-no-header --no-margins \ --print-to-pdf=${rumpf}.pdf ${rumpf}.html