#!/bin/sed -Ef # gmi2html: Sed script to convert text/gemini to html. # Based on v0.14.2 of the gemini spec. # # This script is dedicated to the public domain according to the terms of CC0: # https://creativecommons.org/publicdomain/zero/1.0/ # TODO: add meta charset header, I suppose, to ensure utf8? s/\&/\&/g s/"/\"/g s/\</g /^=?>/! s/>/\>/g /^=?>/ { :loop s/^((=?>).*)>/\1\>/ t loop } 1 { i\ \ h s/^#\s*// t title_set s/.*/Untitled/ :title_set s/.*/
/ s/^\* (.*)/