File: readme.html

package info (click to toggle)
html2wml 0.4.11%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 816 kB
  • sloc: perl: 2,380; ansic: 56; makefile: 34; sh: 4
file content (749 lines) | stat: -rw-r--r-- 33,949 bytes parent folder | download
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
<html>
<head>
<title>"Html2Wml Documentation"</title>
<link rel="stylesheet" href="style.css" type="text/css">
<link rev="made" href="mailto:root@fisheye.uucp">
</head>

<body>

<a name="__index__"></a>
<!-- INDEX BEGIN -->

<ul id="index"><b>Table of contents</b>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#options">OPTIONS</a></li>
	<ul>

		<li><a href="#conversion options">Conversion Options</a></li>
		<li><a href="#links reconstruction options">Links Reconstruction Options</a></li>
		<li><a href="#splitting options">Splitting Options</a></li>
		<li><a href="#http authentication">HTTP Authentication</a></li>
		<li><a href="#proxy support">Proxy Support</a></li>
		<li><a href="#output options">Output Options</a></li>
		<li><a href="#debugging options">Debugging Options</a></li>
	</ul>

	<li><a href="#deck slicing">DECK SLICING</a></li>
	<ul>

		<li><a href="#slice by cards or by decks">Slice by cards or by decks</a></li>
		<li><a href="#note on size calculation">Note on size calculation</a></li>
		<li><a href="#why compiling the wml deck">Why compiling the WML deck?</a></li>
	</ul>

	<li><a href="#actions">ACTIONS</a></li>
	<ul>

		<li><a href="#syntax">Syntax</a></li>
		<li><a href="#available actions">Available actions</a></li>
		<li><a href="#generic parameters">Generic parameters</a></li>
		<li><a href="#examples">Examples</a></li>
	</ul>

	<li><a href="#links reconstruction">LINKS RECONSTRUCTION</a></li>
	<ul>

		<li><a href="#templates">Templates</a></li>
		<li><a href="#syntax">Syntax</a></li>
		<li><a href="#available parameters">Available parameters</a></li>
		<li><a href="#examples">Examples</a></li>
	</ul>

	<li><a href="#proxy support">PROXY SUPPORT</a></li>
	<li><a href="#caveats">CAVEATS</a></li>
	<li><a href="#links">LINKS</a></li>
	<ul>

		<li><a href="#download">Download</a></li>
		<li><a href="#resources">Resources</a></li>
		<li><a href="#programmers utilities">Programmers utilities</a></li>
		<li><a href="#wml browsers and wap emulators">WML browsers and Wap emulators</a></li>
	</ul>

	<li><a href="#acknowledgements">ACKNOWLEDGEMENTS</a></li>
	<li><a href="#author">AUTHOR</a></li>
	<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<!-- INDEX END -->

<HR>
<p>
<h1><a name="name">NAME</a></h1>
<p>Html2Wml -- Program that can convert HTML pages to WML pages</p>
<p>
<hr>
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>Html2Wml can be used as either a shell command:</p>
<pre>
  $ html2wml file.html</pre>
<p>or as a CGI:</p>
<pre>
  /cgi-bin/html2wml.cgi?url=/index.html</pre>
