From 5b194fdc6064c36b3bf84fe3dddd5ad3bbac3488 Mon Sep 17 00:00:00 2001 From: alegrand Date: Mon, 5 Dec 2005 12:34:10 +0000 Subject: [PATCH] table of contents builder git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1853 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- tools/doxygen/toc_create.pl | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 tools/doxygen/toc_create.pl diff --git a/tools/doxygen/toc_create.pl b/tools/doxygen/toc_create.pl new file mode 100755 index 0000000000..52fbd09d22 --- /dev/null +++ b/tools/doxygen/toc_create.pl @@ -0,0 +1,79 @@ +#!/usr/bin/perl -w + +($#ARGV >= 1) or die "Usage: index_create.pl "; + +my(@toc); +my($level,$label,$name); + +$input = $ARGV[0]; +$output = $ARGV[1]; +open FILE,$input; + +while($line=) { + chomp $line; + if($line=~/\\section\s*(\S\S*)\s*(.*)$/) { +# print "$line\n"; + $label = $1; + $name = $2; + $level=0; +# print "$label : $name\n"; + push @toc,[$level,$label,$name]; + } elsif($line=~/\\subsection\s*(\S\S*)\s*(.*)$/) { +# print "$line\n"; + $label = $1; + $name = $2; + $level=1; +# print "\t$label : $name\n"; + push @toc,[$level,$label,$name]; + } elsif($line=~/\\subsubsection\s*(\S\S*)\s*(.*)$/) { +# print "$line\n"; + $label = $1; + $name = $2; + $level=2; +# print "\t\t$label : $name\n"; + push @toc,[$level,$label,$name]; + } +} +close FILE; + +open OUTPUT,"> $output"; +my($current_level)=-1; +my($entry); +print OUTPUT "\n"; +foreach $entry (@toc) { + ($level,$label,$name) = @$entry; + + if($current_level<$level) { + print OUTPUT "
    \n"; + } + if($current_level>$level) { + print OUTPUT "
\n"; + } + $current_level = $level; + foreach (1..$current_level) { + print OUTPUT "\t"; + } + print OUTPUT "
  • $name\n"; +} + +$current_level=-1; +print OUTPUT "\n"; +print OUTPUT "\n"; + + +# foreach $type qw(define enumeration enumvalue function typedef) { +# if(defined $database{$type}) { +# print OUTPUT "

    $type

    \n
      \n"; +# foreach $name (sort keys %{$database{$type}}) { +# if($type eq "function") { +# print OUTPUT "\t
    • $name()
    • \n"; +# } else { +# print OUTPUT "\t
    • #$name
    • \n"; +# } +# } +# print OUTPUT "\n
    \n"; +# } +# } +# print OUTPUT "*/"; +# close OUTPUT; + -- 2.20.1