[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-22 2:44:49
Message-ID: 1219373089.537492.4693.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 850695 by mpyne:

Add the nice kio_man header and footer to the generated kio_perldoc output.

This brings up issues of its own though: instead of forking the .css file everywhere \
we should come up with some kind of KDE standard for generated documentation output.  \
But until then, this is a working solution.

Required screenshots:

Before: http://purinchu.net/dumping-ground/kio_perldoc-before.jpg
After:  http://purinchu.net/dumping-ground/kio_perldoc-after.jpg


 M  +1 -1      CMakeLists.txt  
 A             kio_perldoc.css  
 M  +35 -16    pod2html.pl  


--- trunk/KDE/kdesdk/kioslave/perldoc/CMakeLists.txt #850694:850695
@@ -9,7 +9,7 @@
 TARGET_LINK_LIBRARIES(kio_perldoc ${KDE4_KIO_LIBS})
 
 INSTALL(TARGETS kio_perldoc DESTINATION ${PLUGIN_INSTALL_DIR})
-
+INSTALL(FILES   kio_perldoc.css DESTINATION ${DATA_INSTALL_DIR}/kio_perldoc)
 INSTALL(PROGRAMS pod2html.pl DESTINATION ${DATA_INSTALL_DIR}/kio_perldoc)
 INSTALL(FILES perldoc.protocol DESTINATION ${SERVICES_INSTALL_DIR})
 
--- trunk/KDE/kdesdk/kioslave/perldoc/pod2html.pl #850694:850695
@@ -1208,6 +1208,11 @@
 
     delete $this->{UPARROW};
     delete $this->{UPARROW_FILE};
+    my $kde_dir = q{/home/kde-svn/kde-4/share/doc/HTML/en};
+    push @html, qq{<div id="header"><div id="header_top"><div><div>$NL};
+    push @html, qq{<img src="file://$kde_dir/common/top-kde.jpg"> $title - KDE \
Perldoc Viewer</div></div></div></div>}; +    push @html, q{<div class="pod">};
+
     if ( exists $args{top} ) {
         push @html, qq{$NL<a name='_top'></a>$NL};
         if ( -e $args{top} ) {
@@ -1246,10 +1251,19 @@
         @{$output} = ("<b>None</b>");
     }
 
+    my @kde_version_output = `kde4-config --version`;
+    my $kde_version;
+    for (@kde_version_output) {
+        ($kde_version) = m/^KDE:\s*(.*)$/;
+        last if defined $kde_version;
+    }
+
+    $kde_version = "Unknown" unless $kde_version;
+
     push @html, qq{$args{index}$NL};
-    push @html, qq{<div class='pod'>$NL};
     push @html, @{$output};                      # The pod converted to HTML
-    push @html, qq{</div></body></html>$NL};
+    push @html, qq{</div><div id="footer"><div id="footer_text">Generated by \
kio_perldoc, version $kde_version</div></div>}; +    push @html, \
qq{</body></html>$NL};  
     delete $this->{TIEDOUTPUT};
     close $html or carp q{Could not close html};
@@ -1385,23 +1399,28 @@
 ################
 
 sub _organize_css {
-    my $args_ref = shift;
+    my $perldoc_css = `kde4-config --path data --locate \
kio_perldoc/kio_perldoc.css`; +    chomp $perldoc_css;
 
-    my $css = exists $args_ref->{css} ? $args_ref->{css} : $CSS_DEF;
-    if ( exists $args_ref->{no_css} ) { $css = $EMPTY; }
-
-    # No 'x' on the match, please
-    if ( $css =~ m{$NL}sm ) {
-
-        # $css is data
-        return qq{<style type="text/css">$NL} . qq{ <!--${css}--></style>$NL};
+    return <<"EOL";
+<link rel="stylesheet" href="help:/common/kde-default.css" type="text/css">
+<link rel="stylesheet" href="file://$perldoc_css" type="text/css">
+<style>
+    #header_top {
+        background-image: url("help:/common/top.jpg");
     }
-    elsif ( $css ne $EMPTY ) {
-
-        # $css is a file
-        return qq{<link rel="stylesheet" href="$css" type="text/css">$NL};
+    #header_top div {
+        background-image: url("help:/common/top-left.jpg");
     }
-    return $EMPTY;
+    #header_top div div {
+        background-image: url("help:/common/top-right.jpg");
+    }
+    div.pod {
+        margin-left: 5em;
+        margin-right: 5em;
+    }
+</style>
+EOL
 }
 
 ##################


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

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