Debian Codegraph @

doc/html2wml.man

raw ◀ ▶
1 Debian patch touch this file
1 .\" Automatically generated by Pod::Man version 1.02
2 .\" Sun Oct 26 17:23:13 2003
3 .\"
4 .\" Standard preamble:
5 .\" ======================================================================
6 .de Sh \" Subsection heading
7 .br
8 .if t .Sp
9 .ne 5
10 .PP
11 \fB\\$1\fR
12 .PP
13 ..
14 .de Sp \" Vertical space (when we can't use .PP)
15 .if t .sp .5v
16 .if n .sp
17 ..
18 .de Ip \" List item
19 .br
20 .ie \\n(.$>=3 .ne \\$3
21 .el .ne 3
22 .IP "\\$1" \\$2
23 ..
24 .de Vb \" Begin verbatim text
25 .ft CW
26 .nf
27 .ne \\$1
28 ..
29 .de Ve \" End verbatim text
30 .ft R
31
32 .fi
33 ..
34 .\" Set up some character translations and predefined strings. \*(-- will
35 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
36 .\" double quote, and \*(R" will give a right double quote. | will give a
37 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
38 .\" to do unbreakable dashes and therefore won't be available. \*(C` and
39 .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
40 .tr \(*W-|\(bv\*(Tr
41 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
42 .ie n \{\
43 . ds -- \(*W-
44 . ds PI pi
45 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47 . ds L" ""
48 . ds R" ""
49 . ds C` `
50 . ds C' '
51 'br\}
52 .el\{\
53 . ds -- \|\(em\|
54 . ds PI \(*p
55 . ds L" ``
56 . ds R" ''
57 'br\}
58 .\"
59 .\" If the F register is turned on, we'll generate index entries on stderr
60 .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
61 .\" index entries marked with X<> in POD. Of course, you'll have to process
62 .\" the output yourself in some meaningful fashion.
63 .if \nF \{\
64 . de IX
65 . tm Index:\\$1\t\\n%\t"\\$2"
66 . .
67 . nr % 0
68 . rr F
69 .\}
70 .\"
71 .\" For nroff, turn off justification. Always turn off hyphenation; it
72 .\" makes way too many mistakes in technical documents.
73 .hy 0
74 .if n .na
75 .\"
76 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
77 .\" Fear. Run. Save yourself. No user-serviceable parts.
78 .bd B 3
79 . \" fudge factors for nroff and troff
80 .if n \{\
81 . ds #H 0
82 . ds #V .8m
83 . ds #F .3m
84 . ds #[ \f1
85 . ds #] \fP
86 .\}
87 .if t \{\
88 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89 . ds #V .6m
90 . ds #F 0
91 . ds #[ \&
92 . ds #] \&
93 .\}
94 . \" simple accents for nroff and troff
95 .if n \{\
96 . ds ' \&
97 . ds ` \&
98 . ds ^ \&
99 . ds , \&
100 . ds ~ ~
101 . ds /
102 .\}
103 .if t \{\
104 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
105 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
106 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
107 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
108 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
109 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
110 .\}
111 . \" troff and (daisy-wheel) nroff accents
112 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
113 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
114 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
115 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
116 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
117 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
118 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
119 .ds ae a\h'-(\w'a'u*4/10)'e
120 .ds Ae A\h'-(\w'A'u*4/10)'E
121 . \" corrections for vroff
122 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
123 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
124 . \" for low resolution devices (crt and lpr)
125 .if \n(.H>23 .if \n(.V>19 \
126 \{\
127 . ds : e
128 . ds 8 ss
129 . ds o a
130 . ds d- d\h'-1'\(ga
131 . ds D- D\h'-1'\(hy
132 . ds th \o'bp'
133 . ds Th \o'LP'
134 . ds ae ae
135 . ds Ae AE
136 .\}
137 .rm #[ #] #H #V #F C
138 .\" ======================================================================
139 .\"
140 .IX Title "README 1"
141 .TH README 1 "0.4.11" "2003-10-26" """Html2Wml Documentation"""
142 .UC
143 .SH "NAME"
144 Html2Wml \*(-- Program that can convert \s-1HTML\s0 pages to \s-1WML\s0 pages
145 .SH "SYNOPSIS"
146 .IX Header "SYNOPSIS"
147 Html2Wml can be used as either a shell command:
148 .PP
149 .Vb 1
150 \& $ html2wml file.html
151 .Ve
152 or as a \s-1CGI:\s0
153 .PP
154 .Vb 1
155 \& /cgi-bin/html2wml.cgi?url=/index.html
156 .Ve
157 In both cases, the file can be either a local file or a \s-1URL\s0.
158 .SH "DESCRIPTION"
159 .IX Header "DESCRIPTION"
160 Html2Wml converts \s-1HTML\s0 pages to \s-1WML\s0 decks, suitable for being viewed on a
161 Wap device. The program can be launched from a shell to statically convert
162 a set of pages, or as a \s-1CGI\s0 to convert a particular (potentially dynamic)
163 \&\s-1HTML\s0 resource.
164 .PP
165 Althought the result is not guarantied to be valid \s-1WML\s0, it should be the
166 case for most pages. Good \s-1HTML\s0 pages will most probably produce valid
•167 \&\s-1WML\s0 decks. To check and correct your pages, you can use W3C's software:
168 the \fI\s-1HTML\s0 Validator\fR, available online at http://validator.w3.org
169 and \fI\s-1HTML\s0 Tidy\fR, written by Dave Raggett.
170 .PP
171 Html2Wml provides the following features:
172 .Ip "\(bu" 4
173 translation of the links
174 .Ip "\(bu" 4
175 limitation of the cards size by splitting the result into several cards
176 .Ip "\(bu" 4
177 inclusion of files (similar to the \s-1SSI\s0)
178 .Ip "\(bu" 4
179 compilation of the result (using the \s-1WML\s0 Tools, see the section on "LINKS")
180 .Ip "\(bu" 4
181 a debug mode to check the result using validation functions
182 .SH "OPTIONS"
183 .IX Header "OPTIONS"
184 Please note that most of these options are also available when calling
185 Html2Wml as a \s-1CGI\s0. In this case, boolean options are given the value
186 \&\*(L"1\*(R" or \*(L"0\*(R", and other options simply receive the value they
187 expect. For example, \f(CW\*(C`\-\-ascii\*(C'\fR becomes \f(CW\*(C`?ascii=1\*(C'\fR or \f(CW\*(C`?a=1\*(C'\fR. See the
188 file \fIt/form.html\fR for an example on how to call Html2Wml as a \s-1CGI\s0.
189 .Sh "Conversion Options"
190 .IX Subsection "Conversion Options"
191 .Ip "\-a, \-\-ascii" 4
192 .IX Item "-a, --ascii"
193 When this option is on, named \s-1HTML\s0 entities and non-ASCII characters are
194 converted to \s-1US-ASCII\s0 characters using the same 7 bit approximations as
195 Lynx. For example, \f(CW\*(C`&copy;\*(C'\fR is translated to \*(L"(c)\*(R", and \f(CW\*(C`&szlig;\*(C'\fR is
196 translated to \*(L"ss\*(R". This option is off by default.
197 .Ip "\-\-[no]collapse" 4
198 .IX Item "--[no]collapse"
199 This option tells Html2Wml to collapse redundant whitespaces,
200 tabulations, carriage returns, lines feeds and empty paragraphs. The aim
201 is to reduce the size of the \s-1WML\s0 document as much as possible. Collapsing
202 empty paragraphs is necessary for two reasons. First, this avoids empty
203 screens (and on a device with only 4 lines of display, an empty screen can
204 be quite ennoying). Second, Html2wml creates many empty paragraphs when
205 converting, because of the way the syntax reconstructor is programmed.
206 Deleting these empty paragraphs is necessary like cleaning the kitchen :\-)
207 .Sp
•208 If this really bother you, you can deactivate this behaviour with the
209 \&\fB\*(--nocollapse\fR option.
210 .Ip "\*(--ignore-images" 4
211 .IX Item "ignore-images"
•212 This option tells Html2Wml to completely ignore all image links.
213 .Ip "\-\-[no]img-alt-text" 4
214 .IX Item "--[no]img-alt-text"
215 This option tells Html2Wml to replace the image tags with their
216 corresponding alternative text (as with a text mode web browser).
217 This option is on by default.
218 .Ip "\-\-[no]linearize" 4
219 .IX Item "--[no]linearize"
220 This option is on by default. This makes Html2Wml flattens the \s-1HTML\s0
221 tables (they are linearized), as Lynx does. I think this is better than
222 trying to use the native \s-1WML\s0 tables. First, they have extremely limited
223 features and possibilities compared to \s-1HTML\s0 tables. In particular, they
224 can't be nested. In fact this is normal because Wap devices are not
225 supposed to have a big \s-1CPU\s0 running at some zillions-hertz, and the
226 calculations needed to render the tables are the most complicated and
227 CPU-hogger part of \s-1HTML\s0.
228 .Sp
229 Second, as they can't be nested, and as typical \s-1HTML\s0 pages heavily use
230 imbricated tables to create their layout, it's impossible to decide which
231 one could be kept. So the best thing is to keep none of them.
232 .Sp
•233 \&\fB[Note]\fR Although you can deactivate this behaviour, and although
234 there is internal support for tables, the unlinearized mode has not
235 been heavily tested with nested tables, and it may produce unexpected
236 results.
237 .Ip "\-n, \-\-numeric-non-ascii" 4
238 .IX Item "-n, --numeric-non-ascii"
239 This option tells Html2wml to convert all non-ASCII characters to
240 numeric entities, i.e., "e\*'" becomes \f(CW\*(C`&#233;\*(C'\fR, and "\*8"
241 becomes \f(CW\*(C`&#223;\*(C'\fR. By default, this option is off.
242 .Ip "\-p, \-\-nopre" 4
243 .IX Item "-p, --nopre"
244 This options tells Html2Wml not to use the <pre>
245 tag. This option was added because the compiler from \s-1WML\s0 Tools 0.0.4
246 doesn't support this tag.
247 .Sh "Links Reconstruction Options"
248 .IX Subsection "Links Reconstruction Options"
249 .Ip "\*(--hreftmpl=\fI\s-1TEMPLATE\s0\fR" 4
250 .IX Item "hreftmpl=TEMPLATE"
251 This options sets the template that will be used to reconstruct the
252 \&\f(CW\*(C`href\*(C'\fR\-type links. See the section on "LINKS RECONSTRUCTION" for more information.
253 .Ip "\*(--srctmpl=\fI\s-1TEMPLATE\s0\fR" 4
254 .IX Item "srctmpl=TEMPLATE"
255 This option sets the template that will be used to reconstruct the
256 \&\f(CW\*(C`src\*(C'\fR\-type links. See the section on "LINKS RECONSTRUCTION" for more information.
257 .Sh "Splitting Options"
258 .IX Subsection "Splitting Options"
259 .Ip "\-s, \-\-max-card-size=\fI\s-1SIZE\s0\fR" 4
260 .IX Item "-s, --max-card-size=SIZE"
261 This option allows you to limit the size (in bytes) of the generated
•262 cards. Default is 1,500 bytes, which should be small enough to be loaded
263 on most Wap devices. See the section on "DECK SLICING" for more information.
264 .Ip "\-t, \-\-card-split-threshold=\fI\s-1SIZE\s0\fR" 4
265 .IX Item "-t, --card-split-threshold=SIZE"
266 This option sets the threshold of the split event, which can occur
267 when the size of the current card is between \f(CW\*(C`max\-card\-size\*(C'\fR \-
268 \&\f(CW\*(C`card\-split\-threshold\*(C'\fR and \f(CW\*(C`max\-card\-size\*(C'\fR. Default value is
269 50. See the section on "DECK SLICING" for more information.
270 .Ip "\*(--next-card-label=\fI\s-1STRING\s0\fR" 4
271 .IX Item "next-card-label=STRING"
272 This options sets the label of the link that points to the next card.
273 Default is \*(L"[&gt;&gt;]\*(R", which whill be rendered as "[>>]".
274 .Ip "\*(--prev-card-label=\fI\s-1STRING\s0\fR" 4
275 .IX Item "prev-card-label=STRING"
276 This options sets the label of the link that points to the previous card.
277 Default is \*(L"[&lt;&lt;]\*(R", which whill be rendered as "[<<]".
278 .Sh "\s-1HTTP\s0 Authentication"
279 .IX Subsection "HTTP Authentication"
280 .Ip "\-U, \-\-http-user=\fI\s-1USERNAME\s0\fR" 4
281 .IX Item "-U, --http-user=USERNAME"
282 Use this option to set the username for an authenticated request.
283 .Ip "\-P, \-\-http-passwd=\fI\s-1PASSWORD\s0\fR" 4
284 .IX Item "-P, --http-passwd=PASSWORD"
285 Use this option to set the password for an authenticated request.
286 .Sh "Proxy Support"
287 .IX Subsection "Proxy Support"
288 .Ip "\-[no]Y, \-\-[no]proxy" 4
289 .IX Item "-[no]Y, --[no]proxy"
290 Use this option to activate proxy support. By default, proxy support
291 is activated. See the section on "PROXY SUPPORT".
292 .Sh "Output Options"
293 .IX Subsection "Output Options"
294 .Ip "\-k, \-\-compile" 4
295 .IX Item "-k, --compile"
296 Setting this option tells Html2Wml to use the compiler from \s-1WML\s0 Tools
297 to compile the \s-1WML\s0 deck. If you want to create a real Wap site, you should
298 seriously use this option in order to reduce the size of the \s-1WML\s0 decks.
299 Remember that Wap devices have very little amount of memory. If this is
•300 not enough, use the splitting options.
301 .Sp
302 Take a look in \fIwml_compilation/\fR for more information on how to use
303 a \s-1WML\s0 compiler with Html2Wml.
304 .Ip "\-o, \-\-output" 4
305 .IX Item "-o, --output"
306 Use this option (in shell mode) to specify an output file.
307 By default, Html2Wml prints the result to standard output.
308 .Sh "Debugging Options"
309 .IX Subsection "Debugging Options"
310 .Ip "\-d, \-\-debug[=\fI\s-1LEVEL\s0\fR]" 4
311 .IX Item "-d, --debug[=LEVEL]"
312 This option activates the debug mode. This prints the output result
313 with line numbering and with the result of the \s-1XML\s0 check. If the \s-1WML\s0
314 compiler was called, the result is also printed in hexadecimal an ascii
315 forms. When called as a \s-1CGI\s0, all of this is printed as \s-1HTML\s0, so that can
316 use any web browser for that purpose.
317 .Ip "\*(--xmlcheck" 4
318 .IX Item "xmlcheck"
319 When this option is on, it send the \s-1WML\s0 output to \s-1XML:\s0:Parser to check
320 its well-formedness.
321 .SH "DECK SLICING"
322 .IX Header "DECK SLICING"
323 The \fIdeck slicing\fR is a feature that Html2Wml provides in order to
324 match the low memory capabilities of most Wap devices. Many can't handle
325 cards larger than 2,000 bytes, therefore the cards must be sufficiently
326 small to be viewed by all Wap devices. To achieve this, you should compile
327 your \s-1WML\s0 deck, which reduce the size of the deck by 50%, but even then your
328 cards may be too big. This is where Html2Wml comes with the deck slicing
329 feature. This allows you to limit the size of the cards, currently only
330 \&\fIbefore\fR the compilation stage.
331 .Sh "Slice by cards or by decks"
332 .IX Subsection "Slice by cards or by decks"
333 On some Wap phones, slicing the deck is not sufficient: the \s-1WML\s0 browser
334 still tries to download the whole deck instead of just picking one
335 card at a time. A solution is to slice the \s-1WML\s0 document by decks.
336 See the figure below.
337 .PP
338 .Vb 15
339 \& _____________ _____________
340 \& | deck | | deck #1 |
341 \& | _________ | | _________ |
342 \& | | card #1 | | | | card | |
343 \& | |_________| | | |_________| |
344 \& | _________ | |_____________|
345 \& | | card #2 | |
346 \& | |_________| | . . .
347 \& | _________ |
348 \& | | ... | | _____________
349 \& | |_________| | | deck #n |
350 \& | _________ | | _________ |
351 \& | | card #n | | | | card | |
352 \& | |_________| | | |_________| |
353 \& |_____________| |_____________|
354 .Ve
355 .Vb 2
356 \& WML document WML document
357 \& sliced by cards sliced by decks
358 .Ve
359 What this means is that Html2Wml generates several \s-1WML\s0 documents.
360 In \s-1CGI\s0 mode, only the appropriate deck is sent, selected by the id
361 given in parameter. If no id was given, the first deck is sent.
362 .Sh "Note on size calculation"
363 .IX Subsection "Note on size calculation"
364 Currently, Html2Wml estimates the size of the card on the fly, by
365 summing the length of the strings that compose the \s-1WML\s0 output, texts and
366 tags. I say \*(L"estimates\*(R" and not \*(L"calculates\*(R" because computing the exact
367 size would require many more calculations than the way it is done now.
368 One may objects that there are only additions, which is correct, but knowing
369 the \fIexact\fR size is not necessary. Indeed, if you compile the \s-1WML\s0, most of
370 the strings of the tags will be removed, but not all.
371 .PP
372 For example, take an image tag:
373 \&\f(CW\*(C`<img src="images/dog.jpg" alt="Photo of a dog">\*(C'\fR.
374 When compiled, the string \f(CW\*(C`"img"\*(C'\fR will be replaced by a one byte value.
375 Same thing for the strings \f(CW\*(C`"src"\*(C'\fR and \f(CW\*(C`"alt"\*(C'\fR, and the spaces, double
376 quotes and equal signs will be stripped. Only the text between double quote
377 will be preserved... but not in every cases.
378 Indeed, in order to go a step further, the compiler can also encode
379 parts of the arguments as binary. For example, the string \f(CW\*(C`"http://www."\*(C'\fR
380 can be encoded as a single byte (\f(CW\*(C`8F\*(C'\fR in this case). Or, if the attribute
381 is \f(CW\*(C`href\*(C'\fR, the string \f(CW\*(C`href="http://\*(C'\fR can become the byte \f(CW\*(C`4B\*(C'\fR.
382 .PP
383 As you see, it doesn't matter to know exactly the size of the textual
384 form of the \s-1WML\s0, as it will always be far superior to the size of the
385 compiled form. That's why I don't count all the characters that may be
386 actually written.
387 .PP
388 Also, it's because I'm quite lazy ;\-)
389 .Sh "Why compiling the \s-1WML\s0 deck?"
390 .IX Subsection "Why compiling the WML deck?"
391 If you intent to create real \s-1WML\s0 pages, you should really
392 consider to always compile them. If you're not convinced, here is an
393 illustration.
394 .PP
395 Take the following \s-1WML\s0 code snipet:
396 .PP
397 .Vb 1
398 \& <a href='http://www.yahoo.com/'>Yahoo!</a>
399 .Ve
400 It's the basic and classical way to code an hyperlink. It takes 42 bytes
401 to code this, because it is presented in a human-readable form.
402 .PP
403 The \s-1WAP\s0 Forum has defined a compact binary representation of \s-1WML\s0 in its
404 specification, which is called \*(L"compiled \s-1WML\s0\*(R". It's a binary format,
405 therefore you, a mere human, can't read that, but your computer can. And
406 it's much faster for it to read a binary format than to read a textual
407 format.
408 .PP
409 The previous example would be, once compiled (and printed here as
410 hexadecimal):
411 .PP
412 .Vb 1
413 \& 1C 4A 8F 03 y a h o o 00 85 01 03 Y a h o o ! 00 01
414 .Ve
415 This only takes 21 bytes. Half the size of the human-readable form.
416 For a Wap device, this means both less to download, and easier things
417 to read. Therefore the processing of the document can be achieved in
418 a short time compared to the tectual version of the same document.
419 .PP
420 There is a last argument, and not the less important: many Wap devices
421 only read binary \s-1WML\s0.
422 .SH "ACTIONS"
423 .IX Header "ACTIONS"
424 Actions are a feature similar to (but with far less functionalities!) the
425 \&\s-1SSI\s0 (Server Side Includes) available on good servers like Apache. In order
426 not to interfere with the real \s-1SSI\s0, but to keep the syntax easy to learn,
427 it differs in very few points.
428 .Sh "Syntax"
429 .IX Subsection "Syntax"
430 Basically, the syntax to execute an action is:
431 .PP
432 .Vb 1
433 \& <!-- [action param1="value" param2='value'] -->
434 .Ve
435 Note that the angle brackets are part of the syntax. Except for that
436 point, Actions syntax is very similar to \s-1SSI\s0 syntax.
437 .Sh "Available actions"
438 .IX Subsection "Available actions"
439 Only few actions are currently available, but more can be implemented
440 on request.
441 .Ip "include" 4
442 .IX Item "include"
443 .RS 4
444 .Ip "Description" 8
445 .IX Item "Description"
446 Includes a file in the document at the current point. Please note
447 that Html2Wml doesn't check nor parse the file, and if the file
448 cannot be found, will silently die (this is the same behavior as \s-1SSI\s0).
449 .Ip "Parameters" 8
450 .IX Item "Parameters"
451 \&\f(CW\*(C`virtual=url\*(C'\fR \*(-- The file is get by http.
452 .Sp
453 \&\f(CW\*(C`file=path\*(C'\fR \*(-- The file is read from the local disk.
454 .RE
455 .RS 4
456 .RE
457 .Ip "fsize" 4
458 .IX Item "fsize"
459 .RS 4
460 .Ip "Description" 8
461 .IX Item "Description"
462 Returns the size of a file at the current point of the document.
463 .Ip "Parameters" 8
464 .IX Item "Parameters"
465 \&\f(CW\*(C`virtual=url\*(C'\fR \*(-- The file is get by http.
466 .Sp
467 \&\f(CW\*(C`file=path\*(C'\fR \*(-- The file is read from the local disk.
468 .Ip "Notes" 8
469 .IX Item "Notes"
470 If you use the file parameter, an absolute path is recommend.
471 .RE
472 .RS 4
473 .RE
474 .Ip "skip" 4
475 .IX Item "skip"
476 .RS 4
477 .Ip "Description" 8
478 .IX Item "Description"
479 Skips everything until the first \f(CW\*(C`end_skip\*(C'\fR action.
480 .RE
481 .RS 4
482 .RE
483 .Sh "Generic parameters"
484 .IX Subsection "Generic parameters"
485 The following parameters can be used for any action.
486 .Ip "for=\fIoutput format\fR" 4
487 .IX Item "for=output format"
•488 This parameter restricts the action for the given output format.
489 Currently, the only available format is "\f(CW\*(C`wml\*(C'\fR" (when using \f(CW\*(C`html2chtml\*(C'\fR
490 the format is "\f(CW\*(C`chtml\*(C'\fR").
491 .Sh "Examples"
492 .IX Subsection "Examples"
493 If you want to share a navigation bar between several \s-1WML\s0 pages, you can
494 \&\f(CW\*(C`include\*(C'\fR it this way:
495 .PP
496 .Vb 1
497 \& <!-- [include virtual="nav.wml"] -->
498 .Ve
499 Of course, you have to write this navigation bar first :\-)
500 .PP
501 If you want to use your current \s-1HTML\s0 pages for creating your \s-1WML\s0 pages,
•502 but that they contains complex tables, or unnecessary navigation tables,
503 etc, you can simply \f(CW\*(C`skip\*(C'\fR the complex parts and keep the rest.
504 .PP
505 .Vb 6
506 \& <body>
507 \& <!--[skip for="wml"]-->
•508 \& unnecessary parts for the WML pages
509 \& <!--[end_skip]-->
510 \& useful parts for the WML pages
511 \& </body>
512 .Ve
513 .SH "LINKS RECONSTRUCTION"
514 .IX Header "LINKS RECONSTRUCTION"
515 The links reconstruction engine is \s-1IMHO\s0 the most important part of
516 Html2Wml, because it's this engine that allows you to reconstruct the
517 links of the \s-1HTML\s0 document being converted. It has two modes, depending
518 upon whether Html2Wml was launched from the shell or as a \s-1CGI\s0.
519 .PP
520 When used as a \s-1CGI\s0, this engine will reconstructs the links of the \s-1HTML\s0
521 document so that all the urls will be passed to Html2Wml in order to
•522 convert the pointed files (pages or images). This is completely automatic
523 and can't be customized for now (but I don't think it would be really
524 useful).
525 .PP
526 When used from the shell, this engine reconstructs the links with the
527 given templates. Note that absolute URLs will be left untouched. The
528 templates can be customized using the following syntax.
529 .Sh "Templates"
530 .IX Subsection "Templates"
531 .Ip "\s-1HREF\s0 Template" 4
532 .IX Item "HREF Template"
533 This template controls the reconstruction of the \f(CW\*(C`href\*(C'\fR attribute of
534 the \f(CW\*(C`A\*(C'\fR tag. Its value can be changed using the \fB\*(--hreftmpl\fR option.
535 Default value is
536 \&\f(CW\*(C`"{FILEPATH}{FILENAME}{$FILETYPE =~ s/s?html?/wml/o; $FILETYPE}"\*(C'\fR.
537 .Ip "Image Source Template" 4
538 .IX Item "Image Source Template"
539 This template controls the reconstruction of the \f(CW\*(C`src\*(C'\fR attribute of
540 the \f(CW\*(C`IMG\*(C'\fR tag. Its value can be changed using the \fB\*(--srctmpl\fR option.
541 Default value is
542 \&\f(CW\*(C`"{FILEPATH}{FILENAME}{$FILETYPE =~ s/gif|png|jpe?g/wbmp/o; $FILETYPE}"\*(C'\fR
543 .Sh "Syntax"
544 .IX Subsection "Syntax"
545 The template is a string that contains the new \s-1URL\s0. More precisely, it's
546 a Text::Template template. Parameters can be interpolated as a constant
547 or as a variable. The template is embraced between curcly bracets, and can
548 contain any valid Perl code.
549 .PP
550 The simplest form of a template is \f(CW\*(C`{PARAM}\*(C'\fR which just returns the
551 value of \s-1PARAM\s0. If you want to do something more complex, you can use
552 the corresponding variable; for example \f(CW\*(C`{"foo $PARAM bar"}\*(C'\fR, or
553 \&\f(CW\*(C`{join "_", split " ", PARAM}\*(C'\fR.
554 .PP
555 You may read the Text::Template manpage for more information on what is possible
556 within a template.
557 .PP
558 If the original \s-1URL\s0 contained a query part or a fragment part, then they
559 will be appended to the result of the template.
560 .Sh "Available parameters"
561 .IX Subsection "Available parameters"
562 .Ip "\s-1URL\s0" 4
563 .IX Item "URL"
564 This parameter contains the original \s-1URL\s0 from the \f(CW\*(C`href\*(C'\fR or \f(CW\*(C`src\*(C'\fR
565 attribute.
566 .Ip "\s-1FILENAME\s0" 4
567 .IX Item "FILENAME"
568 This parameter contains the base name of the file.
569 .Ip "\s-1FILEPATH\s0" 4
570 .IX Item "FILEPATH"
571 This parameter contains the leading path of the file.
572 .Ip "\s-1FILETYPE\s0" 4
573 .IX Item "FILETYPE"
574 This parameter contains the suffix of the file.
575 .PP
576 This can be resumed this way:
577 .PP
578 .Vb 5
579 \& URL = http://www.server.net/path/to/my/page.html
580 \& ------------^^^^ ----
581 \& | | \e
582 \& | | \e
583 \& FILEPATH FILENAME FILETYPE
584 .Ve
585 Note that \f(CW\*(C`FILETYPE\*(C'\fR contains all the extensions of the file, so if its name
586 is \fIindex.html.fr\fR for example, \f(CW\*(C`FILETYPE\*(C'\fR contains "\f(CW\*(C`.html.fr\*(C'\fR".
587 .Sh "Examples"
588 .IX Subsection "Examples"
589 To add a path option:
590 .PP
591 .Vb 1
592 \& {URL}$wap
593 .Ve
594 Using Apache, you can then add a Rewrite directive so that \s-1URL\s0 ending with
595 \&\f(CW\*(C`$wap\*(C'\fR will be redirected to Html2Wml:
596 .PP
597 .Vb 1
598 \& RewriteRule ^(/.*)\e$wap$ /cgi-bin/html2wml.cgi?url=$1
599 .Ve
600 To change the extension of an image:
601 .PP
602 .Vb 1
603 \& {FILEPATH}{FILENAME}.wbmp
604 .Ve
605 .SH "PROXY SUPPORT"
606 .IX Header "PROXY SUPPORT"
607 Html2Wml uses \s-1LWP\s0 built-in proxy support. It is activated by default, and
608 loads the proxy settings from the environment variables, using the same
609 variables as many others programs. Each protocol (http, ftp, etc) can be
610 mapped to use a proxy server by setting a variable of the form \f(CW\*(C`PROTOCOL_proxy\*(C'\fR.
611 Example: use \f(CW\*(C`http_proxy\*(C'\fR to define the proxy for http access, \f(CW\*(C`ftp_proxy\*(C'\fR
612 for ftp access. In the shell, this is only a matter of defining the variable.
613 .PP
614 For Bourne shell:
615 .PP
616 .Vb 1
617 \& $ export http_proxy="http://proxy.domain.com:8080/"
618 .Ve
619 For C-shell:
620 .PP
621 .Vb 1
622 \& % setenv http_proxy "http://proxy.domain.com:8080/"
623 .Ve
624 Under Apache, you can add this directive to your configuration file:
625 .PP
626 .Vb 1
627 \& SetEnv http_proxy "http://proxy.domain.com:8080"
628 .Ve
629 but this has the default that another \s-1CGI\s0, or another program, can use
•630 this to access external resources. A better way is to edit Html2Wml and
631 fill the option \f(CW\*(C`proxy\-server\*(C'\fR with the appropriate value.
632 .SH "CAVEATS"
633 .IX Header "CAVEATS"
634 Html2Wml tries to make correct \s-1WML\s0 documents, but the well-formedness and the
635 validity of the document are not guarantied.
636 .PP
637 Inverted tags (like "<b>bold <i>italic</b></i>")
•638 may produce unexpected results. But only bad software do bad stuff like this.
639 .SH "LINKS"
640 .IX Header "LINKS"
641 .Sh "Download"
642 .IX Subsection "Download"
643 .Ip "Html2Wml" 4
644 .IX Item "Html2Wml"
645 This is the web site of the Html2Wml project, hosted by SourceForge.net.
646 All the stable releases can be downloaded from this site.
647 .Sp
648 [ http://www.html2wml.org/ ]
649 .Ip "Nutialand" 4
650 .IX Item "Nutialand"
651 This is the web site of the author, where you can find the archives of
652 all the releases of Html2Wml.
653 .Sp
654 [ http://www.maddingue.org/softwares/ ]
655 .Sh "Resources"
656 .IX Subsection "Resources"
657 .Ip "The \s-1WAP\s0 Forum" 4
658 .IX Item "The WAP Forum"
659 This is the official site of the \s-1WAP\s0 Forum. You can find some technical
660 information, as the specifications of all the technologies associated with
661 the \s-1WAP\s0.
662 .Sp
663 [ http://www.wapforum.org/ ]
664 .Ip "\s-1WAP\s0.com" 4
665 .IX Item "WAP.com"
666 This site has some useful information and links. In particular, it has
667 a quite well done \s-1FAQ\s0.
668 .Sp
669 [ http://www.wap.com/ ]
670 .Ip "The World Wide Web Consortium" 4
671 .IX Item "The World Wide Web Consortium"
•672 Although not directly related to the Wap stuff, you may find useful
673 to read the specifications of the \s-1XML\s0 (\s-1WML\s0 is an \s-1XML\s0 application), and the
674 specifications of the different stylesheet languages (\s-1CSS\s0 and \s-1XSL\s0), which
675 include support for low-resolution devices.
676 .Sp
677 [ http://www.w3.org/ ]
678 .Ip "TuxMobil" 4
679 .IX Item "TuxMobil"
680 This web site is dedicated to Mobile UniX systems. It leads you to a lot
681 of useful hands-on information about installing and running Linux and \s-1BSD\s0 on
682 laptops, PDAs and other mobile computer devices.
683 .Sp
684 [ http://www.tuxmobil.org/ ]
685 .Sh "Programmers utilities"
686 .IX Subsection "Programmers utilities"
687 .Ip "\s-1HTML\s0 Tidy" 4
688 .IX Item "HTML Tidy"
689 This is a very handful utility which corrects your \s-1HTML\s0 files
690 so that they conform to W3C standards.
691 .Sp
692 [ http://www.w3.org/People/Raggett/tidy ]
693 .Ip "Kannel" 4
694 .IX Item "Kannel"
695 Kannel is an open source Wap and \s-1SMS\s0 gateway.
696 A \s-1WML\s0 compiler is included in the distribution.
697 .Sp
698 [ http://www.kannel.org/ ]
699 .Ip "\s-1WML\s0 Tools" 4
700 .IX Item "WML Tools"
701 This is a collection of utilities for \s-1WML\s0 programmers. This include
702 a compiler, a decompiler, a viewer and a \s-1WBMP\s0 converter.
703 .Sp
704 [ http://pwot.co.uk/wml/ ]
705 .Sh "\s-1WML\s0 browsers and Wap emulators"
706 .IX Subsection "WML browsers and Wap emulators"
707 .Ip "Opera" 4
708 .IX Item "Opera"
709 Opera is originaly a Web browser, but the version 5 has a good support
710 for \s-1XML\s0 and \s-1WML\s0. Opera is available for free for several systems.
711 .Sp
712 [ http://www.opera.com/ ]
713 .Ip "wApua" 4
714 .IX Item "wApua"
715 wApua is an open source \s-1WML\s0 browser written in Perl/Tk.
•716 It's easy to install and to use. Its support for \s-1WML\s0 is incomplete,
717 but sufficient for testing purpose.
718 .Sp
719 [ http://fsinfo.cs.uni-sb.de/~abe/wApua/ ]
720 .Ip "Tofoa" 4
721 .IX Item "Tofoa"
722 Tofoa is an open source Wap emulator written in Python.
723 Its installation is quite difficult, and its incomplete \s-1WML\s0 support
724 makes it produce strange results, even with valid \s-1WML\s0 documents.
725 .Sp
726 [ http://tofoa.free-system.com/ ]
727 .Ip "EzWAP" 4
728 .IX Item "EzWAP"
729 EzWAP, from \s-1EZOS\s0, is a commercial \s-1WML\s0 browser freely available for
730 Windows 9x, \s-1NT\s0, 2000 and \s-1CE\s0. Compared to others Windows \s-1WML\s0 browsers,
731 it requires very few resources, and is quite stable. Its support for
732 the \s-1WML\s0 specs seems quite complete. A very good software.
733 .Sp
734 [ http://www.ezos.com/ ]
735 .Ip "Deck-It" 4
736 .IX Item "Deck-It"
737 Deck-It is a commercial Wap phone emulator, available for Windows and
738 Linux/Intel only. It's a very good piece of software which really
739 show how \s-1WML\s0 pages are rendered on a Wap phone, but one of its
740 major default is that it cannot read local files.
741 .Sp
742 [ http://www.pyweb.com/tools/ ]
743 .Ip "Klondike \s-1WAP\s0 Browser" 4
744 .IX Item "Klondike WAP Browser"
745 Klondike \s-1WAP\s0 Browser is a commercial \s-1WAP\s0 browser available for Windows
746 and PocketPC.
747 .Sp
748 [ http://www.apachesoftware.com/ ]
749 .Ip "WinWAP" 4
750 .IX Item "WinWAP"
751 WinWAP is a commercial Wap browser, freely available for Windows.
752 .Sp
753 [ http://www.winwap.org/ ]
754 .Ip "WAPman" 4
755 .IX Item "WAPman"
756 WAPman from EdgeMatrix, is a commercial \s-1WAP\s0 browser available for
757 Windows and PalmOS.
758 .Sp
759 [ http://www.edgematrix.com/edge/control/MainContentBean?page=downloads ]
760 .Ip "Wireless Companion" 4
761 .IX Item "Wireless Companion"
762 Wireless Companion, from YourWap.com, is a \s-1WAP\s0 emulator available
763 for Windows.
764 .Sp
765 [ http://www.yourwap.com/ ]
766 .Ip "Mobilizer" 4
767 .IX Item "Mobilizer"
768 Mobilizer is a Wap emulator available for Windows and Unix.
769 .Sp
770 [ http://mobilizer.sourceforge.net/ ]
771 .Ip "QWmlBrowser" 4
772 .IX Item "QWmlBrowser"
773 QWmlBrowser (formerly known as \s-1WML\s0 BRowser) is an open source
774 \&\s-1WML\s0 browser, written using the Qt toolkit.
775 .Sp
776 [ http://www.wmlbrowser.org/ ]
777 .Ip "Wapsody" 4
778 .IX Item "Wapsody"
779 Wapsody, developed by \s-1IBM\s0, is a freely available simulation
780 environment that implements the \s-1WAP\s0 specification. It also
781 features a \s-1WML\s0 browser which can be run stand-alone.
782 As Wapsody is written in Java/Swing, it should work on any
783 system.
784 .Sp
785 [ http://alphaworks.ibm.com/aw.nsf/techmain/wapsody ]
786 .Ip "WAPreview" 4
787 .IX Item "WAPreview"
788 WAPreview is a Wap emulator written in Java. As it uses an \s-1HTML\s0
789 based \s-1UI\s0 and needs a local web proxy, it runs quite slowly.
790 .Sp
791 [ http://wapreview.sourceforge.net ]
792 .Ip "PicoWap" 4
793 .IX Item "PicoWap"
794 PicoWap is a small \s-1WML\s0 browser made by three French students.
795 .Sp
796 [ http://membres.lycos.fr/picowap/ ]
797 .SH "ACKNOWLEDGEMENTS"
798 .IX Header "ACKNOWLEDGEMENTS"
799 Werner Heuser, for his numerous ideas, advices and his help for the debugging
800 .PP
801 Igor Khristophorov, for his numerous suggestions and patches
802 .PP
803 And all the people that send me bug reports: Daniele Frijia, Axel Jerabek, Ouyang
804 .SH "AUTHOR"
805 .IX Header "AUTHOR"
806 Se\*'bastien Aperghis-Tramoni <[email protected]<gt>
807 .SH "COPYRIGHT"
808 .IX Header "COPYRIGHT"
809 Copyright (C)2000, 2001, 2002 Se\*'bastien Aperghis-Tramoni
810 .PP
811 This program is free software. You can redistribute it and/or modify it
812 under the terms of the \s-1GNU\s0 General Public License, version 2 or later.