improve slightly the gemini script

This commit is contained in:
Yann Esposito (Yogsototh) 2020-11-08 22:19:03 +01:00
parent 22e51c3564
commit a394cb0165
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
2 changed files with 3 additions and 3 deletions

View File

@ -2,8 +2,7 @@
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#\* ##;s#=> file:#=> #g' > "$dst"
./engine/org2gemini_step1.sh "$src" | perl -pe 's#\[\[([^]]*)\]\[([^]]*)\]\]#\n=> $1 $2#g;s#^\* *$##;s#=> file:#=> #g' > "$dst"

View File

@ -4,8 +4,9 @@ BEGIN { IGNORECASE=1; }
{ skip=0; }
/^#+(BEGIN|END)_SRC / { gsub(/(BEGIN|END)_SRC /,"```"); }
/^#+(BEGIN|END)_SRC /i { gsub(/#+(BEGIN|END)_SRC /,"```"); }
/^#\+TITLE: / { gsub(/^#[^:]*: /,"# "); }
/^ *:[a-zA-Z_0-9]*:/ { skip=1; }
/^\* / { gsub(/^\* /,"# "); }
/^\*\* / { gsub(/^\*\* /,"## "); }
/^\*\*\* / { gsub(/^\*\*\* /,"### "); }