~ubuntu-branches/ubuntu/trusty/libpod-simple-perl/trusty

« back to all changes in this revision

Viewing changes to lib/Pod/Simple/HTMLBatch.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu, Jonathan Yu, Salvatore Bonaccorso, Ryan Niebur, gregor herrmann
  • Date: 2009-10-26 19:03:16 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091026190316-f9z7itsbjva0k8tv
Tags: 3.09-1
[ Jonathan Yu ]
* New upstream release
* Standards-Version 3.8.3 (no changes)

[ Salvatore Bonaccorso ]
* debian/control: Changed: Replace versioned (build-)dependency on
  perl (>= 5.6.0-{12,16}) with an unversioned dependency on perl (as
  permitted by Debian Policy 3.8.3).

[ Ryan Niebur ]
* Update jawnsy's email address

[ gregor herrmann ]
* debian/control: Changed: (build-)depend on perl instead of perl-
  modules.
* debian/watch: use extended regexp for matching upstream versions.
* debian/rules: minimize and use override_* feature.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
Pod::Simple::_accessorize( __PACKAGE__,
38
38
 'verbose', # how verbose to be during batch conversion
39
39
 'html_render_class', # what class to use to render
 
40
 'search_class', # what to use to search for POD documents
40
41
 'contents_file', # If set, should be the name of a file (in current directory)
41
42
                  # to write the list of all modules to
42
43
 'index', # will set $htmlpage->index(...) to this (true or false)
71
72
sub new {
72
73
  my $new = bless {}, ref($_[0]) || $_[0];
73
74
  $new->html_render_class($HTML_RENDER_CLASS);
 
75
  $new->search_class($SEARCH_CLASS);
74
76
  $new->verbose(1 + DEBUG);
75
77
  $new->_contents([]);
76
78
  
246
248
  }
247
249
 
248
250
  # Give each class a chance to init the converter:
249
 
  
250
251
  $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth)
251
252
   if $page->can('batch_mode_page_object_init');
252
 
  $self->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth)
253
 
   if $self->can('batch_mode_page_object_init');
254
253
    
255
254
  # Now get busy...
256
255
  $self->makepath($outdir => \@namelets);
532
531
 
533
532
  my $m2p;
534
533
  {
535
 
    my $search = $SEARCH_CLASS->new;
 
534
    my $search = $self->search_class->new;
536
535
    DEBUG and print "Searching via $search\n";
537
536
    $search->verbose(1) if DEBUG > 10;
538
537
    $search->progress( $self->progress->copy->goal(0) ) if $self->progress;
681
680
   #  010=white_with_green_on_black
682
681
   #  011=white_with_blue_on_black
683
682
   #  100=white_with_red_on_black
684
 
  
685
 
   qw[
686
 
    110n=black_with_blue_on_white
687
 
    010n=black_with_magenta_on_white
688
 
    100n=black_with_cyan_on_white
689
 
 
690
 
    101=white_with_purple_on_black
691
 
    001=white_with_navy_blue_on_black
692
 
 
693
 
    010a=grey_with_green_on_black
694
 
    010b=white_with_green_on_grey
695
 
    101an=black_with_green_on_grey
696
 
    101bn=grey_with_green_on_white
697
 
  ]) {
 
683
    '110n=blkbluw',  # black_with_blue_on_white
 
684
    '010n=blkmagw',  # black_with_magenta_on_white
 
685
    '100n=blkcynw',  # black_with_cyan_on_white
 
686
    '101=whtprpk',   # white_with_purple_on_black
 
687
    '001=whtnavk',   # white_with_navy_blue_on_black
 
688
    '010a=grygrnk',  # grey_with_green_on_black
 
689
    '010b=whtgrng',  # white_with_green_on_grey
 
690
    '101an=blkgrng', # black_with_green_on_grey
 
691
    '101bn=grygrnw', # grey_with_green_on_white
 
692
  ) {
698
693
 
699
694
    my $outname = $variation;
700
695
    my($flipmode, @swap) = ( ($4 || ''), $1,$2,$3)
724
719
  }
725
720
 
726
721
  # Now a few indexless variations:
727
 
  foreach my $variation (qw[
728
 
    black_with_blue_on_white  white_with_purple_on_black
729
 
    white_with_green_on_grey  grey_with_green_on_white
730
 
  ]) {
731
 
    my $outname = "indexless_$variation";
 
722
  foreach my $variation (
 
723
      'blkbluw', # black_with_blue_on_white
 
724
      'whtpurk', # white_with_purple_on_black
 
725
      'whtgrng', # white_with_green_on_grey
 
726
      'grygrnw', # grey_with_green_on_white
 
727
  ) {
 
728
    my $outname = "$variation\_";
732
729
    my $this_css = join "\n",
733
730
      "/* This file is autogenerated.  Do not edit.  $outname */\n",
734
731
      "\@import url(\"./_$variation.css\");",
737
734
    ;
738
735
    my $name = $outname;    
739
736
    $name =~ tr/-_/  /;
740
 
    $self->add_css( "_$outname.css", 0, $name, 0, 0, \$this_css);
 
737
    $self->add_css( "$outname.css", 0, $name, 0, 0, \$this_css);
741
738
  }
742
739
 
743
740
  return;
1275
1272
=item $batchconv->html_render_class( I<classname> );
1276
1273
 
1277
1274
This sets what class is used for rendering the files.
 
1275
The default is "Pod::Simple::HTML".  If you set it to something else,
 
1276
it should probably be a subclass of Pod::Simple::HTML, and you should
 
1277
C<require> or C<use> that class so that's it's loaded before
 
1278
Pod::Simple::HTMLBatch tries loading it.
 
1279
 
 
1280
=item $batchconv->search_class( I<classname> );
 
1281
 
 
1282
This sets what class is used for searching for the files.
1278
1283
The default is "Pod::Simple::Search".  If you set it to something else,
1279
1284
it should probably be a subclass of Pod::Simple::Search, and you should
1280
1285
C<require> or C<use> that class so that's it's loaded before
1300
1305
    $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth)
1301
1306
  or maybe override
1302
1307
    $batchconv->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth)
 
1308
  subclass Pod::Simple::Search and set $batchconv->search_class to
 
1309
    that classname
1303
1310
 
1304
1311
 
1305
1312