NAME

TidyText - Plugin for Moveable Type

DESCRIPTION

A text-formatting plugin that uses HTML Tidy to make valid XHTML and HTML for blog entries in Moveable Type.

REQUIREMENTS

Moveable Type 2.6 or higher

HTML Tidy ( available at http://tidy.sourceforge.net/ )

INSTALLATION

Get and install HTML Tidy from http://tidy.sourceforge.net/ if you haven't already. If you don't know which version to get try Linux/x86 first.

Open tidytext.pl in a text editor and set $TIDY to the location of Tidy, $TIDYARGS to the arguments to give Tidy ( documented at http://tidy.sourceforge.net/docs/quickref.html ) and $TIDYTMP to the temp directory to use.

Put tidytext.pl in the plugins directory for your Moveable Type installation and make sure that the permissions make it readable by the web server

USAGE

When you create or edit a blog entry you will have two new options under Text Formatting:

HTML Tidy (and Convert Line Breaks)

This will turn your blog entry into valid XHTML or HTML, enclose paragraphs in <p> and </p> tags and convert line breaks to <br /> tags. This is similar to the Moveable Type Text Formatting "Convert Line Breaks."

HTML Tidy

This will turn your blog entry into valid XHTML or HTML. This is similar to the Moveable Type Text Formatting "None."

Or you can use TidyText in your template as a global filter or a container tag:

Global Filter

<$MTEntryBody tidy="1"$>

Container Tag

<MTTidy><$MTEntryBody$></MTTidy>

CHANGES

Version 0.4

Now works as a global filter: <$MTEntryBody tidy="1"$> ( Credit: L.M. Orchard http://www.decafbad.com/ )

Also works as a container tag: <MTTidy><$MTEntryBody$></MTTidy> ( Credit: L.M. Orchard http://www.decafbad.com/ )

Checks to see if Tidy exists before filtering your output.

Version 0.3

Initial release, of course. Why would an initial release start at 0.1 or even 1.0, perish the thought!

BUGS

Uses temp files for processing, which is slow, but avoids deadlock issues that IPC::Open2 can have.

Hasn't been extensively tested, use at your own risk.

Convert Line Breaks uses Moveable Type to add <p> and <br /> tags. Because this is applied to the outside of multi-line container tags (i.e. <blockquote> or <ins>) Tidy sees the nesting error and closes the container tag at the first </p>. The solution is to turn off Convert Line Breaks and put <p> and </p> around your paragraphs for entries that use this tag.

COPYRIGHT

This program is copyright 2004 George Hotelling (http://george.hotelling.net) and licensed under the GPL.