------------------------------------------------------------ #!/bin/bash # 2020-11-21 # gem2html.sh file.gmi > file.html filename="${1}" title="${filename##*/}" addr_pub="your-onion-site-hash-here.onion" cat <" in_pre=0 continue ;; (*) # emacs/eww chokes on '<>' in pre section? text=$(echo "$line" | sed -e 's/\</g' -e 's/>/\>/g') echo "$text" ;; esac fi if [[ $in_list -eq 0 && $in_pre -eq 0 ]] then case "${line}" in (\#[^#]*) text=$(echo "$line" | sed -e 's/^#[ ]*//') echo "${title} EOF OLDIFS=$IFS IFS='' # preserve (leading!) white space, e.g. in...in_list=0 in_pre=0 ( cat ${filename} && echo "") | while read line do if [ $in_list -eq 1 ] then case "${line}" in (\**) in_list=1 text=$(echo "$line" | sed -e 's/^[*][ ]*//') echo "${text} " ;; (*) in_list=0 # fall through into next case! echo " " esac elif [ $in_pre -eq 1 ] then case "${line}" in (\`\`\`*) echo "
" ;; (\**) in_list=1 text=$(echo "$line" | sed -e 's/^[*][ ]*//') echo "${text}
" ;; (*) : echo "${line}
" ;; esac fi done cat <EOF ------------------------------------------------------------
text/gemini
This content has been proxied by September (3851b).