Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Simgrid website documentation should be OK now. It's now separated totally from the...
[simgrid.git] / tools / doxygen / index_php.pl
index ed777a5..3a2e614 100755 (executable)
@@ -14,13 +14,14 @@ my($body) = "";
 
 open FILE,$inputhtml;
 while(defined($line=<FILE>)) {
-    if($line =~/<div class="tabs">/) {
+    if($line =~/<div id=".*" class="tabs">/) {
        $onglets = $line;
        while(defined($line=<FILE>) && !($line =~/<\/div>/)) {
+               $line =~ s/ class="current"//g;
            $onglets.=$line;
        }
        $onglets.=$line;
-       $onglets.="<center></center><p><br>\n"
+       #$onglets.="<center></center><p><br>\n"
     } 
     if($line =~/<!-- ______BODY_BEGIN______ --!>(.*)$/) {
        $tmp=$1;
@@ -38,11 +39,14 @@ while(defined($line=<FILE>)) {
 }
 close FILE;
 
-$onglets =~ s/href=\"/href=\"doc\//gi;
-$onglets =~ s/src=\"/src=\"doc\//gi;
+# (?!http) : A zero-width negative look-ahead assertion. 
+# For example "/foo(?!bar)/" matches any occurrence of "foo" that isn’t followed by "bar".
 
-$body =~ s/href=\"/href=\"doc\//gi;
-$body =~ s/src=\"/src=\"doc\//gi;
+$onglets =~ s/href=\"(?!http)/href=\"doc\//gi;
+$onglets =~ s/src=\"(?!http)/src=\"doc\//gi;
+
+$body =~ s/href=\"(?!http)/href=\"doc\//gi;
+$body =~ s/src=\"(?!http)/src=\"doc\//gi;
 
 open FILE,$inputphp;
 open OUTPUT,"> $output";
@@ -50,6 +54,7 @@ open OUTPUT,"> $output";
 while(defined($line=<FILE>)) {
     chomp $line;
     if($line =~/______ONGLETS______/) {
+    $onglets =~ s/<li><a href=\"http:\/\/simgrid/<li class=\"current\"><a href=\"http:\/\/simgrid/g;
        $line =~ s/______ONGLETS______/$onglets/g;
     } elsif($line =~/______BODY______/) {
        $line =~ s/______BODY______/$body/g;