improved gemini gen script

This commit is contained in:
Yann Esposito (Yogsototh) 2020-11-08 23:54:52 +01:00
parent 301f394066
commit e51b71685f
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
2 changed files with 3 additions and 2 deletions

View file

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

View file

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