NAME

HTML::Highlighter - PSGI middleware to highlight text in an HTML response

SYNOPSIS

use Plack::Builder;
use HTML::Highlighter;

builder {
  enable "+HTML::Highlighter", param => "highlight";
  ...
  $app;
};

DESCRIPTION

The HTML::Highlighter module is a piece of PSGI middleware that will inspect an HTML response and highlight parts of the page based on a query parameter. This is very much like what Google does when you load a page from their cache. Any text that matches your original query is highlighted.

This module also includes a javascript file called highlighter.js which gives you a class with methods to jump (scroll) through the highlights.

CONSTRUCTOR PARAMETERS

param

This required parameter allows you to specify what query parameter to use for the highlighting. For example, if you specify "highlight" as the param, each response will look for a query parameter called "highlight." If it finds the parameter, portions of the HTML response will be modified to look like this:

<span class="highlight">[text]</span>

SEE ALSO

Plack::Builder

HTML::Parser

COPYRIGHT AND LICENSE

Copyright (C) 2010 Lee Aylward <leedo at cpan.org>, all rights reserved.

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

AUTHOR

Lee Aylward, <leedo@cpan.org>