From ada64beec413781e8e11cc6106c5411962cac0fb Mon Sep 17 00:00:00 2001 From: Navarrop Date: Wed, 30 Mar 2011 16:42:28 +0200 Subject: [PATCH] Re-implement the tab. --- tools/doxygen/doxygen_postprocesser.pl | 141 +++++++++++++++++-------- 1 file changed, 96 insertions(+), 45 deletions(-) diff --git a/tools/doxygen/doxygen_postprocesser.pl b/tools/doxygen/doxygen_postprocesser.pl index 6481604be9..f50d016372 100755 --- a/tools/doxygen/doxygen_postprocesser.pl +++ b/tools/doxygen/doxygen_postprocesser.pl @@ -211,7 +211,8 @@ sub handle_page { # we generate the tabs bottom up begining from where we are in the tree # and display them top down, as it should in a file my @tabs = (); - + my $found_div_tabs=0; + if (defined ($current->{'label'}) and $current->{'label'} ne 'ROOT') { # print "handle $current->{'file'}, at level $level\n"; # generate the tabs @@ -246,8 +247,9 @@ sub handle_page { # add "current" to the module API granfather page s|
  • [^<]*
  • |
  • Modules API
  • |; # print "++Write $_"; + $found_div_tabs=1 if m/div.*class="tabs"/; print TO "$_"; - last if (m||); + last if ((m||)&&($found_div_tabs)); } print TO "\n\n"; @@ -258,26 +260,26 @@ sub handle_page { print TO "\n\n"; if ($current->{'file'} =~ m/^class/) { - while () { - last if (m||); - } + while () { + last if (m||); + } print TO "$_"; } while () { if (m/POST-PROCESSED TABS/) { - while () { + while () { last if (m/END OF POST-PROCESSED TABS/); - } - next; + } + next; } if (m/The documentation for/) { - while () { + while () { last if (m/

    /); - } + } } print TO "$_"; - } + } close FROM; close TO; rename("$newname","html/$current->{'file'}") unless $debug{'rename'}; @@ -292,8 +294,45 @@ sub handle_page { ### ### Launch the modules navbar reworking ### -handle_page($top,-2);# skip roots (we have 2 roots) in level counting +handle_page($top,-1);# skip roots (we have 2 roots) in level counting + +### +### Add the modules navbar reworking to the modules.html file +### +sub add_tabs_to_module_html { + my $found_div_tabs=0; + my $module_tabs = "

    \n
    \n"; + + my $oldname = "html/modules.html"; + open FROM,$oldname || die; + my $newname=$oldname; + $newname =~ s/.html/.handlepage.html/; + open TO,">$newname" || die; + while () { + $found_div_tabs=1 if m/div.*class="tabs"/; + print TO "$_"; + last if ((m||)&&($found_div_tabs)); + } + + print TO "\n\n"; + print TO $module_tabs; + print TO "\n\n"; + while () { + print TO "$_"; + } + close FROM; + close TO; + rename($newname, $oldname) unless $debug{'rename'}; + + # die; +} + +add_tabs_to_module_html; ### ### Post-processsing common to all pages @@ -316,43 +355,55 @@ foreach my $file (@allfiles) { print TO ''."\n" if (m||); + if($tabs){ + if($file =~ /^html\/index\..*/){ + $_ =~ s/
  • /
  • /g; + $_ =~ s/
  • /
  • /g; + } + + $_ =~ s/
  • /
  • /g; + + if($file =~ /^html\/pages\..*/){ + $_ =~ s/
  • /
  • /g; + } + } - # Rework the navbar - if($file =~ "^html/index.*"){ - if ($_ =~ /
  • Main Page<\/span><\/a><\/li>/) { - print TO '
  • Main Page
  • '."\n"; - next; - } - elsif ($_ =~ /[\ ]*
  • .*/) { - $_ =~ s/ class="current"//g; - print TO $_; - next; - } + # Add the FAQ PUBLIS PEOPLE HISTORY and CONTRIB to the top navbar. + if( $_ =~ //){ + $tabs = 1; } - if($file =~ "^html/faq.*"){ - if ($_ =~ /[\ ]*
  • .*/) { - $_ =~ s/ class="current"//g; - print TO $_; - next; - } + if( $_ =~ /<\/div>/){ + $tabs = 0; } - if( $_ =~ //){$tabs = 1;} - if( $_ =~ /<\/div>/){$tabs = 0;} if( $_ =~ /<\/ul>/ && $tabs){ - if($file =~ "^html/faq.*"){ - print TO '
  • FAQ Page
  • '."\n";} - else{ - print TO '
  • FAQ Page
  • '."\n";} - print TO $_; - next; - } -# if (m,
  • Data\ Structures
  • ,) { -# print TO ' Publications'."\n"; -# print TO ' People'."\n"; -# print TO ' History'."\n"; -# print TO ' Contrib'."\n"; -# next; -# } + my $tmp_buff=""; + $tmp_buff .= '
  • Publications
  • '."\n"; + $tmp_buff .= '
  • People
  • '."\n"; + $tmp_buff .= '
  • History
  • '."\n"; + $tmp_buff .= '
  • Contrib
  • '."\n"; + $tmp_buff .= '
  • FAQ Page
  • '."\n"; + $tmp_buff .= $_; + $tabs = 0; + + # Rework the navbar + # Fix the current "button" of buggy Doxygen tabs + if($file =~ /^html\/faq.*/ + || $file =~ /^html\/publis.*/ + || $file =~ /^html\/people.*/ + || $file =~ /^html\/history.*/ + || $file =~ /^html\/contrib.*/) + { + my $filename = $file; + $filename =~ s/html\///g; + $filename =~ s/\.html//g; + $filename =~ s/publis_.*/publis/g; + $tmp_buff =~ s/
  • /
  • /g; + $tmp_buff =~ s/
  • /
  • /g; + } + print TO $tmp_buff; + next; + } + s|Modules|Modules API|g; s|Related Pages|Site Plan|g; -- 2.20.1