blob: cbacf7b8d85ce12ba7c004222bc611867739a6d4 (
plain)
- #!/bin/sh
- set -au
- INFILE=$1
- OUTFILE="$(dirname "$INFILE")/${2:-index.qmd}"
- if command -v quarto > /dev/null 2>&1; then
- PANDOC="quarto pandoc"
- else
- PANDOC=pandoc
- fi
- # use intermediary file (cannot use pipe with quarto wrapper)
- $PANDOC --to commonmark+smart --wrap none --output "$OUTFILE"~ "$INFILE"
- perl -pe 's/ --- / -- /g; s/\\(?=['"'"'"])//g; s/^- / * /g;' < "$OUTFILE"~ > "$OUTFILE"
- rm "$OUTFILE"~
|