From kde-commits Fri Aug 15 03:49:40 2008 From: Michael Pyne Date: Fri, 15 Aug 2008 03:49:40 +0000 To: kde-commits Subject: KDE/kdesdk/kioslave/perldoc Message-Id: <1218772180.075152.13656.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=121877218927696 SVN commit 847244 by mpyne: If no results are found in the kio_perldoc faq search, at least show something. This should look even better once I prepend a KDE-themed header to the output. M +15 -3 pod2html.pl --- trunk/KDE/kdesdk/kioslave/perldoc/pod2html.pl #847243:847244 @@ -4,7 +4,7 @@ # Integrated and crap^H^H^H^H unnecessary dependencies removed by Michael Pyne # # -# Copyright 2007 Michael Pyne. +# Copyright 2007, 2008 Michael Pyne. # Original source is licensed to be distributed under the same terms as Perl # itself. All changes by Michael Pyne retain this license. # @@ -818,6 +818,7 @@ body => 1, common_entities => 1, css => 1, + faq_page => 0, function_page => 0, index => 1, index_item => 1, @@ -1217,6 +1218,10 @@ } } + if ($args{'faq_page'}) { + push @html, qq{$NL

The following FAQ results were found:

$NL}; + } + # Avoid carry-over on multiple files delete $this->{IN_BEGIN}; delete $this->{PACKAGE}; @@ -1237,8 +1242,12 @@ if ( not exists $args{index} ) { $args{index} = $this->build_index(); } if ( exists $args{no_index} ) { $args{index} = $EMPTY; } + if ( $args{'faq_page'} && not @{$output} ) { + @{$output} = ("None"); + } + push @html, qq{$args{index}$NL}; - push @html, qq{
$NL}; + push @html, qq{
$NL}; push @html, @{$output}; # The pod converted to HTML push @html, qq{
$NL}; @@ -1757,4 +1766,7 @@ my $podhtml = Pod::HtmlEasy->new(); -print $podhtml->pod2html($perlDocInput, 'function_page'=>$usingFunctionPage, title=>"$ARGV[-1]"), "\n"; +print $podhtml->pod2html($perlDocInput, + 'function_page'=>$usingFunctionPage, + 'faq_page' => exists $ARGV[0] && $ARGV[0] eq '-q', + title=>"$ARGV[-1]"), "\n";