Description

MTValidate is a Movable Type plugin based on the W3C MarkUp Validation Service. It lets you embed the results of arbitrary of text in HTML or XHTML into the documents generated by your weblog.

Download

Current version: 0.1

Documentation

Requirements

Installation

  1. Copy MTValidate.pl and the validator directory to your Movable Type plugins directory.
  2. Copy sgml-lib into the plugins/validator directory.
  3. Edit plugins/validator/config/validator.config to reflect your setup.

Use

This plugin provides the MTValidate container tag. The contents of this tag should be a complete HTML, XHTML, SGML or XML document, which will be replaced with the results of the validation. There are also several attributes you can provide. Set their value to “1” to enable, “0” to disable:

  • verbose
    Verbose output (on by default): If this is disabled, the other options will be ignored.
  • ss
    Displays the HTML source of the document you validated and links error messages directly to lines in this output. Makes it easy to see what’s wrong. The source is always shown if there is an error.
  • outline
    Will generate an outline of your document from the H1 - H6 elements. For a properly formed document, this will be a nicely nested tree structure. The visualization of your document’s structure makes it easier to see where you’ve skipped a heading.
  • sp
    Shows you exactly how the SGML Parser read your document. Probably best used only by advanced users as it deals with low-level SGML constructs.
  • noattr
    Suppress attributes from the parse tree to make it more readable.
  • charset
    The character set of the document to be validated. For example, utf-8 or iso-8859-1. If not specified, the validator will try to guess based on the HTML META element or XML declaration.
  • doctype
    The document type to apply to the document. Normally, this is extracted from the DOCTYPE declaration in the document itself, but you can override it using this attribute. For example, HTML 3.2 or XHTML 1.0 Transitional

Here is an example that validates the title and body of an entry, based on the default templates from Movable Type 2.51:

<MTValidate>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><$MTBlogName$>: <$MTEntryTitle$></title>
</head>
<body>
<h3 class="title"><$MTEntryTitle$></h3>
<$MTEntryBody$>
<a name="more"></a>
<$MTEntryMore$>
</body>
</html>
</MTValidate>

For information on using Movable Type template tags like MTValidate in entry previews, see the documentation for MTSpeling.

Customizing the Validation Output

The text that appears in the output of the MTValidate tag is controlled by the templates in the plugins/validator/templates directory. Edit these to change the validation output.

Version History

Version 0.1

  • Initial release

Known Bugs

  • None

Contact the Author