<p>In both cases, the file can be either a local file or a URL.</p>
<p>
<hr>
<h1><a name="description">DESCRIPTION</a></h1>
<p>Html2Wml converts HTML pages to WML decks, suitable for being viewed on a
Wap device. The program can be launched from a shell to statically convert 
a set of pages, or as a CGI to convert a particular (potentially dynamic) 
HTML resource.</p>
<p>Althought the result is not guarantied to be valid WML, it should be the 
case for most pages. Good HTML pages will most probably produce valid 
WML decks. To check and correct your pages, you can use W3C's softwares: 
the <em>HTML Validator</em>, available online at <a href="http://validator.w3.org">http://validator.w3.org</a> 
and <em>HTML Tidy</em>, written by Dave Raggett.</p>
<p>Html2Wml provides the following features:</p>
<UL>
<li>
translation of the links
<p></p>
<li>
limitation of the cards size by splitting the result into several cards
<p></p>
<li>
inclusion of files (similar to the SSI)
<p></p>
<li>
compilation of the result (using the WML Tools, see <a href="#links">LINKS</a>)
<p></p>
<li>
a debug mode to check the result using validation functions
<p></p></UL>
<p>
<hr>
<h1><a name="options">OPTIONS</a></h1>
<p>Please note that most of these options are also available when calling 
Html2Wml as a CGI. In this case, boolean options are given the value 
``1'' or ``0'', and other options simply receive the value they 
expect. For example, <code>--ascii</code> becomes <code>?ascii=1</code> or <code>?a=1</code>. See the 
file <em>t/form.html</em> for an example on how to call Html2Wml as a CGI.</p>
<p>
<h2><a name="conversion options">Conversion Options</a></h2>
<DL>
<dt><strong><a name="item_%2Da%2C_%2D%2Dascii">-a, --ascii</a></strong><br>
<dd>
When this option is on, named HTML entities and non-ASCII characters are 
converted to US-ASCII characters using the same 7 bit approximations as 
Lynx. For example, <code>&amp;copy;</code> is translated to ``(c)'', and <code>&amp;szlig;</code> is 
translated to ``ss''. This option is off by default.
<p></p>
<dt><strong><a name="item_%2D%2D%5Bno%5Dcollapse">--[no]collapse</a></strong><br>
<dd>
This option tells Html2Wml to collapse redundant whitespaces,
tabulations, carriage returns, lines feeds and empty paragraphs. The aim
is to reduce the size of the WML document as much as possible. Collapsing
empty paragraphs is necessary for two reasons. First, this avoids empty
screens (and on a device with only 4 lines of display, an empty screen can 
be quite ennoying). Second, Html2wml creates many empty paragraphs when
converting, because of the way the syntax reconstructor is programmed.
Deleting these empty paragraphs is necessary like cleaning the kitchen :-)
<p>If this really bother you, you can desactivate this behaviour with the
<strong>--nocollapse</strong> option.</p>
<p></p>
<dt><strong><a name="item_%2D%2Dignore%2Dimages">--ignore-images</a></strong><br>
<dd>
This option tells Html2Wml to completly ignore all image links.
<p></p>
<dt><strong><a name="item_%2D%2D%5Bno%5Dimg%2Dalt%2Dtext">--[no]img-alt-text</a></strong><br>
<dd>
This option tells Html2Wml to replace the image tags with their 
corresponding alternative text (as with a text mode web browser). 
This option is on by default.
<p></p>
<dt><strong><a name="item_%2D%2D%5Bno%5Dlinearize">--[no]linearize</a></strong><br>
<dd>
This option is on by default. This makes Html2Wml flattens the HTML
tables (they are linearized), as Lynx does. I think this is better than
trying to use the native WML tables. First, they have extremely limited
features and possibilities compared to HTML tables. In particular, they
can't be nested. In fact this is normal because Wap devices are not
supposed to have a big CPU running at some zillions-hertz, and the
calculations needed to render the tables are the most complicated and
CPU-hogger part of HTML.
<p>Second, as they can't be nested, and as typical HTML pages heavily use 
imbricated tables to create their layout, it's impossible to decide which 
one could be kept. So the best thing is to keep none of them.</p>
<p><strong>[Note]</strong> Although you can desactivate this behaviour, and although 
there is internal support for tables, the unlinearized mode has not 
been heavily tested with nested tables, and it may produce unexpected 
results.</p>
<p></p>
<dt><strong><a name="item_%2Dn%2C_%2D%2Dnumeric%2Dnon%2Dascii">-n, --numeric-non-ascii</a></strong><br>
<dd>
This option tells Html2wml to convert all non-ASCII characters to 
numeric entities, i.e., ``&eacute;'' becomes <code>&amp;#233;</code>, and ``&szlig;'' 
becomes <code>&amp;#223;</code>.  By default, this option is off.
<p></p>
<dt><strong><a name="item_%2Dp%2C_%2D%2Dnopre">-p, --nopre</a></strong><br>
<dd>
This options tells Html2Wml not to use the &lt;pre&gt;
tag. This option was added because the compiler from WML Tools 0.0.4 
doesn't support this tag.
<p></p></DL>
<p>
<h2><a name="links reconstruction options">Links Reconstruction Options</a></h2>
<DL>
<dt><strong><a name="item_%2D%2Dhreftmpl%3DTEMPLATE">--hreftmpl=<em>TEMPLATE</em></a></strong><br>
<dd>
This options sets the template that will be used to reconstruct the
<code>href</code>-type links. See <a href="#links reconstruction">LINKS RECONSTRUCTION</a> for more information.
<p></p>
<dt><strong><a name="item_%2D%2Dsrctmpl%3DTEMPLATE">--srctmpl=<em>TEMPLATE</em></a></strong><br>
<dd>
This option sets the template that will be used to reconstruct the
<code>src</code>-type links. See <a href="#links reconstruction">LINKS RECONSTRUCTION</a> for more information.
<p></p></DL>
<p>
<h2><a name="splitting options">Splitting Options</a></h2>
<DL>
<dt><strong><a name="item_%2Ds%2C_%2D%2Dmax%2Dcard%2Dsize%3DSIZE">-s, --max-card-size=<em>SIZE</em></a></strong><br>
<dd>
This option allows you to limit the size (in bytes) of the generated
cards. Default is 1,500 bytes, which should be small enought to be loaded
on most Wap devices. See <a href="#deck slicing">DECK SLICING</a> for more information.
<p></p>
<dt><strong><a name="item_%2Dt%2C_%2D%2Dcard%2Dsplit%2Dthreshold%3DSIZE">-t, --card-split-threshold=<em>SIZE</em></a></strong><br>
<dd>
This option sets the threshold of the split event, which can occur 
when the size of the current card is between <code>max-card-size</code> - 
<code>card-split-threshold</code> and <code>max-card-size</code>. Default value is 
50. See <a href="#deck slicing">DECK SLICING</a> for more information.
<p></p>
<dt><strong><a name="item_%2D%2Dnext%2Dcard%2Dlabel%3DSTRING">--next-card-label=<em>STRING</em></a></strong><br>
<dd>
This options sets the label of the link that points to the next card. 
Default is ``[&amp;gt;&amp;gt;]'', which whill be rendered as ``[&gt;&gt;]''.
<p></p>
<dt><strong><a name="item_%2D%2Dprev%2Dcard%2Dlabel%3DSTRING">--prev-card-label=<em>STRING</em></a></strong><br>
<dd>
This options sets the label of the link that points to the previous card. 
Default is ``[&amp;lt;&amp;lt;]'', which whill be rendered as ``[&lt;&lt;]''.
<p></p></DL>
<p>
<h2><a name="http authentication">HTTP Authentication</a></h2>
<DL>
<dt><strong><a name="item_%2DU%2C_%2D%2Dhttp%2Duser%3DUSERNAME">-U, --http-user=<em>USERNAME</em></a></strong><br>
<dd>
Use this option to set the username for an authenticated request.
<p></p>
<dt><strong><a name="item_%2DP%2C_%2D%2Dhttp%2Dpasswd%3DPASSWORD">-P, --http-passwd=<em>PASSWORD</em></a></strong><br>
<dd>
Use this option to set the password for an authenticated request.
<p></p></DL>
<p>
<h2><a name="proxy support">Proxy Support</a></h2>
<DL>
<dt><strong><a name="item_%2D%5Bno%5DY%2C_%2D%2D%5Bno%5Dproxy">-[no]Y, --[no]proxy</a></strong><br>
<dd>
Use this option to activate proxy support. By default, proxy support 
is activated. See <a href="#proxy support">PROXY SUPPORT</a>.
<p></p></DL>
<p>
<h2><a name="output options">Output Options</a></h2>
<DL>
<dt><strong><a name="item_%2Dk%2C_%2D%2Dcompile">-k, --compile</a></strong><br>
<dd>
Setting this option tells Html2Wml to use the compiler from WML Tools
to compile the WML deck. If you want to create a real Wap site, you should
seriously use this option in order to reduce the size of the WML decks. 
Remember that Wap devices have very little amount of memory. If this is
not enought, use the splitting options.
<p>Take a look in <em>wml_compilation/</em> for more information on how to use 
a WML compiler with Html2Wml.</p>
<p></p>
<dt><strong><a name="item_%2Do%2C_%2D%2Doutput">-o, --output</a></strong><br>
<dd>
Use this option (in shell mode) to specify an output file. 
By default, Html2Wml prints the result to standard output.
<p></p></DL>
<p>
<h2><a name="debugging options">Debugging Options</a></h2>
<DL>
<dt><strong><a name="item_%2Dd%2C_%2D%2Ddebug%5B%3DLEVEL%5D">-d, --debug[=<em>LEVEL</em>]</a></strong><br>
<dd>
This option activates the debug mode. This prints the output result 
with line numbering and with the result of the XML check. If the WML 
compiler was called, the result is also printed in hexadecimal an ascii 
forms. When called as a CGI, all of this is printed as HTML, so that can 
use any web browser for that purpose.
<p></p>
<dt><strong><a name="item_%2D%2Dxmlcheck">--xmlcheck</a></strong><br>
<dd>
When this option is on, it send the WML output to XML::Parser to check 
its well-formedness.
<p></p></DL>
<p>
<hr>
<h1><a name="deck slicing">DECK SLICING</a></h1>
<p>The <em>deck slicing</em> is a feature that Html2Wml provides in order to 
match the low memory capabilities of most Wap devices. Many can't handle
cards larger than 2,000 bytes, therefore the cards must be sufficiently
small to be viewed by all Wap devices. To achieve this, you should compile
your WML deck, which reduce the size of the deck by 50%, but even then your
cards may be too big. This is where Html2Wml comes with the deck slicing
feature. This allows you to limit the size of the cards, currently only
<em>before</em> the compilation stage.</p>
<p>
<h2><a name="slice by cards or by decks">Slice by cards or by decks</a></h2>
<p>On some Wap phones, slicing the deck is not sufficient: the WML browser 
still tries to download the whole deck instead of just picking one 
card at a time. A solution is to slice the WML document by decks. 
See the figure below.</p>
<pre>
     _____________          _____________ 
    |    deck     |        |   deck #1   |
    |  _________  |        |  _________  |
    | | card #1 | |        | |  card   | |
    | |_________| |        | |_________| |
    |  _________  |        |_____________|
    | | card #2 | |        
    | |_________| |             . . .
    |  _________  |        
    | |   ...   | |         _____________
    | |_________| |        |   deck #n   |
    |  _________  |        |  _________  |
    | | card #n | |        | |  card   | |
    | |_________| |        | |_________| |
    |_____________|        |_____________|


      WML document           WML document
    sliced by cards        sliced by decks</pre>
