rethinking gophermap | |
-------------------- | |
complex one | |
~~~~~~~~~~~ | |
this is the proposal of simplified | |
syntax which can be used for creating | |
gopher menus by people | |
link to file: *Description=selector@hostname:70;\r\n | |
link to catalog: +Description=selector@hostname:70;\r\n | |
query: ?Description=selector@hostname:70;\r\n | |
information text: Lorem impsum dolor sit amet\r\n | |
note that specifying link resembles original format | |
by having same component order, but having more | |
sensible (for modern conventions) separators. | |
if your infotext follows one of links format | |
you probably can escape chars using \ which | |
will be stripped during parsing. | |
lgm | |
~~~ | |
but now i'm using simpler solution | |
which i've called lgm - lighweight | |
gopher map. it's just have TAB replaced | |
by semicolon ; and actual semicolons | |
escaped using backslash \;, so | |
infotext become i<text>;;; which | |
is kinda natural for programmers using | |
C-like languages and also resembles | |
shell case operator breaks | |
basically, it's implemented as perl | |
one-liner (because sed lacks for | |
lookbehind regexp) | |
perl -pe 's/(?<!\\);/\t/gi;s/\\;/;/gi;s/\t\t\t$/\t\thost.invalid\t0/gi;' | |
P.S.: | |
it seems that some clients breaks | |
when they see menu item without | |
host or port, even with proper tabs | |
at least floodgap proxy does | |
Back | |
Index |