List:Commits« Previous MessageNext Message »
From:mcbrown Date:March 30 2007 9:11am
Subject:svn commit - mysqldoc@docsrva: r5656 - trunk/tools
View as plain text  
Author: mcbrown
Date: 2007-03-30 11:11:48 +0200 (Fri, 30 Mar 2007)
New Revision: 5656

Log:
Added regexp matching for classes (to allow groups)
Added version/deprecated highlighting to output



Modified:
   trunk/tools/dyndocs-opsfuncs-generate.pl


Modified: trunk/tools/dyndocs-opsfuncs-generate.pl
===================================================================
--- trunk/tools/dyndocs-opsfuncs-generate.pl	2007-03-30 09:10:57 UTC (rev 5655)
+++ trunk/tools/dyndocs-opsfuncs-generate.pl	2007-03-30 09:11:48 UTC (rev 5656)
Changed blocks: 5, Lines Added: 36, Lines Deleted: 74; 4589 bytes

@@ -106,7 +106,7 @@
         if (defined($class))
         {
             next unless ((exists($td->{$id}->{class})) &&
-                         ($td->{$id}->{class} eq $class));
+                         ($td->{$id}->{class} =~ m/$class/));
         }
 
         if (defined($type))

@@ -310,6 +310,12 @@
             $customlist = generate_sorted_list($td,$item,undef);
         }
 
+        if (scalar @{$customlist} == 0)
+        {
+            print STDERR "WARNING: couldn't find any items matching $item, skipping\n";
+            next;
+        }
+
         $string = generate_summary_table($td,$customlist,$options);
 
         $inplacefile =~ s/<!-- DYNINCLUDE_OPSFUNCS $item -->/$string/g;

@@ -403,13 +409,22 @@
 <tbody>
 EOF
 
-    my $count = 0;
-
     foreach my $id (@{$idlist})
     {
-        print $iodest xml_row(xml_entry(sprintf('<link linkend="%s">%s</link>',
-                                               $td->{$id}->{xrefto},
-                                               join(', ',map { xml_literal(xml_escape($_)) } @{$td->{$id}->{display}}))),
+        my $versionstring = '';
+        if ($td->{$id}->{inversion})
+        {
+            $versionstring = sprintf('(v%s)',$td->{$id}->{inversion});
+        }
+        if ($td->{$id}->{deprecated})
+        {
+            $versionstring = sprintf('(deprecated %s)',$td->{$id}->{deprecated});
+        }
+
+        print $iodest xml_row(xml_entry(sprintf('<link linkend="%s">%s</link>%s',
+                                                $td->{$id}->{xrefto},
+                                                join(', ',map { xml_literal(xml_escape($_)) } @{$td->{$id}->{display}}),
+                                                $versionstring)),
                              xml_entry($td->{$id}->{description}));
     }
     print $iodest "</tbody>\n</tgroup>\n</informaltable>\n";

@@ -418,75 +433,7 @@
     return($string);
 }
 
-sub summaryrow
-{
-    my ($row,$options) = @_;
-    
-    $options = {} unless defined($options);
 
-    my @string = ();
-
-    push(@string,"<row>");
-    my $counter = 0;
-    foreach my $cell (@{$row})
-    {
-        my $attr = {};
-
-        if ($opt_genxref && ($counter == 0) && exists($options->{xref}) && defined($options->{xref}))
-        {
-            $attr->{_xref} = $options->{xref};
-            die "Have a undefined ID, which should be impossible " . Dumper($row) unless (defined($options->{xref}));
-        }
-
-        $attr->{rowsep} = $options->{rowsep}->{$counter}
-        if (exists($options->{rowsep}->{$counter}));
-
-        push @string,entry($cell,$attr);
-        $counter++;
-    }
-    push(@string,"</row>");
-    return join("\n",@string);
-}
-
-sub entry
-{
-    my ($string,$attributes) = @_;
-
-    if (defined($string) && $string ne '')
-    {
-        my $realstring = $string;
-        if (exists($attributes->{_xref}))
-        {
-            $realstring = sprintf('<link linkend="%s">%s</link>',
-                                  $attributes->{_xref},
-                                  $string);
-        }
-
-        if (scalar keys %{$attributes})
-        {
-            my @attr;
-
-            foreach my $att (keys %{$attributes})
-            {
-                next if ($att =~ m{^_});
-                push @attr,sprintf('%s="%s"',$att,$attributes->{$att});
-            }
-
-            return sprintf("<entry %s>%s</entry>",
-                           join(' ',@attr),
-                           $realstring);
-        }
-        else
-        {
-            return sprintf("<entry>%s</entry>",$realstring);
-        }
-    }
-    else
-    {
-        return "<entry/>";
-    }
-}
-
 sub vertodec
 {
     my ($ver) = @_;

@@ -547,6 +494,21 @@
         {
             $self->{tabledata}->{$self->{currentid}}->{xrefto} = $element->{Attributes}->{xrefto};
         }
+
+        if (exists($element->{Attributes}->{inversion}))
+        {
+            $self->{tabledata}->{$self->{currentid}}->{inversion} = $element->{Attributes}->{inversion};
+        }
+
+        if (exists($element->{Attributes}->{deprecated}))
+        {
+            $self->{tabledata}->{$self->{currentid}}->{deprecated} = $element->{Attributes}->{deprecated};
+        }
+
+        if (exists($element->{Attributes}->{outversion}))
+        {
+            $self->{tabledata}->{$self->{currentid}}->{outversion} = $element->{Attributes}->{outversion};
+        }
     }
 
     if ($element->{Name} eq 'display')


Thread
svn commit - mysqldoc@docsrva: r5656 - trunk/toolsmcbrown30 Mar