summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-02-07 21:11:17 +0100
committerJonas Smedegaard <dr@jones.dk>2024-02-07 21:11:17 +0100
commit7dac75b1988e56351ccc43676f553bf7f07b4d49 (patch)
treef5b2110f2ac4d194d6c2a0ea26bb7b8ff408ed0f
parentdad5d36e221d1828f63297cffefac7136f549aea (diff)
use intermediary file to please quarto
-rwxr-xr-xbin/any2qmd.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/any2qmd.sh b/bin/any2qmd.sh
index ea978b8..cbacf7b 100755
--- a/bin/any2qmd.sh
+++ b/bin/any2qmd.sh
@@ -12,4 +12,7 @@ else
PANDOC=pandoc
fi
-$PANDOC --to commonmark+smart --wrap none "$INFILE" | perl -pe 's/ --- / -- /g; s/\\(?=['"'"'"])//g; s/^- / * /g;' > "$OUTFILE"
+# 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"~