<p>What this means is that Html2Wml generates several WML documents. 
In CGI mode, only the appropriate deck is sent, selected by the id 
given in parameter. If no id was given, the first deck is sent.</p>
<p>
<h2><a name="note on size calculation">Note on size calculation</a></h2>
<p>Currently, Html2Wml estimates the size of the card on the fly, by 
summing the length of the strings that compose the WML output, texts and 
tags. I say ``estimates'' and not ``calculates'' because computing the exact 
size would require many more calculations than the way it is done now. 
One may objects that there are only additions, which is correct, but knowing 
the <em>exact</em> size is not necessary. Indeed, if you compile the WML, most of 
the strings of the tags will be removed, but not all.</p>
<p>For example, take an image tag: 
<code>&lt;img src=&quot;images/dog.jpg&quot; alt=&quot;Photo of a dog&quot;&gt;</code>. 
When compiled, the string <code>&quot;img&quot;</code> will be replaced by a one byte value. 
Same thing for the strings <code>&quot;src&quot;</code> and <code>&quot;alt&quot;</code>, and the spaces, double 
quotes and equal signs will be stripped. Only the text between double quote 
will be preserved... but not in every cases. 
Indeed, in order to go a step further, the compiler can also encode 
parts of the arguments as binary. For example, the string <code>&quot;http://www.&quot;</code> 
can be encoded as a single byte (<code>8F</code> in this case). Or, if the attribute 
is <code>href</code>, the string <code>href=&quot;http://</code> can become the byte <code>4B</code>.</p>
<p>As you see, it doesn't matter to know exactly the size of the textual
form of the WML, as it will always be far superior to the size of the
compiled form. That's why I don't count all the characters that may be
actually written.</p>
<p>Also, it's because I'm quite lazy ;-)</p>
<p>
<h2><a name="why compiling the wml deck">Why compiling the WML deck?</a></h2>
<p>If you intent to create real WML pages, you should really 
consider to always compile them. If you're not convinced, here is an 
illustration.</p>
<p>Take the following WML code snipet:</p>
<pre>
    &lt;a href='<a href="http://www.yahoo.com/">http://www.yahoo.com/</a>'&gt;Yahoo!&lt;/a&gt;</pre>
