From kde-commits Fri Aug 22 02:44:49 2008 From: Michael Pyne Date: Fri, 22 Aug 2008 02:44:49 +0000 To: kde-commits Subject: KDE/kdesdk/kioslave/perldoc Message-Id: <1219373089.537492.4693.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=121937309920485 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{}; + push @html, q{
}; + if ( exists $args{top} ) { push @html, qq{$NL$NL}; if ( -e $args{top} ) { @@ -1246,10 +1251,19 @@ @{$output} = ("None"); } + 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{
$NL}; push @html, @{$output}; # The pod converted to HTML - push @html, qq{
$NL}; + push @html, qq{
}; + push @html, qq{$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{$NL}; + return <<"EOL"; + + + +EOL } ##################