]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/mothra
libmp: add mpnrand() function to generate uniform random number 0 ≤ x < n
[plan9front.git] / sys / man / 1 / mothra
1 .TH MOTHRA 1
2 .SH NAME
3 mothra \- retrieve and display World-Wide Web files
4 .SH SYNOPSIS
5 .B mothra
6 [
7 .B -va
8 ]
9 [
10 .B -m
11 .I mtpt
12 ] [
13 .I url
14 ]
15 .SH DESCRIPTION
16 .I Mothra
17 uses
18 .IR webfs (4)
19 to retrieve and display files from the World-Wide Web,
20 by name or through hypertext links.
21 Web names, called URLs, have a peculiar syntax:
22 .IP
23 .EX
24 http://9front.org/
25 https://code.9front.org/plan9front/
26 http://cat-v.org/
27 .EE
28 .PP
29 The part up to the first colon gives the protocol for
30 retrieving the file.
31 .BR http: ,
32 Hyper-Text Transfer
33 Protocol, is the usual way of accessing web files.
34 .PD
35 .PP
36 .B //
37 begins the Internet address of the server where the file resides.
38 The address may contain a colon and a TCP port
39 number, which overrides the 
40 default port number for the service.  Next comes a
41 file name.  Finally, the file name may be followed by
42 .B #
43 and a string giving a label within the file where the
44 display should begin.
45 .PP
46 .I Mothra
47 starts with the
48 .I url
49 given on the command line, defaulting to
50 the environment variable
51 .BR $url .
52 .PP
53 There are a number of options:
54 .TP
55 .B -a
56 Alt display. Starts in alt display mode, see menu
57 commands table below.
58 .TP
59 .B -m
60 Specify the
61 .IR webfs (4)
62 mountpoint with
63 .BR -m
64 .I mtpt.
65 The default is
66 .B /mnt/web.
67 .TP
68 .B -v
69 Verbose mode. Causes HTML errors to be printed
70 on file-descriptor 2.
71 .PP
72 The display contains the last message from
73 .I mothra,
74 a box where typed commands appear,
75 a scrollable list of previously visited files,
76 the title and URL of the current file,
77 and the scrollable text of the current file.
78 .PP
79 Button 1 selects and displays a file, either from the list
80 of previously visited pages or from a link (indicated
81 by underlined text or a boxed image) in the
82 current file.  Button 2 shows the URL of a file,
83 but does not retrieve or display it.
84 Button 3 pops up a menu of commands:
85 .TF alt\ display
86 .TP
87 .B alt display
88 Collapse or expand the navigation boxes at the top of the browser window.
89 .TP
90 .B moth mode
91 Enter moth mode and switch to the moth cursor. If the HREF of an image
92 link is different from the URL of the image itself, a link to the HREF will be
93 printed on the right side of the image. Clicking an image or link with mouse
94 button 1 prompts the user to save a copy of the file in the current directory.
95 Clicking mouse button 2 sets the target as the current URL.
96 Clicking the
97 .B moth mode
98 menu option again exits moth mode.
99 .TP
100 .B snarf
101 Copy the current entry text or selected page text to snarf buffer.
102 If nothing is selected, the current URL is copied.
103 .TP
104 .B paste
105 Paste the snarf buffer to the current text entry.
106 .TP
107 .B search
108 Search for a regular expression in the current page.
109 .TP
110 .B save hit
111 Save the current URL to the hit list.
112 .TP
113 .B hit list
114 Retrieve and display the hit list.
115 .TP
116 .B exit
117 Ask for confirmation and quit.
118 .PD
119 .PP
120 The typed commands are:
121 .TF typed\ commands
122 .TP
123 .B a
124 Toggle alt display.
125 .TP
126 .BI g " url
127 Go to the page with the given URL.
128 .TP
129 .BI j " n
130 Jump to page
131 .I n
132 from the list of previously viewed pages.
133 .TP
134 .BI k
135 Kill images on the current page.
136 .TP
137 .BI m
138 Enter or exit moth mode.
139 .TP
140 .B r
141 Reload the current page.
142 .TP
143 .BI s " file
144 Save the current page in the given
145 .I file.
146 .TP
147 .BI W " file
148 Capture a screenshot of the entire browser window in the given
149 .I file.
150 .TP
151 .BI w " file
152 Capture a screenshot of the content area in the given
153 .I file.
154 .TP
155 .B q
156 Quit.
157 .PD
158 .PP
159 When
160 .I mothra
161 retrieves a direct link to a file that is not an
162 HTML document (for example a GIF or JPEG
163 image), it will start up an appropriate viewer, for example
164 .B page
165 (see
166 .IR page (1))
167 for most image files.
168 .SH FILES
169 .B $home/lib/mothra/hit.html 
170 the hit list
171 .SH SOURCE
172 .B /sys/src/cmd/mothra
173 .SH "SEE ALSO"
174 .IR webfs (4)
175 .SH BUGS
176 Files are saved in the form received,
177 not in the form suggested by the name in an
178 .B s
179 command. A directory index saved from moth mode may be written in
180 the local directory as a file named
181 .B index.
182 Sanitizing remote file names for the local file system is imperfect.
183 .PP
184 .I Mothra
185 is distributed in a preliminary state; it has more than its share of bugs. Note that
186 .I mothra,
187 like the other Guardian Monsters, has no particular concern for humanity.
188 .SH HISTORY
189 .I Mothra
190 first appeared in Plan 9 from Bell Labs (1995). It was later modified for inclusion in
191 9front (September, 2011).