summaryrefslogtreecommitdiff
path: root/bin/any2qmd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/any2qmd.sh')
-rwxr-xr-xbin/any2qmd.sh9
1 files changed, 9 insertions, 0 deletions
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"