her.esy.fun/engine/org2gemini.sh
Yann Esposito (Yogsototh) 67112b0974
improved hacky gemini script
2020-11-09 11:46:18 +01:00

11 lines
292 B
Bash
Executable file

#!/usr/bin/env bash
cd "$(git rev-parse --show-toplevel)" || exit 1
src="$1"
dst="$2"
./engine/org2gemini_step1.sh "$src" | \
perl -pe 's#\[\[([^]]*)\]\[([^]]*)\]\]#\n=> $1 $2#g;s#=> file:([^ ]*)\.org#=> $1.gmi#g;s#\[\[(file:)?([^]]*)\]\]#=> $2#g;' | \
perl -pe 's#^\* *\n##' > "$dst"