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