Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some missing files from postprocesser.
[simgrid.git] / tools / doxygen / doxygen_postprocesser.pl
index d412ec9..6481604 100755 (executable)
@@ -5,7 +5,7 @@ use strict;
 # Add here the pages of the documentation generated by a @page doxygen macro
 my @extra_files = qw(html/index.html html/faq.html html/history.html html/contrib.html html/people.html
                      html/publis.html html/publis_core.html html/publis_extern.html html/publis_intra.html
-                     html/pages.html html/modules.html  index.php 
+                     html/pages.html html/modules.html html/annotated.html html/functions.html html/functions_vars.html index.php 
                      html/GRAS_tut.html);
 
 # GRAS tutorial
@@ -148,7 +148,7 @@ while ($line = <IN>) {
   print OUT $line;
 }
 
-print OUT "<div class=\"tabs\">\n  <ul>\n";
+print OUT "<div class=\"tabs\">\n  <ul class=\"tablist\">\n";
 foreach $current (@{ ${$top->{'down'}}[0]->{'down'} }) {
   print OUT "   <li><a href=\"$current->{'file'}\"><span>$current->{'label'}</span></a></li>\n";
 }
@@ -184,7 +184,7 @@ sub handle_pub{
        print OUT $line;
     }
 
-    print OUT "<div class=\"tabs\">\n  <ul>\n";
+    print OUT "<div class=\"tabs\">\n<ul class=\"tablist\">\n";
     foreach my $page (@pub_titles) {
        print OUT "         <li".($page eq $oldname? " class=\"current\"":"" )."> <a href=\"$page\"><span>".($pub_tabs{$page})."</span></a></li>\n";
     }
@@ -219,7 +219,7 @@ sub handle_page {
     my $lvl_it=$level;
     while ($lvl_it >= 0) {
       my $father = $iterator->{'up'};
-      $tabs[$lvl_it] = "<div class=\"tabs\">\n  <ul>\n";
+      $tabs[$lvl_it] = "<div class=\"tabs2\">\n<ul class=\"tablist\">\n";
       foreach my $bro (@{$father->{'down'}}) {
         $tabs[$lvl_it] .= "  <li".($bro==$iterator?" class=\"current\"":"")."> <a href=\"$bro->{'file'}\"><span>$bro->{'label'}</span></a></li>\n";      
       }
@@ -228,7 +228,7 @@ sub handle_page {
       $lvl_it--;
     }
     if (defined $current->{'down'}) { # there's some kid. Display them too
-      $tabs[$level+1] = "<div class=\"tabs\">\n  <ul>\n";
+      $tabs[$level+1] = "<div class=\"tabs2\">\n  <ul class=\"tablist\">\n";
       foreach my $kid (@{$current->{'down'}}) {
         $tabs[$level+1] .= "  <li> <a href=\"$kid->{'file'}\"><span>$kid->{'label'}</span></a></li>\n";      
       }
@@ -301,6 +301,8 @@ handle_page($top,-2);# skip roots (we have 2 roots) in level counting
 map {push @allfiles,$_} @extra_files;
 print "All files: ".(join(", ",@allfiles))."\n" if $debug{'parse'};
 
+my $tabs;
+
 foreach my $file (@allfiles) {
     $file =~ s/.html/.handlepage.html/ if $debug{'rename'}; # Take right name if debugging
        
@@ -314,19 +316,43 @@ foreach my $file (@allfiles) {
       print TO '<link href="simgrid.css" rel="stylesheet" type="text/css">'."\n"
         if (m|</head>|);
 
+       
       # Rework the navbar
-      if (m,<li><a href="(doc/)?index.html"><span>Main\&nbsp;Page</span></a></li>,) {
-        print TO '    <li'.($file =~ m,(doc/)?index.html, ? " class='current'" :"").'><a href="'.$1.'index.html"><span>Overview</span></a></li>'."\n";
-        print TO '    <li'.($file =~ m,(doc/)?faq.html, ? " class='current'" :"").'><a href="'.$1.'faq.html"><span>FAQ</span></a></li>'."\n";
-        next;
+      if($file =~ "^html/index.*"){
+             if ($_ =~ /<li><a href="index.html"><span>Main&#160;Page<\/span><\/a><\/li>/) {
+               print TO '      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>'."\n";
+               next;
+             }
+             elsif ($_ =~ /[\ ]*<li class="current">.*/) {
+               $_ =~ s/ class="current"//g;
+               print TO $_;
+               next;
+             }
+      }
+      if($file =~ "^html/faq.*"){
+               if ($_ =~ /[\ ]*<li class="current">.*/) {
+               $_ =~ s/ class="current"//g;
+               print TO $_;
+               next;
+             }
       }
-      if (m,<li><a href="(doc/)?annotated.html"><span>Data\&nbsp;Structures</span></a></li>,) {
-        print TO '    <li'.($file =~ m,(doc/)?publis(_[^.]*)?.html, ? " class='current'" :"").'><a href="'.$1.'publis.html"><span>Publications</span></a></li>'."\n";
-        print TO '    <li'.($file =~ m,(doc/)?people.html, ? " class='current'" :"").'><a href="'.$1.'people.html"><span>People</span></a></li>'."\n";
-        print TO '    <li'.($file =~ m,(doc/)?history.html, ? " class='current'" :"").'><a href="'.$1.'history.html"><span>History</span></a></li>'."\n";
-        print TO '    <li'.($file =~ m,(doc/)?contrib.html, ? " class='current'" :"").'><a href="'.$1.'contrib.html"><span>Contrib</span></a></li>'."\n";
-        next;
+      if( $_ =~ /<div.*class="tabs">/){$tabs = 1;}
+      if( $_ =~ /<\/div>/){$tabs = 0;}
+      if( $_ =~ /<\/ul>/ && $tabs){
+               if($file =~ "^html/faq.*"){
+               print TO '      <li class="current"><a href="faq.html"><span>FAQ&#160;Page</span></a></li>'."\n";}
+               else{
+               print TO '      <li><a href="faq.html"><span>FAQ&#160;Page</span></a></li>'."\n";}
+               print TO $_;
+               next;
       }
+#      if (m,<li><a href="(doc/)?annotated.html"><span>Data\&nbsp;Structures</span></a></li>,) {
+#        print TO '    <li'.($file =~ m,(doc/)?publis(_[^.]*)?.html, ? " class='current'" :"").'><a href="'.$1.'publis.html"><span>Publications</span></a></li>'."\n";
+#        print TO '    <li'.($file =~ m,(doc/)?people.html, ? " class='current'" :"").'><a href="'.$1.'people.html"><span>People</span></a></li>'."\n";
+#        print TO '    <li'.($file =~ m,(doc/)?history.html, ? " class='current'" :"").'><a href="'.$1.'history.html"><span>History</span></a></li>'."\n";
+#        print TO '    <li'.($file =~ m,(doc/)?contrib.html, ? " class='current'" :"").'><a href="'.$1.'contrib.html"><span>Contrib</span></a></li>'."\n";
+#        next;
+#      }
       s|<span>Modules</span>|<span>Modules API</span>|g;
       s|<span>Related&nbsp;Pages</span>|<span>Site&nbsp;Plan</span>|g;