aww news
Description
Download
WML

SourceForge.net Logo




NAME

html2wml - generates wml-files from html-files

Without special options it grabs everything between the <body> ... </body> tags and saves it to the corresponding filename.wml

This program is part of aww - see 'man aww' for further information.


SYNOPSIS

  html2wml [-t|-o|-s|-k|-l|-d|-e|-f] <html files to convert>
      -t: tag that you want the content of (body tag is the standard)
      -o: output file (only for a single input-file)
      -s: suffix of output files (not possible with -o)
      -k: parts to keep outside <tag>...</tag>
      -l: lines to keep outside <tag>...</tag>
      -d: parts to delete inside <tag>...</tag>
      -e: lines to delete inside <tag>...</tag>
      -f: overwrite existing files without asking


DESCRIPTION

This program is very helpful to integrate existing webpages into webpages, that are generated with wml and especially aww. Using wml, you normally define a main template file for header and footer of all your webpages and put only the content inside the wml files. For already exisiting webpages you need to get rid of the header and footer of the html-files - and thats the purpose of html2wml.

Without using any options, html2wml scans the inputfile (e.g. NewPage.html) and saves everything between <body> ... </body> to the outputfile (NewPage.wml).

Before use, please run html2wml once without options. A main config file ($HOME/.aww/h2wconfig) is written, were you can change the standard behaviour of html2wml.


OPTIONS

-t, --tag (e.g. '-t div' or '--tag=``title''')
allows you to change the tag, of which you want the content. Standard is the body tag: <body> ... </body>

-o, --output (e.g. '-o Newfile_Bar.foo')
saves the output to the given file. (works only for a single inputfile)

-s, --suffix (e.g. '--suffix=``.incl''')

changes the suffix of the outputfiles. '.wml' is set as standard.
-k, --keep (e.g. '--keep=``<a.*</a>''' to keep all links)
Scans all parts outside of <tag>...</tag> (including the tag and its options) and keeps them if the given pattern matches. You can use several keeps (e.g. '--keep=``function'' --keep=``document''') and the alphabetic case is ignored (because it's HTML).

-l, --keepline (e.g. '-l DOCTYPE' to keep the doctype line)
Scans all parts outside of <tag>...</tag> (including the tag and its options) and keeps the complete line if the given pattern matches in the line. You can use several keeplines.

-d, --delete (e.g. '--delete=``<HR>''' to delete all rules)
Scans all parts inside of <tag>...</tag> (excluding the tags) and deletes the matching patterns. You can use several deletes.

-e, --deleteline (e.g. '-e div' to delete all div's)
Scans all parts inside of <tag>...</tag> (excluding the tags) and deletes the complete line if the given pattern matches. You can use several deletelines.

-f, --force
This flag allows to overwrite existing outputfiles without being asked.


REQUIREMENTS

You need the perl module Getopt::Long (you can find this module at http://cpan.perl.org).


COPYRIGHT

Copyright (C) 2004 - 2006 by Michael Schilling <aww [at] 42nd (period) de>, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


SEE ALSO

the aww manpage


BUGS

This software is still in a development state. Despite the programmer himself uses this software, it is tested only very limited. Thats why there are probably a lot of bugs, and so this software comes with absolut no warranty!

42nd.design || webmaster