NAME

HTML::Lint::Messages - perl module encapsulating weblint output messages

SYNOPSIS

use HTML::Lint::Messages;

my $msg = HTML::Lint::Messages->new();
$msg->whine('title-length');

DESCRIPTION

HTML::Lint::Messages is a class which provides access to the messages output by weblint (warnings, error messages, and stylistic comments).

By default this module is used by the HTML::Lint module, so unless you're doing something fancy, you don't need to know about it.

METHODS

CONSTRUCTOR

The constructor doesn't take any arguments, so is used as follows:

use HTML::Lint::Messages;

$messages = HTML::Lint::Messages->new();

whine

Generate an output message:

$messages->whine( ID, argument1 ... argumentN );

The first argument is a string which identifies the message. This is followed by zero or more message-specific arguments, which get interpolated into the message.

reset_defaults

This method will reset the configuration of the module to the defaults built in:

$messages = HTML::Lint::Messages->new();
... do some things ...
$messages->reset_defaults();

message_format

Set the format of message which will be output:

$messages->message_format( MF_TERSE );

There are three message formats currently supported. The identifiers for the three formats are defined in the HTML::Lint::Constants module. The three message formats are:

MF_LINT

This is the standard lint format, which is used by default. The format is:

filename(line): message
MF_TERSE

This is meant mainly for automatic processing of weblint output; the format is:

filename:line:message
MF_SHORT

This is a shortened format, which doesn't include the filename. It is useful in places where the filename is temporary:

line N: message

enable

class_enable

output_handle

Set the filehandle which messages should be written to.

$messages = HTML::Lint::Messages->new();
$FILE = new IO::File("> file.out");
$old = $messages->output_handle($FILE);

This method returns the previous filehandle. The method can be used without any argument to query the current filehandle.

$cur_handle = $messages->output_handle();

By default this is set to standard output (STDOUT).

class_enable

pedantic

Hmm, just thought, this should be a meta class. Maybe should have flags, so you can enable (PEDANTIC | INTERNAL).

OK, this method is likely to go away :-)

set_message_handler

SEE ALSO

HTML::Lint

The weblint module.

http://www.weblint.org/

The weblint web site, where you can always get the latest version of weblint.

AUTHOR

Andy Lester <andy@petdance.com>

COPYRIGHT

Copyright (c) Andy Lester 2001. All Rights Reserved.

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