NAME

weblint - pick fluff off web pages (HTML)

SYNOPSIS

weblint [ -d id ] [ -e id ] [ -l ] [ -s | -t ] [ -stderr ]
		[ -help ] [ -version ] file1 ... fileN

DESCRIPTION

weblint is a Perl script which picks fluff off HTML pages.

Files to be checked are passed on the command-line:

% weblint foobar.html ./dodgy-files/ index.html

If any of the arguments are directories weblint will recurse in the directory, and check any HTML files found.

Warnings are generated a la lint:

home.html(9): unmatched </A> (no matching <A> seen).

Weblint includes the following features:

  • Support for HTML 4.0 (current HTML standard)

  • Over 50 different checks and warnings

  • Messages can be enabled/disabled individually, as per your preference. Can also enabled/disabled all messages of a given class (warning, error, etc.)

  • Basic structure and syntax checks

  • Warnings for use of unknown elements and element attributes.

  • Context checks (where a tag must appear within a certain element).

  • overlapped or illegally nested elements.

  • do IMG elements have ALT text?

  • flags obsolete elements.

  • support for user and site configuration files

  • stylistic checks

OPTIONS

-d message-identifier

Disable the message associated with the identifier. Multiple identifiers can be specified, with a comma between identifiers.

-e message-identifier

Enable the message associated with the identifier. Multiple identifiers can be specified, with a comma between identifiers.

-f config-file

Specify a weblint configuration file which should be used in place of the user's default config file, or the site configuration file.

-help

Show a short usage summary.

-i

Ignore case of element tags.

-l

When recursing in directories, ignore any files which are symlinks (also known as soft links). This will also cause files on the command-line to be ignored if they are symlinks, unless only one file is given.

-pedantic

Turn on all messages except the case-sensitive and bad-link message.

-s

Generate `short' messages, which do not include the filename.

-stderr

Print messages to STDERR rather than STDOUT.

-t

Enable terse message mode, which is mainly useful for the weblint testsuite.

-version

Display the version number.

-messages

List all supported messages, with message identifier, and whether the message is enabled.

CONFIGURATION FILE

Weblint can be configured using a file .weblintrc in your home directory (or a file referenced by the WEBLINTRC environment variable). This file can be used to enable or disable specific messages, set weblint variables, and include HTML extensions, as described above. Each message has a short identifier string, used to refer to the message in config files, and from the command-line. For example, if you want to enable the check for tags in upper-case, but disable the check for obsolete elements, then you would include the following lines in your .weblintrc:

# the style of message to generate (lint, short, or terse)
set message-style = lint

# enable message for tags not in upper-case
enable upper-case

# disable the message for obsolete tags
disable obsolete

The keywords can be followed by any number of arguments, separated by spaces or tabs. Anything following a `#' is treated as a comment.

A sample configuration file is included in the weblint distribution (as of version 1.004), which mirrors the configuration built-in to weblint.

Weblint also supports a site configuration file. If a user does not have a personal configuration file, then weblint will check for a local site configuration file. To provide such a file, create a directory such as /usr/local/weblint, and create a file global.weblintrc. You need to edit the weblint script and modify the $SITE_DIR variable, which you will find near the top of the file. For example:

$SITE_DIR = '/usr/local/weblint';

At some point in the future there will be configuration support for weblint, so you won't have to modify the script directly yourself.

If you have a site configuration file, then users can inherit the site defaults by adding the following line at the top of their .weblintrc file:

use global weblintrc

WARNINGS AND OTHER MESSAGES

A full list of the messages supported by weblint can be found in the documentation for the Weblint::Messages module, or on the weblint web page (see below).

You can get a list of the messages supported by weblint with the -messages switch:

% weblint -messages

TESTSUITE

A simple regression testsuite is included with weblint, in the t directory. When you install weblint, you should run the testsuite, and expect to get no errors:

% perl Makefile.PL
% make test

All tests should pass. If any tests fail, please email details to the address given in the AUTHOR section below.

ENVIRONMENT VARIABLES

WEBLINTRC

If this variable is defined, and references a file, then weblint will read the referenced file for the user's configuration, rather than $HOME/.weblintrc.

FILES

$HOME/.weblintrc

The user's configuration file. See the section `CONFIGURATION FILE'.

global.weblintrc

A system-wide global configuration file. This isn't installed by default, but it may be installed locally.

SEE ALSO

Weblint home page

http://www.weblint.org/

Weblint.pm

The weblint module. The weblint script is pretty much just a wrapper around this module, which handling of command-line arguments and config files.

VERSION

$Revision: 1.5 $

AVAILABILITY

The latest version of weblint is always available from the weblint home page:

http://www.weblint.org/

It's also available from our ftp site:

ftp://ftp.weblint.org/pub/weblint/

KNOWN BUGS

Since weblint 2 is still under development there are bound to be plenty. Please check the weblint home page for the latest list.

AUTHOR

Neil Bowers neilb@weblint.org

CONTRIBUTIONS

Lots of people have contributed to weblint, in the form of suggestions, bug reports, fixes, and contributed code. These people are now listed on the weblint home page.