Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Changed the way current_context is handled in smx_context_java
[simgrid.git] / doxygen_postprocesser.pl
1 #! /usr/bin/perl
2
3 use strict;
4
5 # Add here the pages of the documentation generated by a @page doxygen macro
6 my @extra_files = qw(html/index.html html/install.html);
7
8 ###
9 ### Post-processsing common to all pages
10 ###
11 my $tabs = 0;
12
13 foreach my $file (@extra_files) {
14         
15 open FROM,"$file" || die;
16 my $outfile = "$file";
17 $outfile =~ s/.(html|php)$/.new.$1/;
18 open TO,">$outfile" || die;
19
20 print "file: ".$file."\n";
21
22 while (<FROM>) {
23         
24         if( $_ =~ /<div.*class="tabs">/){
25         $tabs = 1;
26         }
27         if( $_ =~ /<\/div>/ && $tabs){
28         $tabs = 0;
29         }
30
31         if( $_ =~ /<li.*>/ && $tabs){
32                 my $tmp_buff="";
33                 $tmp_buff .= $_;
34                 $tmp_buff .= '      <li><a href="install.html"><span>Install and Use</span></a></li>'."\n";
35                 $tmp_buff .= '      <li><a href="javadoc/index.html"><span>Javadoc</span></a></li>'."\n";
36                 $tmp_buff .= '      <li><a href="http://simgrid.gforge.inria.fr/"><span>Website</span></a></li>'."\n";
37                 $tabs = 0;
38         
39                 my $filename = $file;
40                 $filename =~ s/html\///g;
41                 $filename =~ s/\.html//g;
42                 $tmp_buff =~ s/<li class="current">/<li>/g;
43                 $tmp_buff =~ s/<li><a href="$filename.html">/<li class="current"><a href="$filename.html">/g;     
44
45                 print TO $tmp_buff;           
46                 next;
47         }       
48
49         s|<li.*><a href="pages.html"><span>.*</span></a></li>\n||g;
50                                                                                            
51         print TO $_;
52         }
53
54 close FROM;
55 close TO;
56 rename("$outfile", "$file");
57 }