Apache::AxKit::Provider::File::Formatter - An AxKit Provider that can


Apache-AxKit-Provider-File-Formatter documentation  | view source Contained in the Apache-AxKit-Provider-File-Formatter distribution.

Index


NAME

Top

Apache::AxKit::Provider::File::Formatter - An AxKit Provider that can use any Formatter API module

SYNOPSIS

Top

In your Apache config, you can configure this Provider like this example:

  <Files *.html>
        PerlHandler AxKit
	AxAddProcessor text/xsl /transforms/xhtml2html.xsl
        AxContentProvider Apache::AxKit::Provider::File::Formatter
	PerlSetVar FormatterModule Formatter::HTML::HTML
  </Files>

DESCRIPTION

Top

This is an AxKit Provider that may be used to apply any module that conforms with the Formatter API (v0.93) to a file. At the time of this writing, there are three modules in the Formatter:: namespace, one that can clean existing HTML using HTML::Tidy, one for formatting the Text::Textile syntax, and one to add minimal HTML markup to a preformatted plain text.

The Provider can be configured like any other Provider, to apply to a directory, a file ending, etc. The only thing that is special about it is that it needs a FormatterModule variable to tell it which module will do the actual formatting. It can be set like in the example in the SYNOPSIS.

Make sure you have the module you specify installed, otherwise an error will result. Also, you may need to copy a supplied XSLT stylesheet to an appropriate location from the /transforms/ directory. For example, if you would like to output HTML like in the above example, you need the xhtml2html.xsl stylesheet.

SEE ALSO

Top

The Formatter API specification.

The currently existing Formatters: Formatter::HTML::HTML, Formatter::HTML::Textile and Formatter::HTML::Preformatted. Some other Providers may also be of interest: Apache::AxKit::Provider::File, Apache::AxKit::Provider::File::Syntax

TODO

Top

It should, in principle, be possible to use a chain of Formatter modules to process a file in stages. This could be an interesting exercise for the future, but then there are also many other pipeline based paradigms that me be better suited.

AUTHOR

Top

Kjetil Kjernsmo, <kjetilk@cpan.org>

COPYRIGHT AND LICENSE

Top


Apache-AxKit-Provider-File-Formatter documentation  | view source Contained in the Apache-AxKit-Provider-File-Formatter distribution.