From 94aeeae54fd6c930bbfbeeb5377763c1d1b20f95 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 4 Feb 2024 21:06:08 +0100 Subject: add script any2qmd.sh --- bin/any2qmd.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 bin/any2qmd.sh (limited to 'bin') diff --git a/bin/any2qmd.sh b/bin/any2qmd.sh new file mode 100755 index 0000000..93112a1 --- /dev/null +++ b/bin/any2qmd.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -au + +INFILE=$1 + +OUTFILE="$(dirname "$INFILE")/${2:-index.qmd}" + +pandoc --to commonmark+smart --wrap none "$INFILE" | perl -pe 's/ --- / -- /g; s/\\(?=['"'"'"])//g; s/^- / * /g;' > "$OUTFILE" -- cgit v1.2.3