cvsuser     02/02/02 09:46:20

  Modified:    P5EEx/Blue/sbin perldocs
  Log:
  cleaned up class lists and inheritance trees by getting out the planned classes
  
  Revision  Changes    Path
  1.7       +101 -17   p5ee/P5EEx/Blue/sbin/perldocs
  
  Index: perldocs
  ===================================================================
  RCS file: /cvs/public/p5ee/P5EEx/Blue/sbin/perldocs,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- perldocs  31 Jan 2002 20:57:32 -0000      1.6
  +++ perldocs  2 Feb 2002 17:46:20 -0000       1.7
  @@ -1,24 +1,27 @@
   #!/usr/local/bin/perl
   
   #############################################################################
  -## $Id: perldocs,v 1.6 2002/01/31 20:57:32 spadkins Exp $
  +## $Id: perldocs,v 1.7 2002/02/02 17:46:20 spadkins Exp $
   #############################################################################
   ## (c) 2002 Stephen Adkins <[EMAIL PROTECTED]>
   ## This is free software, available under the same terms as Perl itself.
   #############################################################################
   ## TODO
  -##   o separate documents from classes in lower-left frame
  -##   o separate implemented from non-implemented classes in inheritance tree
  -##   o add option not to include non-implemented classes in All Classes lists
  +##   x separate documents from classes in lower-left frame
  +##   x remove non-implemented classes from inheritance tree
   ##   o add header menu to each of the class doc files
  -##   o implement "Deprecated" list
  +##   o remove "Deprecated" from the menu
   ##   o implement "Use" list
   ##   o use Template::Toolkit to generate docs (rather than embedded HTML)
  +##   o get documents out of the class hierarchy
   ##     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   ##   o allow programmatic access to source code metadata
   ##   o add concept of a "Distribution" (and "Installation" and "Site")
   ##   o rewrite to document uncommented code (i.e. all of /usr/local/lib/perl5)
   ##   o rewrite as OO code that models the source code (tie in with CPAN objects?)
  +##   o implement "Deprecated" list
  +##   o improve the document-detection rules
  +##   o revive the "Documents (planned)" section
   #############################################################################
   
   =head1 NAME
  @@ -515,7 +518,7 @@
       &write_index();
       &write_overview();
       &write_overview_summary();
  -    &write_overview_tree();
  +    &write_all_trees();
   }
   
   sub write_index {
  @@ -618,31 +621,98 @@
   </HEAD>
   <BODY bgcolor="white" link="#660000" alink="#990000" vlink="#990000" 
onload="asd();">
   
  -<FONT size="+1" CLASS="FrameHeadingFont"><B>$title</B></FONT><BR>
  -
   <TABLE BORDER="0" WIDTH="100%">
     <TR>
       <TD NOWRAP><FONT CLASS="FrameItemFont">
  +      <FONT size="+1" CLASS="FrameHeadingFont"><B>$title</B></FONT><P>
   EOF
  -    my ($htmlfile, $class, $classname);
  +    my ($htmlfile, $is_doc, $doc_html, $doc_nonimp_html, $class_html, 
$class_nonimp_html, $class, $classname);
  +
  +    $doc_html = "";
  +    $doc_nonimp_html = "";
  +    $class_html = "";
  +    $class_nonimp_html = "";
   
       foreach $class (sort @{$data{classgroup}{$class_group}{classes}}) {
           $classname = $class;
           $classname =~ s/^P5EEx::Blue:://;
           $htmlfile = $data{class}{$class}{podclass};
  +
  +        # TODO: fix up these rules
  +        if ($classname =~ /^[a-z]/) {
  +            $is_doc = 1;
  +        }
  +        elsif ($classname =~ /::/) {
  +            $is_doc = 0;
  +        }
  +        elsif ($classname =~ /^[A-Z][a-zA-Z0-9]*$/) {
  +            $is_doc = 0;
  +        }
  +        else {
  +            $is_doc = 1;
  +        }
  +
  +        if ($is_doc) {
           if ($htmlfile) {
               $htmlfile =~ s!::!/!g;
               $htmlfile = "../${htmlfile}.html";
  -            $html .= <<EOF;
  +                $doc_html .= <<EOF;
         <A HREF="$htmlfile" TARGET="classFrame">$classname</A><BR>
   EOF
           }
           else {
  -            $html .= <<EOF;
  +                $doc_nonimp_html .= <<EOF;
         $classname<BR>
   EOF
           }
       }
  +        else {
  +            if ($htmlfile) {
  +                $htmlfile =~ s!::!/!g;
  +                $htmlfile = "../${htmlfile}.html";
  +                $class_html .= <<EOF;
  +      <A HREF="$htmlfile" TARGET="classFrame">$classname</A><BR>
  +EOF
  +            }
  +            else {
  +                $class_nonimp_html .= <<EOF;
  +      $classname<BR>
  +EOF
  +            }
  +        }
  +    }
  +
  +    if ($doc_html) {
  +        $html .= <<EOF;
  +      <FONT size="+0" CLASS="xFrameHeadingFont"><B>Documents</B></FONT><BR>
  +$doc_html
  +<p>
  +EOF
  +    }
  +
  +    if ($class_html) {
  +        $html .= <<EOF;
  +      <FONT size="+0" CLASS="xFrameHeadingFont"><B>Classes</B></FONT><BR>
  +$class_html
  +<p>
  +EOF
  +    }
  +
  +#    if ($doc_nonimp_html) {
  +#        $html .= <<EOF;
  +#      <FONT size="+0" CLASS="xFrameHeadingFont"><B>Documents 
(planned)</B></FONT><BR>
  +#$doc_nonimp_html
  +#<p>
  +#EOF
  +#    }
  +
  +    if ($class_nonimp_html) {
  +        $html .= <<EOF;
  +      <FONT size="+0" CLASS="xFrameHeadingFont"><B>Classes (planned)</B></FONT><BR>
  +$class_nonimp_html
  +<p>
  +EOF
  +    }
   
       $html .= <<EOF;
       </FONT></TD>
  @@ -697,8 +767,10 @@
             <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
               <A HREF="overview-tree.html"><FONT 
CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;
             </TD>
  +<!--
             <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
               <A HREF="deprecated-list.html"><FONT 
CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;
  +-->
             </TD>
           </TR>
         </TABLE>
  @@ -805,7 +877,9 @@
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT 
CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT 
CLASS="NavBarFont1">Use</FONT>&nbsp;</TD>
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT 
CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  +<!--
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A 
HREF="deprecated-list.html"><FONT 
CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  +-->
     </TR>
   </TABLE>
   </TD>
  @@ -843,7 +917,7 @@
       &write_file("$dir/api/overview-summary.html", $html);
   }
   
  -sub write_overview_tree {
  +sub write_all_trees {
       &write_class_group_tree("allclasses");
       my ($class_group);
       foreach $class_group (sort keys %{$data{classgroup}}) {
  @@ -884,7 +958,9 @@
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT 
CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT 
CLASS="NavBarFont1">Use</FONT>&nbsp;</TD>
     <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT 
CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD>
  +<!--
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A 
HREF="deprecated-list.html"><FONT 
CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  +-->
     </TR>
   </TABLE>
   </TD>
  @@ -969,7 +1045,9 @@
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT 
CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT 
CLASS="NavBarFont1">Use</FONT>&nbsp;</TD>
     <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT 
CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD>
  +<!--
     <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A 
HREF="deprecated-list.html"><FONT 
CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  +-->
     </TR>
   </TABLE>
   
  @@ -1017,6 +1095,7 @@
   sub class_group_tree {
       my ($class_group) = @_;
       my ($class, $class2, $html, $children, $classes, @root_classes, 
%selected_classes);
  +    my ($htmlfile);
       %selected_classes = ();
       $html = "";
       $classes = $data{classgroup}{$class_group}{classes};
  @@ -1043,8 +1122,11 @@
   
           $html .= "<ul>\n";
           foreach $class (sort @root_classes) {
  +            $htmlfile = $data{class}{$class}{podclass};
  +            if ($htmlfile) {  # only include classes which are implemented
               $html .= &class_tree($class, \%selected_classes);
           }
  +        }
           $html .= "</ul>\n";
       }
       $html;
  @@ -1064,7 +1146,7 @@
       $htmlfile = $data{class}{$class}{podclass};
       if ($htmlfile) {
           $htmlfile =~ s!::!/!g;
  -        $htmlfile = "../$htmlfile";
  +        $htmlfile = "../$htmlfile.html";
           $html = "<li type=\"circle\"><a 
href=\"$htmlfile\">$class</a>$parents_text\n";
       }
       else {
  @@ -1123,9 +1205,11 @@
             <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
               &nbsp;<A HREF="overview-tree.html"><FONT 
CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;
             </TD>
  +<!--
             <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
               &nbsp;<A HREF="deprecated-list.html"><FONT 
CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;
             </TD>
  +-->
           </TR>
         </TABLE>
       </TD>
  
  
  


Reply via email to