📄 htmlbatch.pm
字号:
font-size: 105%; /* just a wee bit more than normal */ } .indexgroup { font-size: 80%; } .backlinktop, .backlinkbottom { margin-left: -5px; margin-right: -5px; background-color: #040; border-top: thin solid #050; border-bottom: thin solid #050; } .backlinktop a, .backlinkbottom a { text-decoration: none; color: #080; background-color: #000; border: thin solid #0d0; } .backlinkbottom { margin-bottom: 0; padding-bottom: 0; } .backlinktop { margin-top: 0; padding-top: 0; } body.contentspage { color: #fff; background-color: #000; } body.contentspage h1 { color: #0d0; margin-left: 1em; margin-right: 1em; text-indent: -.9em; font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; font-weight: normal; border-top: thin solid #fff; border-bottom: thin solid #fff; text-align: center; } dl.superindex > dt { font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; font-weight: normal; font-size: 90%; margin-top: .45em; /* margin-bottom: -.15em; */ } dl.superindex > dd { word-spacing: .6em; /* most important rule here! */ } dl.superindex > a:link { text-decoration: none; color: #fff; } .contentsfooty { border-top: thin solid #999; font-size: 90%; } }/* The End */EOCSS#==========================================================================$JAVASCRIPT = <<'EOJAVASCRIPT';// From http://www.alistapart.com/articles/alternate/function setActiveStyleSheet(title) { var i, a, main; for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } }}function getActiveStyleSheet() { var i, a; for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { if( a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled ) return a.getAttribute("title"); } return null;}function getPreferredStyleSheet() { var i, a; for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { if( a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) return a.getAttribute("title"); } return null;}function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else expires = ""; document.cookie = name+"="+value+expires+"; path=/";}function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0 ; i < ca.length ; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null;}window.onload = function(e) { var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title);}window.onunload = function(e) { var title = getActiveStyleSheet(); createCookie("style", title, 365);}var cookie = readCookie("style");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title);// The EndEOJAVASCRIPT# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1;__END__=head1 NAMEPod::Simple::HTMLBatch - convert several Pod files to several HTML files=head1 SYNOPSIS perl -MPod::Simple::HTMLBatch -e 'Pod::Simple::HTMLBatch::go' in out=head1 DESCRIPTIONThis module is used for running batch-conversions of a lot of HTMLdocuments This class is NOT a subclass of Pod::Simple::HTML(nor of bad old Pod::Html) -- although it usesPod::Simple::HTML for doing the conversion of each document.The normal use of this class is like so: use Pod::Simple::HTMLBatch; my $batchconv = Pod::Simple::HTMLBatch->new; $batchconv->some_option( some_value ); $batchconv->some_other_option( some_other_value ); $batchconv->batch_convert( \@search_dirs, $output_dir );=head2 FROM THE COMMAND LINENote that this class also provides(but does not export) the function Pod::Simple::HTMLBatch::go.This is basically just a shortcut for C<<Pod::Simple::HTMLBatch->batch_convert(@ARGV) >>.It's meant to be handy for calling from the command line.However, the shortcut requires that you specify exactly two command-linearguments, C<indirs> and C<outdir>.Example: % mkdir out_html % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go @INC out_html (to convert the pod from Perl's @INC files under the directory ../htmlversion)(Note that the command line there contains a literal atsign-I-N-C. Thisis handled as a special case by batch_convert, in order to save you havingto enter the odd-looking "" as the first command-line parameter when youmean "just use whatever's in @INC".)Example: % mkdir ../seekrut % chmod og-rx ../seekrut % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../htmlversion (to convert the pod under the current dir into HTML files under the directory ../htmlversion)Example: % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go happydocs . (to convert all pod from happydocs into the current directory)=head1 MAIN METHODS=over=item $batchconv = Pod::Simple::HTMLBatch->new;This TODO=item $batchconv->batch_convert( I<indirs>, I<outdir> );this TODO=item $batchconv->batch_convert( undef , ...);=item $batchconv->batch_convert( q{@INC}, ...);These two values for I<indirs> specify that the normal Perl @INC=item $batchconv->batch_convert( \@dirs , ...);This specifies that the input directories are the items inthe arrayref C<\@dirs>.=item $batchconv->batch_convert( "somedir" , ...);This specifies that the director "somedir" is the input.(This can be an absolute or relative path, it doesn't matter.)A common value you might want would be just "." for the currentdirectory: $batchconv->batch_convert( "." , ...);=item $batchconv->batch_convert( 'somedir:someother:also' , ...);This specifies that you want the dirs "somedir", "somother", and "also"scanned, just as if you'd passed the arrayrefC<[qw( somedir someother also)]>. Note that a ":"-separator is normalunder Unix, but Under MSWin, you'll need C<'somedir;someother;also'>instead, since the pathsep on MSWin is ";" instead of ":". (AndI<that> is because ":" often comes up in paths, likeC<"c:/perl/lib">.)(Exactly what separator character should be used, is gotten fromC<$Config::Config{'path_sep'}>, via the L<Config> module.)=item $batchconv->batch_convert( ... , undef );This specifies that you want the HTML output to go into the currentdirectory.(Note that a missing or undefined value means a different thing inthe first slot than in the second. That's so that C<batch_convert()>with no arguments (or undef arguments) means "go from @INC, intothe current directory.)=item $batchconv->batch_convert( ... , 'somedir' );This specifies that you want the HTML output to go into thedirectory 'somedir'.(This can be an absolute or relative path, it doesn't matter.)=backNote that you can also call C<batch_convert> as a class method,like so: Pod::Simple::HTMLBatch->batch_convert( ... );That is just short for this: Pod::Simple::HTMLBatch-> new-> batch_convert(...);That is, it runs a conversion with default options, forwhatever inputdirs and output dir you specify.=head2 ACCESSOR METHODSThe following are all accessor methods -- that is, they don't do anythingon their own, but just alter the contents of the conversion object,which comprises the options for this particular batch conversion.We show the "put" form of the accessors below (i.e., the syntax you usefor setting the accessor to a specific value). But you can alsocall each method with no parameters to get its current value. Forexample, C<< $self->contents_file() >> returns the current value ofthe contents_file attribute.=over=item $batchconv->verbose( I<nonnegative_integer> );This controls how verbose to be during batch conversion, as far asnotes to STDOUT (or whatever is C<select>'d) about how the conversionis going. If 0, no progress information is printed.If 1 (the default value), some progress information is printed.Higher values print more information.=item $batchconv->index( I<true-or-false> );This controls whether or not each HTML page is liable to have a littletable of contents at the top (which we call an "index" for historicalreasons). This is true by default.=item $batchconv->contents_file( I<filename> );If set, should be the name of a file (in the output directory)to write the HTML index to. The default value is "index.html".If you set this to a false value, no contents file will be written.=item $batchconv->contents_page_start( I<HTML_string> );This specifies what string should be put at the beginning ofthe contents page.The default is a string more or less like this: <html> <head><title>Perl Documentation</title></head> <body class='contentspage'> <h1>Perl Documentation</h1>=item $batchconv->contents_page_end( I<HTML_string> );This specifies what string should be put at the end of the contents page.The default is a string more or less like this: <p class='contentsfooty'>Generated by Pod::Simple::HTMLBatch v3.01 under Perl v5.008 <br >At Fri May 14 22:26:42 2004 GMT, which is Fri May 14 14:26:42 2004 local time.</p>=item $batchconv->add_css( $url );TODO=item $batchconv->add_javascript( $url );TODO=item $batchconv->css_flurry( I<true-or-false> );If true (the default value), we autogenerate some CSS files in theoutput directory, and set our HTML files to use those.TODO: continue=item $batchconv->javascript_flurry( I<true-or-false> );If true (the default value), we autogenerate a JavaScript in theoutput directory, and set our HTML files to use it. Currently,the JavaScript is used only to get the browser to remember whatstylesheet it prefers.TODO: continue=item $batchconv->no_contents_links( I<true-or-false> );TODO=item $batchconv->html_render_class( I<classname> );This sets what class is used for rendering 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 shouldC<require> or C<use> that class so that's it's loaded beforePod::Simple::HTMLBatch tries loading it.=back=head1 NOTES ON CUSTOMIZATIONTODO call add_css($someurl) to add stylesheet as alternate call add_css($someurl,1) to add as primary stylesheet call add_javascript subclass Pod::Simple::HTML and set $batchconv->html_render_class to that classname and maybe override $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)=head1 ASK ME!If you want to do some kind of big pod-to-HTML version with someparticular kind of option that you don't see how to achieve using thismodule, email me (C<sburke@cpan.org>) and I'll probably have a good ideahow to do it. For reasons of concision and energetic laziness, somemethods and options in this module (and the dozen modules it depends on)are undocumented; but one of those undocumented bits might be just whatyou're looking for.=head1 SEE ALSOL<Pod::Simple>, L<Pod::Simple::HTMLBatch>, L<perlpod>, L<perlpodspec>=head1 COPYRIGHT AND DISCLAIMERSCopyright (c) 2004 Sean M. Burke. All rights reserved.This library is free software; you can redistribute it and/or modify itunder the same terms as Perl itself.This program is distributed in the hope that it will be useful, butwithout any warranty; without even the implied warranty ofmerchantability or fitness for a particular purpose.=head1 AUTHORSean M. Burke C<sburke@cpan.org>=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -