[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: How to use tidy?
- From: Roland Rosenfeld <nospam@thanx>
- Date: Fri, 10 Mar 2000 14:14:31 +0100
On Fri, 10 Mar 2000, Denis Barbier wrote:
> > -E 'tidy -mq'
> > in my .wmlrc seems to do nearly what I expect.
> > Now I only have to write a wrapper, which changes the exit value of
> > tidy (at the moment it terminates with 1 on warnings)...
> > But I still think, that there should be some more elegant way to do
> > so, otherwise tidy doesn't need to be installed as wml_aux_tidy.
> When reading this thread i firstly agree. After some deeper
> thoughts, i believe the current situation is not so bad.
But it's inconsistent with the other epilog filters. In the wml
script I find the following code for epilog filters:
# run epilog filters
foreach $o (@outfiles) {
foreach $e (@opt_E) {
if ($e =~ m|^htmlinfo(.*)|) {
$e = "/usr/lib/wml/exec/wml_aux_htmlinfo$1";
}
elsif ($e =~ m|^weblint(.*)|) {
$e = "/usr/lib/wml/exec/wml_aux_weblint$1";
}
elsif ($e =~ m|^linklint(.*)|) {
$e = "/usr/lib/wml/exec/wml_aux_linklint$1";
$e .= " -nocache -one -summary" if ($1 eq '');
}
&verbose(2, "EPILOG: $e $o\n");
$rc = system("$e $o");
if ($rc != 0) {
print STDERR "** WML:Error: epilog failed: $e $o\n";
exit(1);
}
}
}
Shouldn't you add something like this:
elsif ($e =~ m|^tidy(.*)|) {
$e = "/usr/lib/wml/exec/wml_aux_tidy$1";
$e .= " -mq" if ($1 eq '');
}
And maybe change of the $rc check, not to exit on warnings (return
value 1 of tidy, an error is signaled by return value 2).
> There should be a note in documentation explaining how to use
> post-processors (so called epilog filters).
There is a note about it in wml(1):
-E, --epilog=PATH
Runs an epilogue filter over the finally resulting
output files. Currently the following WML-specific
filters are known: htmlinfo, weblint and linklint.
But you can specify any program which is available in
your PATH. This program receives the file to act on
as its first command line argument.
But it doesn't give a hint on tidy, especially the need to use the -m
option of tidy is missing. Maybe the name "filter" is somewhat wrong
here, because a filter means that it reads something on stdin, changes
it, and writes the changed version on stdout. But -E only runs the
perl system() call with the program and the HTML file as parameters.
Tschoeeee
Roland
--
* roland@spinnaker.de * http://www.spinnaker.de/ *
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com