[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdesdk/kioslave/perldoc
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2008-08-15 3:49:40
Message-ID: 1218772180.075152.13656.nullmailer () svn ! kde ! org
[Download RAW message or body]

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
 # <michael.pyne@kdemail.net>
 #
-# 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<p>The following FAQ results were found:</p>$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} = ("<b>None</b>");
+    }
+
     push @html, qq{$args{index}$NL};
-    push @html, qq{<div class='pod'><div>$NL};
+    push @html, qq{<div class='pod'>$NL};
     push @html, @{$output};                      # The pod converted to HTML
     push @html, qq{</div></body></html>$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";


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic