summaryrefslogtreecommitdiff
path: root/bin/any2qmd.sh
blob: 03d4f5f74c69a9c3d931fa2b2dd399f6a34ba9bb (plain)
  1. #!/bin/sh
  2. set -au
  3. INFILE=$1
  4. OUTFILE="$(dirname "$INFILE")/${2:-index.qmd}"
  5. if which -s quarto; then
  6. PANDOC="quarto pandoc"
  7. else
  8. PANDOC=pandoc
  9. fi
  10. $PANDOC --to commonmark+smart --wrap none "$INFILE" | perl -pe 's/ --- / -- /g; s/\\(?=['"'"'"])//g; s/^- / * /g;' > "$OUTFILE"