ppcrcd/trunk/doc/gendoc.pl
sparky
cvs at pld-linux.org
Thu Aug 10 16:59:42 CEST 2006
Author: sparky
Date: Thu Aug 10 16:59:41 2006
New Revision: 7658
Modified:
ppcrcd/trunk/doc/gendoc.pl
Log:
- nicer-looking page
Modified: ppcrcd/trunk/doc/gendoc.pl
==============================================================================
--- ppcrcd/trunk/doc/gendoc.pl (original)
+++ ppcrcd/trunk/doc/gendoc.pl Thu Aug 10 16:59:41 2006
@@ -66,15 +66,15 @@
}
}
if ($par and $line =~ /(\<h[1-3]\>|<options "[a-z]*">)/) {
- $out =~ s#(.)(\s*)$#$1</div>$2#;
+ $out =~ s#(.)(\s*)$#$1</div><br />$2#;
$par = 0;
}
unless ( $pre ) {
if ( $line =~ s/^ (\S)/$1/ ) {
if ($par) {
- $out =~ s#(.)(\s*)$#$1</div>$2#;
+ $out =~ s#(.)(\s*)$#$1</div><br />$2#;
}
- $out .= '<div class="p">';
+ $out .= '<br /><div>';
$par = 1;
}
}
@@ -84,7 +84,7 @@
$out =~ s#(.)(\s*)$#$1</pre>$2#;
}
if ($par) {
- $out =~ s#(.)(\s*)$#$1</div>$2#;
+ $out =~ s#(.)(\s*)$#$1</div><br />$2#;
}
return $out;
}
@@ -112,10 +112,10 @@
}
foreach my $var (sort keys %{$options{$opt}}) {
- $options .= "<div>\n<h3>";
+ $options .= "<br /><div>\n<h3>";
$options .= html($var).":</h3>\n";
$options .= htmlize($options{$opt}->{$var});
- $options .= "</div>\n";
+ $options .= "</div><br />\n";
}
$file =~ s/<options "$opt">/$options/;
@@ -133,17 +133,17 @@
<meta http-equiv="Content-type" content="text/html; Charset=ISO-8859-1">
<title>$title</title>
<style type="text/css">
- pre {
- padding: 5px;
- border: 1px dashed #909090;
- }
div {
- padding: 5px;
+ padding: 0.5em;
+ text-indent: 1em;
}
- .p {
- padding: 0px;
- text-indent: 15px;
+ table { border-width: 0; }
+ td {
+ border-style: dashed;
+ border-color: #909090;
}
+ pre { margin: 0; }
+ br { display: none; }
</style>
</head>
<body>
@@ -214,14 +214,17 @@
my $pre = $1;
if ( $pre =~ /\n/ ) { #multiline
$clean .= $line."\n" if length $line_nosp;
- $clean .= $step . "<pre>\n";
+ $clean .= $step .
+ qq(<table width="100%" border="1"><tr><td><pre>\n);
$clean .= $pre . "\n";
- $clean .= $step . "</pre>\n";
+ $clean .= "</pre></td></tr></table>\n";
$line = $step;
next;
} else {
$clean .= $line."\n" if length $line_nosp;
- $clean .= $step. "<pre>" . $pre . "</pre>\n";
+ $clean .= $step.
+ qq(<table width="100%" border="1"><tr><td><pre>)
+ . $pre . "</pre></td></tr></table>\n";
$line = $step;
next;
}
@@ -250,7 +253,16 @@
$clean .= $line . "\n";
$line = $step . $word;
} else {
- $line .= " " . $word;
+ ( my $line_nosp = $line ) =~ s/\s*//g;
+ if (((length $clean) + length $line_nosp) > 0 or $end ne "div") {
+ $line .= " " . $word;
+ } else {
+ if ($end eq "div") {
+ $line .= " " . $word;
+ } else {
+ $line .= $word;
+ }
+ }
}
}
warn "should never reach this point";
More information about the pld-cvs-commit
mailing list