gmni -j once gemini://gemini.conman.org/boston.gemini 2>/dev/null | sed 's/^=> /gemini:\/\/gemini.conman.org/g;s/ .*//g' | sed 's/^gem/gmni -j once gem/g;s/$/ 2>\/dev\/null/g' | bash | awk '{if($1=="#"){$1="<h1>";$0=$0"</h1>"}else if($1=="*"){$1="<li>";$0=$0"</li>"}else if($1=="=>"){$1="<a href=\""$2"\">";$0=$0"</a>"}else{$1="<p>";$0=$0"</p>"}{print$0}}' > t.html && pandoc -o t.epub t.html
2 years ago
gemini://gemini.conman.org/boston.gemini
"| bash |" LOL, that's a wide open security hole. ยท 2 years ago
Proof of concept gemini to epub as a one liner using conman.org as a test. Works. awk code to convert gmi to html stolen from https://codegolf.stackexchange.com/questions/220044/convert-gemtext-to-html ยท 2 years ago
https://codegolf.stackexchange.com/questions/220044/convert-gemtext-to-html