[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: How to use tidy?

On Fri, 10 Mar 2000, Roland Rosenfeld wrote:

> 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.

I do not use tidy and were asked to put it into WML. Some people find
this tool very useful, so i have no reason to remove it now.

> In the wml script I find the following code for epilog filters:
> 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 '');
>             }

Indeed, thanks for this point.
Are you sure that -q should be the default? What do other tidy users
think about this proposition?

> 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).

Ok, i'll take care of that.

> > 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.

Yes, that is why i called it post-processor in my previous post. I will
write ``epilogue program'' unless it hurts some ears.

Denis Barbier
WML Maintainer

Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com