<p>It's the basic and classical way to code an hyperlink. It takes 42 bytes
to code this, because it is presented in a human-readable form.</p>
<p>The WAP Forum has defined a compact binary representation of WML in its
specification, which is called ``compiled WML''. It's a binary format, 
therefore you, a mere human, can't read that, but your computer can. And 
it's much faster for it to read a binary format than to read a textual 
format.</p>
<p>The previous example would be, once compiled (and printed here as 
hexadecimal):</p>
<pre>
    1C 4A 8F 03 y a h o o 00 85 01 03 Y a h o o ! 00 01</pre>
<p>This only takes 21 bytes. Half the size of the human-readable form. 
For a Wap device, this means both less to download, and easier things 
to read. Therefore the processing of the document can be achieved in 
a short time compared to the tectual version of the same document.</p>
<p>There is a last argument, and not the less important: many Wap devices
only read binary WML.</p>
<p>
<hr>
<h1><a name="actions">ACTIONS</a></h1>
<p>Actions are a feature similar to (but with far less functionalities!) the
SSI (Server Side Includes) available on good servers like Apache. In order
not to interfere with the real SSI, but to keep the syntax easy to learn,
it differs in very few points.</p>
<p>
<h2><a name="syntax">Syntax</a></h2>
<p>Basically, the syntax to execute an action is:</p>
<pre>
    &lt;!-- [action param1=&quot;value&quot; param2='value'] --&gt;</pre>
