gophermap -> text/gemini converter

James Tomasino tomasino at lavabit.com
Sat May 30 22:53:06 BST 2020


There was an offhand request for a converter from gophermap to the
native text/gemini format in the IRC channel. I had an awk script
written already to parse gophermaps, so I made some quick adjustments
and can share the results here:

https://github.com/jamestomasino/dotfiles-minimal/blob/master/bin/gophermap2gemini.awk

Currently it detects html links, telnet links, and remaining linkable
gopher types and formats those into the => link pattern. I am checking
URLs for spaces and escaping those, since spaced URLs do actually work
in gopher but won't in gemini due to link line parsing. I'm defaulting
to code-fencing all type i lines in the file unless the lines match the
formatting for a header (#, ##, ###, but not ####), or an unordered list.

It's in GNU awk and untested on BSD. I'm guessing it'll explode there
brilliantly.

For those of you looking to batch-convert or cross-serve content, it may
be useful. Hack it up and enjoy.

PS: do we have a name for the text/gemini format itself? The spec-spec
just refers to it by media type.



More information about the Gemini mailing list