Skip to content

Commit

Permalink
HTMLBatch's search_class is now pluggable
Browse files Browse the repository at this point in the history
  • Loading branch information
dafrito committed Aug 16, 2011
1 parent 8af0191 commit 7bad691
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Pod/Simple/HTMLBatch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $HTML_RENDER_CLASS ||= "Pod::Simple::HTML";
Pod::Simple::_accessorize( __PACKAGE__,
'verbose', # how verbose to be during batch conversion
'html_render_class', # what class to use to render
'search_class', # what to use to search for POD documents
'contents_file', # If set, should be the name of a file (in current directory)
# to write the list of all modules to
'index', # will set $htmlpage->index(...) to this (true or false)
Expand Down Expand Up @@ -69,6 +70,7 @@ sub go {
sub new {
my $new = bless {}, ref($_[0]) || $_[0];
$new->html_render_class($HTML_RENDER_CLASS);
$new->search_class($SEARCH_CLASS);
$new->verbose(1 + DEBUG);
$new->_contents([]);

Expand Down Expand Up @@ -529,7 +531,7 @@ sub modnames2paths { # return a hashref mapping modulenames => paths

my $m2p;
{
my $search = $SEARCH_CLASS->new;
my $search = $self->search_class->new;
DEBUG and print "Searching via $search\n";
$search->verbose(1) if DEBUG > 10;
$search->progress( $self->progress->copy->goal(0) ) if $self->progress;
Expand Down Expand Up @@ -1272,6 +1274,10 @@ TODO
=item $batchconv->html_render_class( I<classname> );
This sets what class is used for rendering the files.
=item $batchconv->search_class( I<classname> );
This sets what class is used for searching for the files.
The default is "Pod::Simple::Search". If you set it to something else,
it should probably be a subclass of Pod::Simple::Search, and you should
C<require> or C<use> that class so that's it's loaded before
Expand Down

0 comments on commit 7bad691

Please sign in to comment.