<p>Note that the angle brackets are part of the syntax. Except for that
point, Actions syntax is very similar to SSI syntax.</p>
<p>
<h2><a name="available actions">Available actions</a></h2>
<p>Only few actions are currently available, but more can be implemented
on request.</p>
<DL>
<dt><strong><a name="item_include">include</a></strong><br>
<dd>
<DL>
<dt><strong><a name="item_Description">Description</a></strong><br>
<dd>
Includes a file in the document at the current point. Please note
that Html2Wml doesn't check nor parse the file, and if the file 
cannot be found, will silently die (this is the same behavior as SSI).
<p></p>
<dt><strong><a name="item_Parameters">Parameters</a></strong><br>
<dd>
<code>virtual=url</code> -- The file is get by http.
<p><code>file=path</code> -- The file is read from the local disk.</p>
<p></p></DL>
<dt><strong><a name="item_fsize">fsize</a></strong><br>
<dd>
<DL>
<dt><strong>Description</strong><br>
<dd>
Returns the size of a file at the current point of the document.
<p></p>
<dt><strong>Parameters</strong><br>
<dd>
<code>virtual=url</code> -- The file is get by http.
<p><code>file=path</code> -- The file is read from the local disk.</p>
<p></p>
<dt><strong><a name="item_Notes">Notes</a></strong><br>
<dd>
If you use the file parameter, an absolute path is recommend.
<p></p></DL>
<dt><strong><a name="item_skip">skip</a></strong><br>
<dd>
<DL>
<dt><strong>Description</strong><br>
<dd>
Skips everything until the first <code>end_skip</code> action.
<p></p></DL>
</DL>
<p>
<h2><a name="generic parameters">Generic parameters</a></h2>
<p>The following parameters can be used for any action.</p>
<DL>
<dt><strong><a name="item_for%3Doutput_format">for=<em>output format</em></a></strong><br>
<dd>
This paramater restricts the action for the given output format. 
Currently, the only available format is ``<code>wml</code>'' (when using <code>html2chtml</code> 
the format is ``<code>chtml</code>'').
<p></p></DL>
<p>
<h2><a name="examples">Examples</a></h2>
<p>If you want to share a navigation bar between several WML pages, you can
<a href="#item_include"><code>include</code></a> it this way:</p>
<pre>
    &lt;!-- [include virtual=&quot;nav.wml&quot;] --&gt;</pre>
<p>Of course, you have to write this navigation bar first :-)</p>
<p>If you want to use your current HTML pages for creating your WML pages, 
but that they contains complex tables, or unecessary navigation tables, 
etc, you can simply <a href="#item_skip"><code>skip</code></a> the complex parts and keep the rest.</p>
<pre>
    &lt;body&gt;
    &lt;!--[skip for=&quot;wml&quot;]--&gt;
    unecessary parts for the WML pages
    &lt;!--[end_skip]--&gt;
    useful parts for the WML pages
    &lt;/body&gt;</pre>
