-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.Gophermap
More file actions
118 lines (95 loc) · 3.78 KB
/
README.Gophermap
File metadata and controls
118 lines (95 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
!Sample gophermap for uGopherServer
##
## This is a sample gophermap.
##
#
Creating a file called "gophermap" into a directory disables the
normal resource listing and replaces it with the contents of the map
file. You can also have inline gophermaps - files with a ".gophermap"
extension are parsed as gophermaps and displayed in between normal
resources in alphabetical order.
Creating a file called "foo.Ghdr" adds the result of parsing
foo.Ghdr as a gophermap to the menu before the selector for "foo".
Creating a file called "foo.Gftr" adds the result of parsing
foo.Gftr as a gophermap to the menu after the selector for "foo".
Creating a file called "foo.Gtag" behaves as though foo was a direct-
ory containing a gophertag - this gophertag is applied thus.
In a gophermap any line that doesn't contain a <TAB> character is
automatically converted to an type "i" gopher resource which are
displayed as plain text in the client. Lines which contain tabs are
intepreted as gopher resource lines which the client will render as
links. The first line of a gophermap should be a !Title line
describing the menu.
Dynamic gophermaps are possible by making the gophermap a script and
marking it as executable. All script output is parsed just like a
static gophermap, for example lines without tabs are converted to "i"
resources. Executable gophermaps are always ran through the default
shell (/bin/sh) so depending on your operating system that's either
slow, or really unbearably slow...
The format of a gophermap resource line is simple:
Xname<TAB>selector<TAB>host<TAB>port
Where:
X is the gopher filetype
name is an explanation of the resource
selector is the path to resource
host:port are the hostname and port number to go to
Type and name are mandatory. If you don't specify a selector, the
name field will be also used as the selector. If you don't specify
host or port the host:port of the current server are used instead.
Also make sure to use ONLY ONE TAB between the fields.
Valid filetypes include:
0 text file
1 directory
3 error message
5 archive file (zip, tar etc)
7 search query
8 telnet session
9 binary file
g GIF image
h HTML file
i info text
I generic image file (other than GIF)
d document file (ps, pdf, doc etc)
s sound file
; video file
c calendar file
M MIME file (mbox, emails etc)
Additional type characters supported by Gophernicus:
# comment - rest of the line is ignored
!title menu title (use on the first line)
-file hide the file from listings
:ext=type change filetype (for this directory only)
~ include a list of users with valid ~/public_gopher
% include a list of available virtual hosts
=mapfile include or execute other gophermap
* stop processing gophermap, include file listing
. stop processing gophermap (default)
Examples of valid resource lines:
1subdir
1Relative internal link subdir
1Absolute internal link /subdir
1External link / gopher.floodgap.com 70
1External relative link (which shouldn't work) subdir/ gopher.domain.dom 70
0Finger-to-gopher link kim holviala.com 79
hLink to a website URL:http://www.google.com/
hLink to a local html page /path/to/file.html
5Link to an tar archive /path/to/archive.tar.gz
9Link to a binary file /path/to/binary
7Search engine query /query
8Telnet session kim holviala.com 79
# Hide a few files from the menu listing generated by *
-hiddenfile.txt
-hiddendir
# Change filetypes for this directory
:png=g
:foo=b
Include links to users own gopherspaces:
~
List all available virtual hosts:
%
Include sub-gophermap:
=LICENSE
Execute script and parse output as subgophermap:
=/usr/bin/uptime
Here we stop processing the gophermap and include the regular menu:
*