cvsuser 02/02/16 10:05:32
Modified: P5EEx/Blue/sbin perldocs.PL
Log:
add header menu to each of the class doc (pod) files
Revision Changes Path
1.2 +108 -43 p5ee/P5EEx/Blue/sbin/perldocs.PL
Index: perldocs.PL
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/sbin/perldocs.PL,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- perldocs.PL 8 Feb 2002 14:05:21 -0000 1.1
+++ perldocs.PL 16 Feb 2002 18:05:32 -0000 1.2
@@ -16,7 +16,7 @@
print OUT <<'!NO!SUBSTITUTIONS!';
#############################################################################
-## $Id: perldocs.PL,v 1.1 2002/02/08 14:05:21 spadkins Exp $
+## $Id: perldocs.PL,v 1.2 2002/02/16 18:05:32 spadkins Exp $
#############################################################################
## (c) 2002 Stephen Adkins <[EMAIL PROTECTED]>
## This is free software, available under the same terms as Perl itself.
@@ -27,7 +27,8 @@
## x remove non-implemented classes from inheritance tree
## x use Getopt::Long
## x remove "Deprecated" from the menu
-## o add header menu to each of the class doc files
+## x add header menu to each of the class doc files
+## o enhance usability of the header menu with support for more generated files
## o implement "Use" list
## o use Template::Toolkit to generate docs (rather than embedded HTML)
## o get documents out of the class hierarchy
@@ -235,7 +236,7 @@
if ($dir && $docroot) {
my (@htmlfiles, $htmlfile, $html, $modified, $unmodified_head,
$modified_head);
- my ($title, $short_title);
+ my ($title, $short_title, $top_navbar, $class);
# replace this with the Perl version of "find" someday
open (FIND, "find $dir -name '*.html' -print |") || die "Unable to get file
list: $!\n";
@@ -267,15 +268,25 @@
$title = $1;
$short_title = $title;
$short_title =~ s/ *-.*//;
+ $class = "class";
+ $top_navbar = &navbar("class", "P5EEx-Blue", "0.01", "unknown",
$class, "main", "top", "$docroot/api");
$modified_head = <<EOF;
<HTML>
<HEAD>
<TITLE>$title</TITLE>
- <link rel="stylesheet" type="text/css" href="$docroot/style.css">
+ <LINK REL="stylesheet" TYPE="text/css" HREF="$docroot/style.css">
+ <LINK REL="stylesheet" TYPE="text/css" HREF="$docroot/api/perldocs.css"
TITLE="Style">
+ <SCRIPT>
+ function asd() {
+ parent.document.title="$class (P5EEx-Blue-0.01)";
+ }
+ </SCRIPT>
</HEAD>
-<BODY bgcolor="white" link="#660000" alink="#990000" vlink="#990000">
+<BODY bgcolor="white" link="#660000" alink="#990000" vlink="#990000"
onload="asd();">
+$top_navbar
+<hr>
<table border="0" cellspacing="0">
<tr>
<td valign=middle><img src="$docroot/images/logo.gif" border="0"></td>
@@ -1182,49 +1193,106 @@
$html;
}
+#############################################################################
+# Utility functions
+#############################################################################
+
sub navbar {
- my ($level, $item) = @_;
- my ($distribution, $classgroup, $class);
- my (%level_label, $html);
-
- %level_label = (
- allclasses => "Site",
- distribution => "Distribution",
- classgroup => "Class-Group",
- class => "Class",
- );
+ my ($level, $distname, $version, $classgroup, $class, $pagetype, $fileposition,
$dir) = @_;
+
+ my ($html, $plain_bgcolor, $highlight_bgcolor);
+ my ($plain_cellstyle, $highlight_cellstyle);
+ my ($plain_fontstyle, $highlight_fontstyle);
+ my ($dist_cellstyle, $classgroup_cellstyle, $class_cellstyle, $use_cellstyle,
$tree_cellstyle, $deprecated_cellstyle);
+ my ($dist_fontstyle, $classgroup_fontstyle, $class_fontstyle, $use_fontstyle,
$tree_fontstyle, $deprecated_fontstyle);
+ my ($dist_bgcolor, $classgroup_bgcolor, $class_bgcolor, $use_bgcolor,
$tree_bgcolor, $deprecated_bgcolor);
+
+ $plain_cellstyle = "NavBarCell1";
+ $highlight_cellstyle = "NavBarCell1Rev";
+ $plain_fontstyle = "NavBarFont1";
+ $highlight_fontstyle = "NavBarFont1Rev";
+ $plain_bgcolor = "#EEEEFF";
+ $highlight_bgcolor = "#FFFFFF";
+
+ $dist_cellstyle = $plain_cellstyle;
+ $classgroup_cellstyle = $plain_cellstyle;
+ $class_cellstyle = $plain_cellstyle;
+ $use_cellstyle = $plain_cellstyle;
+ $tree_cellstyle = $plain_cellstyle;
+ $deprecated_cellstyle = $plain_cellstyle;
+
+ $dist_fontstyle = $plain_fontstyle;
+ $classgroup_fontstyle = $plain_fontstyle;
+ $class_fontstyle = $plain_fontstyle;
+ $use_fontstyle = $plain_fontstyle;
+ $tree_fontstyle = $plain_fontstyle;
+ $deprecated_fontstyle = $plain_fontstyle;
+
+ $dist_bgcolor = $plain_bgcolor;
+ $classgroup_bgcolor = $plain_bgcolor;
+ $class_bgcolor = $plain_bgcolor;
+ $use_bgcolor = $plain_bgcolor;
+ $tree_bgcolor = $plain_bgcolor;
+ $deprecated_bgcolor = $plain_bgcolor;
+
+ if ($pagetype eq "use") {
+ $use_cellstyle = $highlight_cellstyle;
+ $use_fontstyle = $highlight_fontstyle;
+ $use_bgcolor = $highlight_bgcolor;
+ }
+ elsif ($pagetype eq "tree") {
+ $tree_cellstyle = $highlight_cellstyle;
+ $tree_fontstyle = $highlight_fontstyle;
+ $tree_bgcolor = $highlight_bgcolor;
+ }
+ elsif ($pagetype eq "deprecated") {
+ $deprecated_cellstyle = $highlight_cellstyle;
+ $deprecated_fontstyle = $highlight_fontstyle;
+ $deprecated_bgcolor = $highlight_bgcolor;
+ }
+ elsif ($level eq "dist") {
+ $dist_cellstyle = $highlight_cellstyle;
+ $dist_fontstyle = $highlight_fontstyle;
+ $dist_bgcolor = $highlight_bgcolor;
+ }
+ elsif ($level eq "classgroup") {
+ $classgroup_cellstyle = $highlight_cellstyle;
+ $classgroup_fontstyle = $highlight_fontstyle;
+ $classgroup_bgcolor = $highlight_bgcolor;
+ }
+ elsif ($level eq "class") {
+ $class_cellstyle = $highlight_cellstyle;
+ $class_fontstyle = $highlight_fontstyle;
+ $class_bgcolor = $highlight_bgcolor;
+ }
$html = <<EOF;
<!-- ========== START OF NAVBAR ========== -->
-<A NAME="navbar_top"><!-- --></A>
+<A NAME="navbar_${fileposition}"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
- <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TD COLSPAN=3 BGCOLOR="$plain_bgcolor" CLASS="$plain_cellstyle">
+ <A NAME="navbar_${fileposition}_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" CLASS="$plain_cellstyle">
<TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">
- <FONT CLASS="NavBarFont1Rev"><B>Site</B></FONT>
+ <TD BGCOLOR="$dist_bgcolor" CLASS="$dist_cellstyle">
+ <A HREF="$dir/overview-summary.html"><FONT
CLASS="$dist_fontstyle"><B>Overview</B></FONT></A>
</TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">
- <FONT CLASS="NavBarFont1Rev"><B>Distribution</B></FONT>
+ <TD BGCOLOR="$classgroup_bgcolor" CLASS="$classgroup_cellstyle">
+ <FONT CLASS="$classgroup_fontstyle">Class-Group</FONT>
</TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <FONT CLASS="NavBarFont1">Class-Group</FONT>
- </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <FONT CLASS="NavBarFont1">Class</FONT>
+ <TD BGCOLOR="$class_bgcolor" CLASS="$class_cellstyle">
+ <FONT CLASS="$class_fontstyle"><B>Class</B></FONT>
</TD>
-
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <FONT CLASS="NavBarFont1">Use</FONT>
+ <TD BGCOLOR="$use_bgcolor" CLASS="$use_cellstyle">
+ <FONT CLASS="$use_fontstyle">Use</FONT>
</TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A HREF="overview-tree.html"><FONT
CLASS="NavBarFont1"><B>Tree</B></FONT></A>
+ <TD BGCOLOR="$tree_bgcolor" CLASS="$tree_cellstyle">
+ <A HREF="$dir/overview-tree.html"><FONT
CLASS="$tree_fontstyle"><B>Tree</B></FONT></A>
</TD>
<!--
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A HREF="deprecated-list.html"><FONT
CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>
+ <TD BGCOLOR="$deprecated_bgcolor" CLASS="$deprecated_cellstyle">
+ <A HREF="$dir/deprecated-list.html"><FONT
CLASS="$deprecated_fontstyle"><B>Deprecated</B></FONT></A>
</TD>
-->
</TR>
@@ -1241,17 +1309,17 @@
</TD>
<TD BGCOLOR="white" CLASS="NavBarCell2">
<FONT SIZE="-2">
- <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
- <A HREF="overview-summary.html" TARGET="_top"><B>NO
FRAMES</B></A>
+ <A HREF="$dir/index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="$dir/overview-summary.html" TARGET="_top"><B>NO
FRAMES</B></A>
<SCRIPT>
<!--
if(window==top) {
- document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All
Classes</B></A>');
+ document.writeln('<A HREF="$dir/allclasses-noframe.html"
TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
- <A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
+ <A HREF="$dir/allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT>
</TD>
@@ -1259,12 +1327,9 @@
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
EOF
+
$html;
}
-
-#############################################################################
-# Utility functions
-#############################################################################
sub read_file {
my ($file) = @_;