<p>
<hr>
<h1><a name="links reconstruction">LINKS RECONSTRUCTION</a></h1>
<p>The links reconstruction engine is IMHO the most important part of
Html2Wml, because it's this engine that allows you to reconstruct the 
links of the HTML document being converted. It has two modes, depending 
upon whether Html2Wml was launched from the shell or as a CGI.</p>
<p>When used as a CGI, this engine will reconstructs the links of the HTML 
document so that all the urls will be passed to Html2Wml in order to 
convert the pointed files (pages or images). This is completly automatic 
and can't be customized for now (but I don't think it would be really 
useful).</p>
<p>When used from the shell, this engine reconstructs the links with the 
given templates. Note that absolute URLs will be left untouched. The 
templates can be customized using the following syntax.</p>
<p>
<h2><a name="templates">Templates</a></h2>
<DL>
<dt><strong><a name="item_HREF_Template">HREF Template</a></strong><br>
<dd>
This template controls the reconstruction of the <code>href</code> attribute of 
the <code>A</code> tag. Its value can be changed using the <strong>--hreftmpl</strong> option. 
Default value is 
<code>&quot;{FILEPATH}{FILENAME}{$FILETYPE =~ s/s?html?/wml/o; $FILETYPE}&quot;</code>.
<p></p>
<dt><strong><a name="item_Image_Source_Template">Image Source Template</a></strong><br>
<dd>
This template controls the reconstruction of the <code>src</code> attribute of 
the <code>IMG</code> tag. Its value can be changed using the <strong>--srctmpl</strong> option. 
Default value is 
<code>&quot;{FILEPATH}{FILENAME}{$FILETYPE =~ s/gif|png|jpe?g/wbmp/o; $FILETYPE}&quot;</code>
<p></p></DL>
<p>
<h2><a name="syntax">Syntax</a></h2>
<p>The template is a string that contains the new URL. More precisely, it's 
a Text::Template template. Parameters can be interpolated as a constant 
or as a variable. The template is embraced between curcly bracets, and can 
contain any valid Perl code.</p>
<p>The simplest form of a template is <code>{PARAM}</code> which just returns the 
value of PARAM. If you want to do something more complex, you can use 
the corresponding variable; for example <code>{&quot;foo $PARAM bar&quot;}</code>, or 
<code>{join &quot;_&quot;, split &quot; &quot;, PARAM}</code>.</p>
<p>You may read <a href="/Text/Template.html">the Text::Template manpage</a> for more information on what is possible 
within a template.</p>
<p>If the original URL contained a query part or a fragment part, then they 
will be appended to the result of the template.</p>
<p>
<h2><a name="available parameters">Available parameters</a></h2>
<DL>
<dt><strong><a name="item_URL">URL</a></strong><br>
<dd>
This parameter contains the original URL from the <code>href</code> or <code>src</code>
attribute.
<p></p>
<dt><strong><a name="item_FILENAME">FILENAME</a></strong><br>
<dd>
This parameter contains the base name of the file.
<p></p>
<dt><strong><a name="item_FILEPATH">FILEPATH</a></strong><br>
<dd>
This parameter contains the leading path of the file.
<p></p>
<dt><strong><a name="item_FILETYPE">FILETYPE</a></strong><br>
<dd>
This parameter contains the suffix of the file.
<p></p></DL>
<p>This can be resumed this way:</p>
<pre>
  URL = <a href="http://www.server.net/path/to/my/page.html">http://www.server.net/path/to/my/page.html</a>
                             ------------^^^^ ----
                                 |        |     \
                                 |        |      \
                              FILEPATH FILENAME FILETYPE</pre>
<p>Note that <a href="#item_FILETYPE"><code>FILETYPE</code></a> contains all the extensions of the file, so if its name 
is <em>index.html.fr</em> for example, <a href="#item_FILETYPE"><code>FILETYPE</code></a> contains ``<code>.html.fr</code>''.</p>
<p>
<h2><a name="examples">Examples</a></h2>
<p>To add a path option:</p>
<pre>
    {URL}$wap</pre>
<p>Using Apache, you can then add a Rewrite directive so that URL ending with 
<code>$wap</code> will be redirected to Html2Wml:</p>
<pre>
    RewriteRule  ^(/.*)\$wap$  /cgi-bin/html2wml.cgi?url=$1</pre>
<p>To change the extension of an image:</p>
<pre>
    {FILEPATH}{FILENAME}.wbmp</pre>
<p>
<hr>
<h1><a name="proxy support">PROXY SUPPORT</a></h1>
<p>Html2Wml uses LWP built-in proxy support. It is activated by default, and 
loads the proxy settings from the environment variables, using the same 
variables as many others programs. Each protocol (http, ftp, etc) can be 
mapped to use a proxy server by setting a variable of the form <code>PROTOCOL_proxy</code>. 
Example: use <code>http_proxy</code> to define the proxy for http access, <code>ftp_proxy</code> 
for ftp access. In the shell, this is only a matter of defining the variable.</p>
<p>For Bourne shell:</p>
<pre>
    $ export http_proxy=&quot;<a href="http://proxy.domain.com:8080/&quot">http://proxy.domain.com:8080/&quot</a>;</pre>
<p>For C-shell:</p>
<pre>
    % setenv http_proxy &quot;<a href="http://proxy.domain.com:8080/&quot">http://proxy.domain.com:8080/&quot</a>;</pre>
<p>Under Apache, you can add this directive to your configuration file:</p>
<pre>
    SetEnv http_proxy &quot;<a href="http://proxy.domain.com:8080&quot">http://proxy.domain.com:8080&quot</a>;</pre>
