--- kde-info2html.old Sun Nov 30 10:42:52 2003 +++ kde-info2html Mon Apr 26 15:01:12 2004 @@ -39,6 +39,9 @@ # March 9 2003 Add support for browsing by file. by Luis Pedro Coelho # June 11 2003 Update the layout of the sides to the new infopageslayout. # by Sven Leiber +# 2004-04-26 enhanced the output of links by using • +# removed the need for text rendered with
 by
+#                     using 
- Dirk Jagdmann # #------------------------------------------------------- @@ -402,7 +405,7 @@ if (!defined (@parse_results)) { return $Line; } my ($MenuLinkTag, $MenuLinkFile, $MenuLinkRef, $MenuLinkText) = @parse_results; #-- produce a HTML line - return "$MenuLinkText"; + return "\• $MenuLinkRef$MenuLinkText"; } #------------------------------------------------------------- @@ -522,7 +525,7 @@ } if ($CrossRef =~ /^([^:]+)::/) { # -- a simple cross ref.. $CrossRefTag = $1; - $CrossRefText = $'; + $CrossRefText = $'; # ' $CrossRefRef = $CrossRefTag; $CrossRefTag =~ s/-NEWLINE-/ /g; $CrossRefTag =~ s/^\s+//; @@ -530,8 +533,7 @@ $CrossRefRef =~ s/-NEWLINE-/\n/g; $CrossRefTag = &Escape($CrossRefTag); # -- escape specials $BaseInfoFile = &Escape($BaseInfoFile); - $NewLine .= ""; - $NewLine .= "$CrossRefRef$CrossRefText"; + $NewLine .= "\• $CrossRefRef $CrossRefText"; next; # -- .. take the next one } if ($CrossRef !~ /$TE/) { # never mind if tag doesn't end on this line @@ -541,12 +543,12 @@ #print "--- Com. CR : $CrossRef --- \n"; if ($CrossRef =~ /([^:]+):/) { #-- A more complicated one .. $CrossRefRef = $1; - $CrossRef = $'; + $CrossRef = $'; # ' $CrossRefText = $CrossRef; } if ($CrossRef =~ /^(\s|\n|-NEWLINE-)*\(($FTAG)\)/) { #-- .. with another file ? $CrossRefFile = $2; - $CrossRef = $'; + $CrossRef = $'; # ' } $CrossRefTag = $2 if $CrossRef =~ /^(\s|\n|-NEWLINE-)*($TAG)?($TE)/; #-- ... and a tag ? if ($CrossRefTag eq "" && $CrossRefFile eq "") { @@ -565,8 +567,14 @@ $CrossRefTag = &Escape($CrossRefTag); #-- escape specials $CrossRefFile = &Escape($CrossRefFile); #-- append the HTML text - $NewLine .= ""; - $NewLine .= "$CrossRefRef$CrossRefText"; + $CrossRefText="$CrossRefRef $CrossRefText"; + my $addtext=''; + if($CrossRefText =~ /([^\)]+)\)(.+)/) + { + $CrossRefText=$1; + $addtext=" ) $2"; + } + $NewLine .= "\• $CrossRefText$addtext"; } if ($NewLine =~ /\*Note([^\t\,\.]*)$/i) { return "$DONTPRINTYET$NewLine"; @@ -782,9 +790,7 @@ my $prev; my $LineCount = 0; my $Entries = 0; - my $Par = 0; my @ParLines = (); - my $ParLine=0; my $MayBeText=0; my $MayBeTitle=0; my $Line; @@ -831,7 +837,7 @@ if (/^\* /) { #-- a menu entry ? if ($Entries == 0) { $Entries = 1; - print ""; + print "
"; } print &MenuItem2HTML($_,$BaseInfoFile); } @@ -860,24 +866,24 @@ } } else { - if (/^ *$/) { - if ($MayBeText == 1) { - print "

$Par

" - } else { - print "
";
-            foreach (@ParLines) {
-               print $_;
-            }
-            print "\n";
-            print "
"; - } +# if empty line + if (/^\s*$/) { +# flush last paragraph + # is there something to flush ? + if($#ParLines >= 0) + { + if ($MayBeText == 1) { + print "

@ParLines

"; + } else { + print "

", shift @ParLines; + print "

@ParLines

"; + } + } @ParLines = (); - $ParLine = 1; $MayBeText = 1; $MayBeTitle = 1; - $Par = ""; } else { - if ($ParLine == 1) { + if ($#ParLines == -1) { if (!/^ {1,4}[^ ]/ || /[^ ] [^ ]/) { $MayBeText = 0; } @@ -899,9 +905,8 @@ $Line =~ s/`([^']*)'/`$1<\/span>'/g; #' $Line =~ s/((news|ftp|http):\/\/[A-Za-z0-9\.\/\#\-_\~]*)/$1<\/a>/g; $Line =~ s/([A-Za-z0-9\.\/\#\-_\~]*\@[A-Za-z0-9\.\/\#\-_\~]*\.[A-Za-z]{2,3})/$1<\/a>/g; - $Par = $Par . $Line; - $ParLines[$ParLine] = $Line; - $ParLine++; + push(@ParLines, $Line); + #push(@ParLines, "
") if $MayBeText==0; } } }