+
+
+###
+### Post-processsing common to all pages
+###
+map {push @allfiles,$_} @extra_files;
+print "All files: ".(join(", ",@allfiles))."\n" if $debug{'parse'};
+
+foreach my $file (@allfiles) {
+ $file =~ s/.html/.handlepage.html/ if $debug{'rename'}; # Take right name if debugging
+
+ open FROM,"$file" || die;
+ my $outfile = "$file";
+ $outfile =~ s/.(html|php)$/.new.$1/;
+ open TO,">$outfile" || die;
+# print "POSTPROCESSING $file (tmp=$outfile)\n";
+ while (<FROM>) {
+ # Add the simgrid css, just in case
+ 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\ 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 (m,<li><a href="(doc/)?annotated.html"><span>Data\ 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 Pages</span>|<span>Site Plan</span>|g;
+
+ print TO $_;
+ }
+ close FROM;
+ close TO;
+ rename("$outfile", "$file") unless $debug{'rename'};
+}
+
+
+