<p>but this has the default that another CGI, or another program, can use 
this to access external ressources. A better way is to edit Html2Wml and 
fill the option <code>proxy-server</code> with the appropriate value.</p>
<p>
<hr>
<h1><a name="caveats">CAVEATS</a></h1>
<p>Html2Wml tries to make correct WML documents, but the well-formedness and the 
validity of the document are not guarantied.</p>
<p>Inverted tags (like ``&lt;b&gt;bold &lt;i&gt;italic&lt;/b&gt;&lt;/i&gt;'') 
may produce unexpected results. But only bad softwares do bad stuff like this.</p>
<p>
<hr>
<h1><a name="links">LINKS</a></h1>
<p>
<h2><a name="download">Download</a></h2>
<DL>
<dt><strong><a name="item_Html2Wml">Html2Wml</a></strong><br>
<dd>
This is the web site of the Html2Wml project, hosted by SourceForge.net. 
All the stable releases can be downloaded from this site.
<p>[ <a href="http://www.html2wml.org/">http://www.html2wml.org/</a> ]</p>
<p></p>
<dt><strong><a name="item_Nutialand">Nutialand</a></strong><br>
<dd>
This is the web site of the author, where you can find the archives of 
all the releases of Html2Wml.
<p>[ <a href="http://www.maddingue.org/softwares/">http://www.maddingue.org/softwares/</a> ]</p>
<p></p></DL>
<p>
<h2><a name="resources">Resources</a></h2>
<DL>
<dt><strong><a name="item_The_WAP_Forum">The WAP Forum</a></strong><br>
<dd>
This is the official site of the WAP Forum. You can find some technical 
information, as the specifications of all the technologies associated with 
the WAP.
<p>[ <a href="http://www.wapforum.org/">http://www.wapforum.org/</a> ]</p>
<p></p>
<dt><strong><a name="item_WAP%2Ecom">WAP.com</a></strong><br>
<dd>
This site has some useful information and links. In particular, it has 
a quite well done FAQ.
<p>[ <a href="http://www.wap.com/">http://www.wap.com/</a> ]</p>
<p></p>
<dt><strong><a name="item_The_World_Wide_Web_Consortium">The World Wide Web Consortium</a></strong><br>
<dd>
Altough not directly related to the Wap stuff, you may find useful 
to read the specifications of the XML (WML is an XML application), and the 
specifications of the different stylesheet languages (CSS and XSL), which 
include support for low-resolution devices.
<p>[ <a href="http://www.w3.org/">http://www.w3.org/</a> ]</p>
<p></p>
<dt><strong><a name="item_TuxMobil">TuxMobil</a></strong><br>
<dd>
This web site is dedicated to Mobile UniX systems. It leads you to a lot 
of useful hands-on information about installing and running Linux and BSD on 
laptops, PDAs and other mobile computer devices.
<p>[ <a href="http://www.tuxmobil.org/">http://www.tuxmobil.org/</a> ]</p>
<p></p></DL>
<p>
<h2><a name="programmers utilities">Programmers utilities</a></h2>
<DL>
<dt><strong><a name="item_HTML_Tidy">HTML Tidy</a></strong><br>
<dd>
This is a very handful utility which corrects your HTML files 
so that they conform to W3C standards.
<p>[ <a href="http://www.w3.org/People/Raggett/tidy">http://www.w3.org/People/Raggett/tidy</a> ]</p>
<p></p>
<dt><strong><a name="item_Kannel">Kannel</a></strong><br>
<dd>
Kannel is an open source Wap and SMS gateway. 
A WML compiler is included in the distribution.
<p>[ <a href="http://www.kannel.org/">http://www.kannel.org/</a> ]</p>
<p></p>
<dt><strong><a name="item_WML_Tools">WML Tools</a></strong><br>
<dd>
This is a collection of utilities for WML programmers. This include 
a compiler, a decompiler, a viewer and a WBMP converter.
<p>[ <a href="http://pwot.co.uk/wml/">http://pwot.co.uk/wml/</a> ]</p>
<p></p></DL>
<p>
<h2><a name="wml browsers and wap emulators">WML browsers and Wap emulators</a></h2>
<DL>
<dt><strong><a name="item_Opera">Opera</a></strong><br>
<dd>
Opera is originaly a Web browser, but the version 5 has a good support 
for XML and WML. Opera is available for free for several systems.
<p>[ <a href="http://www.opera.com/">http://www.opera.com/</a> ]</p>
<p></p>
<dt><strong><a name="item_wApua">wApua</a></strong><br>
<dd>
wApua is an open source WML browser written in Perl/Tk. 
It's easy to install and to use. Its support for WML is incomplete, 
but sufficient for testing purpose.
<p>[ <a href="http://fsinfo.cs.uni-sb.de/~abe/wApua/">http://fsinfo.cs.uni-sb.de/~abe/wApua/</a> ]</p>
<p></p>
<dt><strong><a name="item_Tofoa">Tofoa</a></strong><br>
<dd>
Tofoa is an open source Wap emulator written in Python. 
Its installation is quite difficult, and its incomplete WML support 
makes it produce strange results, even with valid WML documents.
<p>[ <a href="http://tofoa.free-system.com/">http://tofoa.free-system.com/</a> ]</p>
<p></p>
<dt><strong><a name="item_EzWAP">EzWAP</a></strong><br>
<dd>
EzWAP, from EZOS, is a commercial WML browser freely available for 
Windows 9x, NT, 2000 and CE. Compared to others Windows WML browsers, 
it requires very few resources, and is quite stable. Its support for 
the WML specs seems quite complete. A very good software.
<p>[ <a href="http://www.ezos.com/">http://www.ezos.com/</a> ]</p>
<p></p>
<dt><strong><a name="item_Deck%2DIt">Deck-It</a></strong><br>
<dd>
Deck-It is a commercial Wap phone emulator, available for Windows and 
Linux/Intel only. It's a very good piece of software which really 
show how WML pages are rendered on a Wap phone, but one of its 
major default is that it cannot read local files.
<p>[ <a href="http://www.pyweb.com/tools/">http://www.pyweb.com/tools/</a> ]</p>
<p></p>
<dt><strong><a name="item_Klondike_WAP_Browser">Klondike WAP Browser</a></strong><br>
<dd>
Klondike WAP Browser is a commercial WAP browser available for Windows 
and PocketPC.
<p>[ <a href="http://www.apachesoftware.com/">http://www.apachesoftware.com/</a> ]</p>
<p></p>
<dt><strong><a name="item_WinWAP">WinWAP</a></strong><br>
<dd>
WinWAP is a commercial Wap browser, freely available for Windows.
<p>[ <a href="http://www.winwap.org/">http://www.winwap.org/</a> ]</p>
<p></p>
<dt><strong><a name="item_WAPman">WAPman</a></strong><br>
<dd>
WAPman from EdgeMatrix, is a commercial WAP browser available for 
Windows and PalmOS.
<p>[ <a href="http://www.edgematrix.com/edge/control/MainContentBean?page=downloads">http://www.edgematrix.com/edge/control/MainContentBean?page=downloads</a> ]</p>
<p></p>
<dt><strong><a name="item_Wireless_Companion">Wireless Companion</a></strong><br>
<dd>
Wireless Companion, from YourWap.com, is a WAP emulator available 
for Windows.
<p>[ <a href="http://www.yourwap.com/">http://www.yourwap.com/</a> ]</p>
<p></p>
<dt><strong><a name="item_Mobilizer">Mobilizer</a></strong><br>
<dd>
Mobilizer is a Wap emulator available for Windows and Unix.
<p>[ <a href="http://mobilizer.sourceforge.net/">http://mobilizer.sourceforge.net/</a> ]</p>
<p></p>
<dt><strong><a name="item_QWmlBrowser">QWmlBrowser</a></strong><br>
<dd>
QWmlBrowser (formerly known as WML BRowser) is an open source 
WML browser, written using the Qt toolkit.
<p>[ <a href="http://www.wmlbrowser.org/">http://www.wmlbrowser.org/</a> ]</p>
<p></p>
<dt><strong><a name="item_Wapsody">Wapsody</a></strong><br>
<dd>
Wapsody, developed by IBM, is a freely available simulation 
environment that implements the WAP specification. It also 
features a WML browser which can be run stand-alone. 
As Wapsody is written in Java/Swing, it should work on any 
system.
<p>[ <a href="http://alphaworks.ibm.com/aw.nsf/techmain/wapsody">http://alphaworks.ibm.com/aw.nsf/techmain/wapsody</a> ]</p>
<p></p>
<dt><strong><a name="item_WAPreview">WAPreview</a></strong><br>
<dd>
WAPreview is a Wap emulator written in Java. As it uses an HTML 
based UI and needs a local web proxy, it runs quite slowly.
<p>[ <a href="http://wapreview.sourceforge.net">http://wapreview.sourceforge.net</a> ]</p>
<p></p>
<dt><strong><a name="item_PicoWap">PicoWap</a></strong><br>
<dd>
PicoWap is a small WML browser made by three French students.
<p>[ <a href="http://membres.lycos.fr/picowap/">http://membres.lycos.fr/picowap/</a> ]</p>
<p></p></DL>
<p>
<hr>
<h1><a name="acknowledgements">ACKNOWLEDGEMENTS</a></h1>
<p>Werner Heuser, for his numerous ideas, advices and his help for the debugging</p>
<p>Igor Khristophorov, for his numerous suggestions and patches</p>
<p>And all the people that send me bug reports: Daniele Frijia, Axel Jerabek, Ouyang</p>
<p>
<hr>
<h1><a name="author">AUTHOR</a></h1>
<p>S&eacute;bastien Aperghis-Tramoni &lt;<a href="mailto:sebastien@aperghis.net<gt>">sebastien@aperghis.net<gt></a></p>
<p>
<hr>
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright (C)2000, 2001, 2002 S&eacute;bastien Aperghis-Tramoni</p>
<p>This program is free software. You can redistribute it and/or modify it 
under the terms of the GNU General Public License, version 2 or later.</p>

</body>

</html>