diff options
author | David E. Wheeler <david@kineticode.com> | 2009-10-27 12:09:33 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-10-28 11:28:38 +0100 |
commit | 9d65762f3680caf03a8526c0d9868a9b366f7818 (patch) | |
tree | d4ce818f6918699f4e934ce2bea1f558519a9d5c /cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm | |
parent | 28c5b5bcd7f52e6b2219508a1066cd0ccc8dd19a (diff) | |
download | perl-9d65762f3680caf03a8526c0d9868a9b366f7818.tar.gz |
Bring Pod::Simple up to 3.09 as on CPAN.
Diffstat (limited to 'cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm')
-rw-r--r-- | cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm index cb26cabf37..96093fbd6d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm @@ -37,6 +37,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) @@ -71,6 +72,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([]); @@ -246,11 +248,8 @@ sub _do_one_batch_conversion { } # Give each class a chance to init the converter: - $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth) if $page->can('batch_mode_page_object_init'); - $self->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth) - if $self->can('batch_mode_page_object_init'); # Now get busy... $self->makepath($outdir => \@namelets); @@ -532,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; @@ -681,20 +680,16 @@ sub _gen_css_wad { # 010=white_with_green_on_black # 011=white_with_blue_on_black # 100=white_with_red_on_black - - qw[ - 110n=black_with_blue_on_white - 010n=black_with_magenta_on_white - 100n=black_with_cyan_on_white - - 101=white_with_purple_on_black - 001=white_with_navy_blue_on_black - - 010a=grey_with_green_on_black - 010b=white_with_green_on_grey - 101an=black_with_green_on_grey - 101bn=grey_with_green_on_white - ]) { + '110n=blkbluw', # black_with_blue_on_white + '010n=blkmagw', # black_with_magenta_on_white + '100n=blkcynw', # black_with_cyan_on_white + '101=whtprpk', # white_with_purple_on_black + '001=whtnavk', # white_with_navy_blue_on_black + '010a=grygrnk', # grey_with_green_on_black + '010b=whtgrng', # white_with_green_on_grey + '101an=blkgrng', # black_with_green_on_grey + '101bn=grygrnw', # grey_with_green_on_white + ) { my $outname = $variation; my($flipmode, @swap) = ( ($4 || ''), $1,$2,$3) @@ -724,11 +719,13 @@ sub _gen_css_wad { } # Now a few indexless variations: - foreach my $variation (qw[ - black_with_blue_on_white white_with_purple_on_black - white_with_green_on_grey grey_with_green_on_white - ]) { - my $outname = "indexless_$variation"; + foreach my $variation ( + 'blkbluw', # black_with_blue_on_white + 'whtpurk', # white_with_purple_on_black + 'whtgrng', # white_with_green_on_grey + 'grygrnw', # grey_with_green_on_white + ) { + my $outname = "$variation\_"; my $this_css = join "\n", "/* This file is autogenerated. Do not edit. $outname */\n", "\@import url(\"./_$variation.css\");", @@ -737,7 +734,7 @@ sub _gen_css_wad { ; my $name = $outname; $name =~ tr/-_/ /; - $self->add_css( "_$outname.css", 0, $name, 0, 0, \$this_css); + $self->add_css( "$outname.css", 0, $name, 0, 0, \$this_css); } return; @@ -1275,6 +1272,14 @@ TODO =item $batchconv->html_render_class( I<classname> ); This sets what class is used for rendering the files. +The default is "Pod::Simple::HTML". If you set it to something else, +it should probably be a subclass of Pod::Simple::HTML, and you should +C<require> or C<use> that class so that's it's loaded before +Pod::Simple::HTMLBatch tries loading it. + +=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 @@ -1300,6 +1305,8 @@ TODO $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth) or maybe override $batchconv->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth) + subclass Pod::Simple::Search and set $batchconv->search_class to + that classname |