Debian Codegraph @

doc/readme.html

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